| | |
| | | #include "CProjectPageComponents.h" |
| | | #include "afxdialogex.h" |
| | | #include "Alarm.h" |
| | | #include "AlarmMonitor.h" |
| | | |
| | | |
| | | // CProjectPageComponents 对话框 |
| | |
| | | IMPLEMENT_DYNAMIC(CProjectPageComponents, CDialogEx) |
| | | |
| | | CProjectPageComponents::CProjectPageComponents(CWnd* pParent /*=nullptr*/) |
| | | : CDialogEx(IDD_PROJECT_PAGE_COMPENTS, pParent) |
| | | : CDialogEx(IDD_PROJECT_PAGE_COMPONENTS, pParent) |
| | | { |
| | | m_crBkgnd = PROPAGE_BACKGROUND_COLOR; |
| | | m_hbrBkgnd = nullptr; |
| | |
| | | } |
| | | } |
| | | } |
| | | else if (RX_CODE_ALARM_EVENT == code) { |
| | | CComponent* pComponent = nullptr; |
| | | CAlarm* pAlarm = nullptr; |
| | | pAny->getObject("obj", (IRxObject*&)pAlarm); |
| | | else if (RX_CODE_ALARM_ON == code |
| | | || RX_CODE_ALARM_OFF == code) { |
| | | CAlarmMonitor* pComponent = nullptr; |
| | | pAny->getPtrValue("ptr", (void*&)pComponent); |
| | | ASSERT(pComponent); |
| | | ASSERT(pAlarm); |
| | | HTREEITEM hItem = getTreeItem(pComponent); |
| | | if (hItem != nullptr) { |
| | | if(pAlarm->getStatus() == 1) |
| | | if (pComponent->isAlarming()) |
| | | m_treeComponents.ShowItemBadgeDotMode(hItem); |
| | | else if (pAlarm->getStatus() == 2) |
| | | else |
| | | m_treeComponents.HideItemBadge(hItem); |
| | | } |
| | | } |