From c24708ebcf8cc529f00b5e10d91b3f54c8760868 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期五, 06 六月 2025 16:02:16 +0800
Subject: [PATCH] 1.更改顶部工具条【启动】和【停止】按钮变可用的时机;
---
SourceCode/Bond/Servo/ServoDlg.cpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/SourceCode/Bond/Servo/ServoDlg.cpp b/SourceCode/Bond/Servo/ServoDlg.cpp
index 80117a5..62e21ac 100644
--- a/SourceCode/Bond/Servo/ServoDlg.cpp
+++ b/SourceCode/Bond/Servo/ServoDlg.cpp
@@ -174,6 +174,7 @@
else if (RX_CODE_MASTER_STATE_CHANGED == code) {
SERVO::MASTERSTATE state = theApp.m_model.getMaster().getState();
if (state == SERVO::MASTERSTATE::READY) {
+ m_pTopToolbar->GetBtn(IDC_BUTTON_RUN)->EnableWindow(TRUE);
m_pMyStatusbar->setBackgroundColor(STATUSBAR_BK_NORMAL);
m_pMyStatusbar->setForegroundColor(RGB(0, 0, 0));
KillTimer(TIMER_ID_UPDATE_RUMTIME);
@@ -182,6 +183,7 @@
m_pMyStatusbar->setRunTimeText((LPTSTR)(LPCTSTR)strText);
}
else if (state == SERVO::MASTERSTATE::RUNNING) {
+ m_pTopToolbar->GetBtn(IDC_BUTTON_STOP)->EnableWindow(TRUE);
m_pMyStatusbar->setBackgroundColor(STATUSBAR_BK_RUNNING);
m_pMyStatusbar->setForegroundColor(RGB(255, 255, 255));
SetTimer(TIMER_ID_UPDATE_RUMTIME, 500, nullptr);
@@ -793,11 +795,9 @@
if (id == IDC_BUTTON_RUN) {
theApp.m_model.getMaster().start();
m_pTopToolbar->GetBtn(IDC_BUTTON_RUN)->EnableWindow(FALSE);
- m_pTopToolbar->GetBtn(IDC_BUTTON_STOP)->EnableWindow(TRUE);
}
else if (id == IDC_BUTTON_STOP) {
theApp.m_model.getMaster().stop();
- m_pTopToolbar->GetBtn(IDC_BUTTON_RUN)->EnableWindow(TRUE);
m_pTopToolbar->GetBtn(IDC_BUTTON_STOP)->EnableWindow(FALSE);
}
else if (id == IDC_BUTTON_ROBOT) {
--
Gitblit v1.9.3