| | |
| | | #include "Log.h" |
| | | #include "Common.h" |
| | | #include "HorizontalLine.h" |
| | | #include "ServoDlg.h" |
| | | |
| | | |
| | | IMPLEMENT_DYNAMIC(CAlarmPopupDlg, CDialogEx) |
| | |
| | | |
| | | m_activeAlarm = m_activeAlarms[idx]; |
| | | |
| | | // 标记已读 |
| | | if (auto* pParent = dynamic_cast<CServoDlg*>(GetParent())) { |
| | | pParent->AckAlarm(m_activeAlarm.nId); |
| | | } |
| | | |
| | | AlarmManager& alarmManager = AlarmManager::getInstance(); |
| | | const AlarmInfo* info = alarmManager.getAlarmInfoByID(m_activeAlarm.nId); |
| | | |
| | |
| | | SetDlgItemText(IDC_LABEL_RUNTIME, pszText); |
| | | } |
| | | |
| | | void CMyStatusbar::setJobText(const char* pszText) |
| | | { |
| | | SetDlgItemText(IDC_LABEL_JOBSTATE, pszText); |
| | | } |
| | | |
| | | void CMyStatusbar::setCurTaskBtnText(const char* pszText) |
| | | { |
| | | SetDlgItemText(IDC_BUTTON_ROBOTTASK, pszText); |
| | |
| | | pItem->GetClientRect(rcItem); |
| | | pItem->MoveWindow(x, (rcClient.Height() - rcItem.Height()) / 2, rcItem.Width(), rcItem.Height()); |
| | | x += rcItem.Width(); |
| | | |
| | | x += 8; |
| | | pItem = GetDlgItem(IDC_LABEL_JOBSTATE); |
| | | if (pItem != nullptr) { |
| | | pItem->GetClientRect(rcItem); |
| | | pItem->MoveWindow(x, (rcClient.Height() - rcItem.Height()) / 2, rcItem.Width(), rcItem.Height()); |
| | | x += rcItem.Width(); |
| | | } |
| | | } |
| | |
| | | void setBackgroundColor(COLORREF color); |
| | | void setForegroundColor(COLORREF cr); |
| | | void setRunTimeText(const char* pszText); |
| | | void setJobText(const char* pszText); |
| | | void setCurTaskBtnText(const char* pszText); |
| | | void setCimBtnText(const char* pszText); |
| | | void setCurTaskBtnColors(COLORREF face, COLORREF frame, COLORREF text); |
| | |
| | | text = _T("ControlJob: None"); |
| | | } |
| | | if (m_pMyStatusbar != nullptr) { |
| | | m_pMyStatusbar->setRunTimeText((LPTSTR)(LPCTSTR)text); |
| | | m_pMyStatusbar->setJobText((LPTSTR)(LPCTSTR)text); |
| | | if (cj != nullptr && cj->state() == SERVO::CJState::Paused) { |
| | | m_pMyStatusbar->setBackgroundColor(STATUSBAR_BK_ALARM); |
| | | m_pMyStatusbar->setForegroundColor(RGB(0, 0, 0)); |
| | |
| | | } |
| | | pBtn->EnableWindow(TRUE); |
| | | } |
| | | } |
| | | |
| | | void CServoDlg::AckAlarm(int alarmId) |
| | | { |
| | | m_ackAlarms.insert(alarmId); |
| | | RefreshAlarmBadge(); |
| | | } |
| | | |
| | | void CServoDlg::RaiseTestAlarm() |
| | |
| | | m_pMyStatusbar = new CMyStatusbar(); |
| | | m_pMyStatusbar->Create(IDD_STATUSBAR, this); |
| | | m_pMyStatusbar->ShowWindow(SW_SHOW); |
| | | m_pMyStatusbar->setJobText("ControlJob: None"); |
| | | LOGI("[BOOT][UI] statusbar created, elapsed=%llu ms", (unsigned long long)(GetTickCount64() - boot_ui_begin)); |
| | | |
| | | |
| | |
| | | theApp.m_model.loadPortParams(); |
| | | } |
| | | |
| | | // 还原状态栏运行时间显示(避免一直停留在“正在加载历史缓存...”) |
| | | if (m_pMyStatusbar != nullptr) { |
| | | CString strText; |
| | | GetRuntimeFormatText(strText, ""); |
| | | m_pMyStatusbar->setRunTimeText((LPTSTR)(LPCTSTR)strText); |
| | | } |
| | | |
| | | |
| | | // 初始化master以后需要控件绑定数据 |
| | | m_pPageGraph1->BindEquipmentToGraph(); |
| | |
| | | |
| | | public: |
| | | void ShowTerminalText(const char* pszText, unsigned int duration = -1); |
| | | void AckAlarm(int alarmId); |
| | | |
| | | private: |
| | | void InitRxWindows(); |
| | |
| | | #define IDC_LINE2 1270 |
| | | #define IDC_LABEL_DESCRIPTION 1271 |
| | | #define IDC_LABEL_NO_ALARM 1272 |
| | | #define IDC_LABEL_JOBSTATE 1273 |
| | | #define ID_MENU_HELP_ABOUT 32771 |
| | | #define ID_MENU_FILE_EXIT 32772 |
| | | #define ID_MENU_FILE_SECSTEST 32773 |
| | |
| | | #ifndef APSTUDIO_READONLY_SYMBOLS |
| | | #define _APS_NEXT_RESOURCE_VALUE 192 |
| | | #define _APS_NEXT_COMMAND_VALUE 32806 |
| | | #define _APS_NEXT_CONTROL_VALUE 1273 |
| | | #define _APS_NEXT_CONTROL_VALUE 1274 |
| | | #define _APS_NEXT_SYMED_VALUE 101 |
| | | #endif |
| | | #endif |