From da507a84b7790fa5eab4a01737af5aaca1526390 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期三, 21 一月 2026 15:55:15 +0800
Subject: [PATCH] 1.修改完善状态栏显示;
---
SourceCode/Bond/Servo/CMyStatusbar.h | 1 +
SourceCode/Bond/Servo/resource.h | 3 ++-
SourceCode/Bond/Servo/CMyStatusbar.cpp | 13 +++++++++++++
SourceCode/Bond/Servo/ServoDlg.cpp | 10 +++++++++-
4 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/SourceCode/Bond/Servo/CMyStatusbar.cpp b/SourceCode/Bond/Servo/CMyStatusbar.cpp
index f38821f..7aa389a 100644
--- a/SourceCode/Bond/Servo/CMyStatusbar.cpp
+++ b/SourceCode/Bond/Servo/CMyStatusbar.cpp
@@ -70,6 +70,11 @@
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);
@@ -212,4 +217,12 @@
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();
+ }
}
diff --git a/SourceCode/Bond/Servo/CMyStatusbar.h b/SourceCode/Bond/Servo/CMyStatusbar.h
index b1fdfa8..37f039d 100644
--- a/SourceCode/Bond/Servo/CMyStatusbar.h
+++ b/SourceCode/Bond/Servo/CMyStatusbar.h
@@ -20,6 +20,7 @@
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);
diff --git a/SourceCode/Bond/Servo/ServoDlg.cpp b/SourceCode/Bond/Servo/ServoDlg.cpp
index 9d50889..2a9f177 100644
--- a/SourceCode/Bond/Servo/ServoDlg.cpp
+++ b/SourceCode/Bond/Servo/ServoDlg.cpp
@@ -280,7 +280,7 @@
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));
@@ -586,6 +586,7 @@
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));
@@ -621,6 +622,13 @@
theApp.m_model.loadPortParams();
}
+ // 杩樺師鐘舵�佹爮杩愯鏃堕棿鏄剧ず锛堥伩鍏嶄竴鐩村仠鐣欏湪鈥滄鍦ㄥ姞杞藉巻鍙茬紦瀛�...鈥濓級
+ if (m_pMyStatusbar != nullptr) {
+ CString strText;
+ GetRuntimeFormatText(strText, "");
+ m_pMyStatusbar->setRunTimeText((LPTSTR)(LPCTSTR)strText);
+ }
+
// 鍒濆鍖杕aster浠ュ悗闇�瑕佹帶浠剁粦瀹氭暟鎹�
m_pPageGraph1->BindEquipmentToGraph();
diff --git a/SourceCode/Bond/Servo/resource.h b/SourceCode/Bond/Servo/resource.h
index 9cfbdd4..d9639e2 100644
--- a/SourceCode/Bond/Servo/resource.h
+++ b/SourceCode/Bond/Servo/resource.h
@@ -349,6 +349,7 @@
#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
@@ -390,7 +391,7 @@
#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
--
Gitblit v1.9.3