LAPTOP-SNT8I5JK\Boounion
2025-02-20 4cc9fd5bb0c0224e88ca702e6e736e1bc138dce6
SourceCode/Bond/Servo/CEquipment.cpp
@@ -15,6 +15,7 @@
      m_bLocalAlarm = FALSE;
      m_bAutoRecipeChange = FALSE;
      m_bVCREnable[0] = FALSE;
      m_pCclink = nullptr;
      InitializeCriticalSection(&m_criticalSection);
   }
@@ -32,6 +33,11 @@
   {
      m_listener.onAlive = listener.onAlive;
      m_listener.onCimStateChanged = listener.onCimStateChanged;
   }
   void CEquipment::setCcLink(CCCLinkIEControl* pCcLink)
   {
      m_pCclink = pCcLink;
   }
   void CEquipment::getProperties(std::vector<std::pair<std::string, std::string>>& container)
@@ -54,6 +60,7 @@
   {
      auto iter = m_mapStep.find(addr);
      if (iter != m_mapStep.end()) return -1;
      pStep->setCcLink(m_pCclink);
      m_mapStep[addr] = pStep;
      return 0;
   }
@@ -119,7 +126,7 @@
   void CEquipment::setReadBitBlock(unsigned int start, unsigned int end)
   {
      m_blockReadBit.type = (unsigned int)DeviceType::LB;;
      m_blockReadBit.type = (unsigned int)DeviceType::B;
      m_blockReadBit.start = start;
      m_blockReadBit.end = end;
      m_blockReadBit.size = (m_blockReadBit.end - m_blockReadBit.start + 1) / 8;
@@ -168,12 +175,13 @@
   void CEquipment::onReceiveLBData(const char* pszData, size_t size)
   {
      /*
      TRACE("%s onReceiveLBData: %d bytes\n", m_strName.c_str(), size);
      for (unsigned int i = 0; i < size; i++) {
         if (pszData[i] != 0)
            TRACE("%d[%x]\n", i, pszData[i]);
      }
      */
      // 以下解释和处理数据
      BOOL bFlag;
@@ -239,21 +247,11 @@
      // Equipment Mode Change Report
      index = 0x360;
      bFlag = isBitOn(pszData, size, ++index);
      static int i;
      i++;
      if (i > 10) bFlag = TRUE;
      if (i > 15) bFlag = FALSE;
      if (i > 110) bFlag = TRUE;
      if (i > 115) bFlag = FALSE;
      //if (i == 12) bFlag = FALSE;
      bFlag = isBitOn(pszData, size, index);
      CStep* pStep = getStep(0x360);
      if (pStep != nullptr) {
         pStep->onSignal(bFlag);
      }
   }
   BOOL CEquipment::isBitOn(const char* pszData, size_t size, int index)