From 03493252ce77b27ff1c57bea22598ccf53e92ca3 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期四, 11 十二月 2025 17:47:42 +0800
Subject: [PATCH] 1.VCR事件上报模拟测试通过。

---
 SourceCode/Bond/Servo/ServoDlg.cpp |   46 +++++++++++++++++++++++++++-------------------
 1 files changed, 27 insertions(+), 19 deletions(-)

diff --git a/SourceCode/Bond/Servo/ServoDlg.cpp b/SourceCode/Bond/Servo/ServoDlg.cpp
index 5705532..c3d42da 100644
--- a/SourceCode/Bond/Servo/ServoDlg.cpp
+++ b/SourceCode/Bond/Servo/ServoDlg.cpp
@@ -33,6 +33,7 @@
 #include "CControlJobManagerDlg.h"
 #include "CUserManager2.h"
 #include "CUserManager2Dlg.h"
+#include "CUserXLogDlg.h"
 
 
 #ifdef _DEBUG
@@ -305,18 +306,18 @@
 
 				if (STATE::NOT_CONNECTED == state) {
 					m_pMyStatusbar->setCimBtnText("Disconnected");
-					//m_labelPassiveState.setBackground(DISCONNECTED_BACKGROUND);
-					//m_labelPassiveState.setForeground(DISCONNECTED_FOREGROUND, TRUE);
+					m_pMyStatusbar->setCimBtnColors(
+						CIM_STATUS_BK_DISCONNECTED, CIM_STATUS_BK_DISCONNECTED, RGB(0, 0, 0));
 				}
 				else if (STATE::NOT_SELECTED == state) {
 					m_pMyStatusbar->setCimBtnText("Not Selected");
-					//m_labelPassiveState.setBackground(NOT_SELECTED_BACKGROUND);
-					//m_labelPassiveState.setForeground(NOT_SELECTED_FOREGROUND, TRUE);
+					m_pMyStatusbar->setCimBtnColors(
+						CIM_STATUS_BK_DISCONNECTED, CIM_STATUS_BK_DISCONNECTED, RGB(0, 0, 0));
 				}
 				else if (STATE::SELECTED == state) {
 					m_pMyStatusbar->setCimBtnText("Selected");
-					//m_labelPassiveState.setBackground(SELECTED_BACKGROUND);
-					//m_labelPassiveState.setForeground(SELECTED_FOREGROUND, TRUE);
+					m_pMyStatusbar->setCimBtnColors(
+						CIM_STATUS_BK_SELECTED, CIM_STATUS_BK_SELECTED, RGB(0, 0, 0));
 				}
 			}
 			pAny->release();
@@ -371,7 +372,7 @@
 
 	// model init
 	theApp.m_model.init();
-	SetTimer(TIMER_ID_LOGIN, 1000, nullptr);
+	SetTimer(TIMER_ID_LOGIN, 1500, nullptr);
 
 	// 鑿滃崟
 	CMenu menu;
@@ -1017,15 +1018,14 @@
 LRESULT CServoDlg::OnToolbarBtnClicked(WPARAM wParam, LPARAM lParam)
 {
 	int id = (int)lParam;
-	if (id == IDC_BUTTON_RUN || id == IDC_BUTTON_STOP) {
-		UserRole emRole = UserManager::getInstance().getCurrentUserRole();
-		if (emRole != UserRole::SuperAdmin) {
-			AfxMessageBox(_T("褰撳墠鐢ㄦ埛骞堕潪绠$悊鍛橈紒锛侊紒")); 
-			return 1;
-		}
-	}
-
 	if (id == IDC_BUTTON_RUN) {
+		int rc = UX_CanExecute(L"start");
+		if (rc != 1) {
+			AfxMessageBox("鎿嶄綔鏉冮檺涓嶈冻锛岃鑱旂郴绠$悊浜哄憳锛�");
+			return 0;
+		}
+		UX_RecordAction(L"start");
+
 		if (theApp.m_model.getMaster().getState() == SERVO::MASTERSTATE::MSERROR) {
 			AfxMessageBox("褰撳墠鏈夋満鍙板彂鐢熼敊璇紝涓嶈兘鍚姩锛岃纭瑙e喅闂鍚庡啀灏濊瘯閲嶆柊鍚姩锛�");
 		}
@@ -1062,6 +1062,13 @@
 		}
 	}
 	else if (id == IDC_BUTTON_STOP) {
+		int rc = UX_CanExecute(L"stop");
+		if (rc != 1) {
+			AfxMessageBox("鎿嶄綔鏉冮檺涓嶈冻锛岃鑱旂郴绠$悊浜哄憳锛�");
+			return 0;
+		}
+		UX_RecordAction(L"stop");
+
 		if (theApp.m_model.getMaster().stop() == 0) {
 			m_pTopToolbar->GetBtn(IDC_BUTTON_STOP)->EnableWindow(FALSE);
 		}
@@ -1101,12 +1108,13 @@
 			CUserManager2Dlg dlg;
 			dlg.DoModal();
 		}
+		else if (menuId == 1) {
+			CUserXLogDlg dlg;
+			dlg.DoModal();
+		}
 		else if (menuId == 2) {
 			CLoginDlg2 dlg;
-			if (dlg.DoModal() != IDOK) {
-				PostMessage(WM_CLOSE);
-			}
-			else {
+			if (dlg.DoModal() == IDOK) {
 				bool bRet = CUserManager2::getInstance().login((LPTSTR)(LPCTSTR)dlg.m_strUsername,
 					(LPTSTR)(LPCTSTR)dlg.m_strPassword);
 				if (!bRet) {

--
Gitblit v1.9.3