| | |
| | | } |
| | | } |
| | | else if (code == RX_CODE_ALARM_ON) { |
| | | AlarmOn(); |
| | | // CAlarmMonitor* pComponent = (CAlarmMonitor*)theApp.m_model.getBonder().GetComponent(ALARM_MONITOR); |
| | | // m_pTopToolbar->GetBtn(IDC_BUTTON_ALARM)->EnableWindow(pComponent->isAlarming()); |
| | | CPLC* pPlc; |
| | | if (pAny->getPtrValue("ptr", (void*&)pPlc) && pPlc == theApp.m_model.getCurrentPlc()) { |
| | | AlarmOn(pPlc); |
| | | CAlarmMonitor* pComponent = (CAlarmMonitor*)pPlc->getComponent(ALARM_MONITOR); |
| | | m_pTopToolbar->GetBtn(IDC_BUTTON_ALARM)->EnableWindow(pComponent->isAlarming()); |
| | | } |
| | | } |
| | | else if (code == RX_CODE_ALARM_OFF) { |
| | | AlarmOff(); |
| | | // CAlarmMonitor* pComponent = (CAlarmMonitor*)theApp.m_model.getBonder().GetComponent(ALARM_MONITOR); |
| | | // m_pTopToolbar->GetBtn(IDC_BUTTON_ALARM)->EnableWindow(pComponent->isAlarming()); |
| | | CPLC* pPlc; |
| | | if (pAny->getPtrValue("ptr", (void*&)pPlc) && pPlc == theApp.m_model.getCurrentPlc()) { |
| | | AlarmOff(pPlc); |
| | | CAlarmMonitor* pComponent = (CAlarmMonitor*)pPlc->getComponent(ALARM_MONITOR); |
| | | m_pTopToolbar->GetBtn(IDC_BUTTON_ALARM)->EnableWindow(pComponent->isAlarming()); |
| | | } |
| | | } |
| | | pAny->release(); |
| | | }, [&]() -> void { |
| | |
| | | m_pMainContainer->Resize(); |
| | | } |
| | | |
| | | void CBoounionPLCDlg::AlarmOn() |
| | | void CBoounionPLCDlg::AlarmOn(CPLC* pPlc) |
| | | { |
| | | if (m_pAlarmWnd == nullptr) { |
| | | m_pAlarmWnd = new CAlarmPopupDlg(); |
| | | //m_pAlarmWnd->SetPLC(theApp.m_model.getBonder().getPLC("PLC(1)")); |
| | | m_pAlarmWnd->SetPLC(pPlc); |
| | | m_pAlarmWnd->Create(IDD_DIALOG_POPUP_ALARM, this); |
| | | m_pAlarmWnd->CenterWindow(); |
| | | } |
| | | m_pAlarmWnd->AlarmOn(); |
| | | } |
| | | |
| | | void CBoounionPLCDlg::AlarmOff() |
| | | void CBoounionPLCDlg::AlarmOff(CPLC* pPlc) |
| | | { |
| | | if (m_pAlarmWnd == nullptr) { |
| | | m_pAlarmWnd = new CAlarmPopupDlg(); |
| | | //m_pAlarmWnd->SetPLC(theApp.m_model.getBonder().getPLC("PLC(1)")); |
| | | m_pAlarmWnd->SetPLC(pPlc); |
| | | m_pAlarmWnd->Create(IDD_DIALOG_POPUP_ALARM, this); |
| | | m_pAlarmWnd->CenterWindow(); |
| | | } |