| | |
| | | LOGI("onEQConstantRequest: %d, %s", item.id, item.szValue); |
| | | } |
| | | }; |
| | | |
| | | listener.onDatetimeSync = [&](void* pFrom, SYSTEMTIME& time) -> void { |
| | | LOGI("onDatetimeSync: %d%02d%02d%02d%02d%02d", time.wYear, |
| | | time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond); |
| | | m_master.datetimeSync(time); |
| | | }; |
| | | listener.onEnableDisableEventReport = [&](void* pFrom, bool bEnable, std::vector<unsigned int> ids) -> void { |
| | | LOGI("EanbleDisableEventReport bEnable:%s", bEnable ? _T("YES") : _T("NO")); |
| | | if (ids.empty()) { |
| | | m_master.enableEventReport(bEnable); |
| | | } |
| | | }; |
| | | listener.onEnableDisableAlarmReport = [&](void* pFrom, bool bEnable, unsigned int id) -> void { |
| | | LOGI("onEnableDisableAlarmReport bEnable:%s, id:%d", bEnable ? _T("YES") : _T("NO"), id); |
| | | if (id == 0) { |
| | | m_master.enableAlarmReport(bEnable); |
| | | } |
| | | }; |
| | | m_hsmsPassive.setListener(listener); |
| | | m_hsmsPassive.setEquipmentModelType((LPTSTR)(LPCTSTR)strModeType); |
| | | m_hsmsPassive.setSoftRev((LPTSTR)(LPCTSTR)strSoftRev); |
| | | CString strVarialbleFile; |
| | | strVarialbleFile.Format(_T("%s\\VariableList.txt"), (LPTSTR)(LPCTSTR)m_strWorkDir); |
| | | m_hsmsPassive.loadVarialbles((LPTSTR)(LPCTSTR)strVarialbleFile); |
| | | m_hsmsPassive.init(this, "APP", 7000); |
| | | strVarialbleFile.Format(_T("%s\\ReportList.txt"), (LPTSTR)(LPCTSTR)m_strWorkDir); |
| | | m_hsmsPassive.loadReports((LPTSTR)(LPCTSTR)strVarialbleFile); |
| | | strVarialbleFile.Format(_T("%s\\CollectionEventList.txt"), (LPTSTR)(LPCTSTR)m_strWorkDir); |
| | | m_hsmsPassive.loadCollectionEvents((LPTSTR)(LPCTSTR)strVarialbleFile); |
| | | |
| | | |
| | | SERVO::MasterListener masterListener; |
| | |
| | | notify(RX_CODE_MASTER_STATE_CHANGED); |
| | | }; |
| | | masterListener.onEqAlive = [&](void* pMaster, SERVO::CEquipment* pEquipment, BOOL bAlive) -> void { |
| | | LOGI("<CModel>Equipment onAlive:%s(%s).\n", pEquipment->getName().c_str(), |
| | | LOGI("<CModel>Equipment onAlive:%s(%s).", pEquipment->getName().c_str(), |
| | | bAlive ? _T("ON") : _T("OFF")); |
| | | notifyPtr(RX_CODE_EQ_ALIVE, pEquipment); |
| | | |
| | | }; |
| | | masterListener.onEqCimStateChanged = [&](void* pMaster, SERVO::CEquipment* pEquipment, BOOL bOn) -> void { |
| | | LOGI("<CModel>Equipment Cim State:%s(%s).\n", pEquipment->getName().c_str(), |
| | | LOGI("<CModel>Equipment Cim State:%s(%s).", pEquipment->getName().c_str(), |
| | | bOn ? _T("ON") : _T("OFF")); |
| | | notifyPtr(RX_CODE_EQ_ALIVE, pEquipment); |
| | | |
| | |
| | | notify(RX_CODE_ALARM_CLEAR); |
| | | } |
| | | |
| | | m_hsmsPassive.requestAlarmReport(state, |
| | | pEquipment->getBaseAlarmId() + alarmId, |
| | | strAlarmText.c_str()); |
| | | if (m_master.isAlarmReportEnable()) { |
| | | m_hsmsPassive.requestAlarmReport(state, |
| | | pEquipment->getBaseAlarmId() + alarmId, |
| | | strAlarmText.c_str()); |
| | | } |
| | | }; |
| | | masterListener.onEqVcrEventReport = [&](void* pMaster, SERVO::CEquipment* pEquipment, SERVO::CVcrEventReport* pReport) { |
| | | LOGE("<CModel>onEqVcrEventReport."); |