| | |
| | | { |
| | | 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; |
| | | } |
| | |
| | | const std::vector<CComponent*>& CBonder::getComponents() |
| | | { |
| | | return m_components; |
| | | } |
| | | |
| | | CPLC* CBonder::getPLC(const char* pszName) |
| | | { |
| | | return (CPLC*)GetComponent("PLC(1)"); |
| | | } |
| | | |
| | | int CBonder::save() |
| | |
| | | pPlc->setName("PLC(1)"); |
| | | pPlc->setDescription("PLC"); |
| | | pPlc->setIndex(0); |
| | | pPlc->init(); |
| | | AddComponent(pPlc); |
| | | |
| | | |
| | |
| | | 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) { |