From ce072993ccc72be00e05140f27c66ed01ffcc587 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期三, 19 十一月 2025 14:47:11 +0800
Subject: [PATCH] 工程师级别分为EE和PE

---
 SourceCode/Bond/Servo/ServoDlg.cpp |   34 +++++++++++++++++++++-------------
 1 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/SourceCode/Bond/Servo/ServoDlg.cpp b/SourceCode/Bond/Servo/ServoDlg.cpp
index 5705532..c886f66 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
@@ -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