LAPTOP-SNT8I5JK\Boounion
2025-01-02 d362ec98ec0db2039944da31729ad8efcd72834a
SourceCode/Bond/BondEq/CBonder.cpp
@@ -133,6 +133,7 @@
   AddComponent(pEQStateMonitor1);
   pEQStateMonitor1->init();
   m_bMute = false;
   // 初始化各种组件
   // 读PLC1配置
@@ -185,7 +186,7 @@
   pPlc->addMonitor(1, 4400, 4499, MC::SOFT_COMPONENT::D, m_pPlcData);
   pPlc->addMonitor(2, 4500, 4599, MC::SOFT_COMPONENT::D, &m_pPlcData[200]);
   pPlc->addMonitor(3, 4700, 4791, MC::SOFT_COMPONENT::D, &m_pPlcData[400]);
   pPlc->addMonitor(MONITOR_ID_ALARM, 1001, 1064, MC::SOFT_COMPONENT::M, &m_pPlcData[600]);
   pPlc->addMonitor(MONITOR_ID_ALARM, 10001, 10064, MC::SOFT_COMPONENT::M, &m_pPlcData[600]);
   
   pPlc->setName("PLC(1)");
   pPlc->setDescription("PLC");
@@ -428,6 +429,27 @@
   iii++;
   if (iii % 5 == 0) {
      save();
   }
   // 测试
   BOOL bTest = FALSE;
   if (bTest) {
      static int xx = 0;
      xx++;
      memset(&m_pPlcData[600], 0, 260);
      if (xx == 12) {
         m_pPlcData[600] = 0x01;
         for (auto c : m_components) {
            c->onData(MONITOR_ID_ALARM, &m_pPlcData[600], 260);
         }
      }
      else if (xx == 20) {
         m_pPlcData[600] = 0x00;
         for (auto c : m_components) {
            c->onData(MONITOR_ID_ALARM, &m_pPlcData[600], 260);
         }
      }
   }
}
@@ -950,4 +972,12 @@
   return iter->second;
}
bool CBonder::isMute()
{
   return m_bMute;
}
void CBonder::setMute(bool bMute)
{
   m_bMute = bMute;
}