LAPTOP-SNT8I5JK\Boounion
2024-11-18 0239509af412b74083b33a6924ffd79007dfda5f
SourceCode/Bond/BondEq/CBonder.cpp
@@ -60,7 +60,6 @@
{
   m_listener.onStateChanged = listener.onStateChanged;
   m_listener.onPlcStateChanged = listener.onPlcStateChanged;
   m_listener.onCimStateChanged = listener.onCimStateChanged;
   m_listener.onEfemStateChanged = listener.onEfemStateChanged;
   m_listener.onRecvBroadcast = listener.onRecvBroadcast;
}
@@ -68,6 +67,11 @@
const std::vector<CComponent*>& CBonder::getComponents()
{
   return m_components;
}
CPLC* CBonder::getPLC(const char* pszName)
{
   return (CPLC*)GetComponent("PLC(1)");
}
int CBonder::save()
@@ -187,7 +191,6 @@
   pPlc->setName("PLC(1)");
   pPlc->setDescription("PLC");
   pPlc->setIndex(0);
   pPlc->init();
   AddComponent(pPlc);
@@ -449,6 +452,17 @@
      item->OnTimer(nTimerid);
   }
   // PLC延时连接
   static int nPlc = 0;
   nPlc++;
   if (nPlc == 3) {
      CPLC* pPLC = (CPLC*)GetComponent("PLC(1)");
      pPLC->init();
   }
   // 自动保存
   static int iii = 0;
   iii++;
   if (iii % 5 == 0) {