From 625fb6aa20dd6be77a43f45d3c64b9d633417129 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期五, 23 一月 2026 22:08:08 +0800
Subject: [PATCH] 1.实现了“空腔调机曲线模式/生产曲线模式”的切换逻辑,并在模式切换时启动/停止 DAQBridge 的采样缓存,确保空腔也能推送曲线数据; 2.菜单里新增两个选项并显示勾选状态。
---
SourceCode/Bond/Servo/resource.h | 4 +++-
SourceCode/Bond/Servo/Servo.rc | 3 +++
SourceCode/Bond/Servo/CMaster.h | 8 ++++++++
SourceCode/Bond/Servo/ServoDlg.cpp | 26 ++++++++++++++++++++++++++
SourceCode/Bond/Servo/ServoDlg.h | 4 ++++
5 files changed, 44 insertions(+), 1 deletions(-)
diff --git a/SourceCode/Bond/Servo/CMaster.h b/SourceCode/Bond/Servo/CMaster.h
index 35eb6fc..39f2579 100644
--- a/SourceCode/Bond/Servo/CMaster.h
+++ b/SourceCode/Bond/Servo/CMaster.h
@@ -54,6 +54,11 @@
ATHERERROR
};
+ enum class CurveMode {
+ Production = 0,
+ EmptyChamber
+ };
+
typedef std::function<void(void* pMaster, MASTERSTATE state)> ONMASTERSTATECHANGED;
typedef std::function<void(void* pMaster, CEquipment* pEiuipment, BOOL bAlive)> ONEQALIVE;
typedef std::function<void(CStep* pStep, int code, void* pData)> ONEQSTEPEVENT;
@@ -113,6 +118,8 @@
void clearError();
ULONGLONG getRunTime();
MASTERSTATE getState();
+ void setCurveMode(CurveMode mode);
+ CurveMode getCurveMode() const;
unsigned DispatchProc();
unsigned ReadBitsProc();
void onTimer(UINT nTimerid);
@@ -254,6 +261,7 @@
ULONGLONG m_ullStartTime;
ULONGLONG m_ullRunTime;
MASTERSTATE m_state;
+ CurveMode m_curveMode;
// 褰撳墠浠诲姟鍜屽凡瀹屾垚浠诲姟鍒楄〃
CRobotTask* m_pActiveRobotTask;
diff --git a/SourceCode/Bond/Servo/Servo.rc b/SourceCode/Bond/Servo/Servo.rc
index e0f3ec0..d24a894 100644
--- a/SourceCode/Bond/Servo/Servo.rc
+++ b/SourceCode/Bond/Servo/Servo.rc
@@ -1641,6 +1641,9 @@
POPUP "工具(&O)"
BEGIN
MENUITEM "曲线显示端列表(&C)", ID_MENU_TOOLS_CLIENT_LIST
+ MENUITEM SEPARATOR
+ MENUITEM "空腔调机曲线模式(&E)", ID_MENU_TOOLS_CURVE_EMPTY
+ MENUITEM "生产曲线模式(&P)", ID_MENU_TOOLS_CURVE_PRODUCTION
END
POPUP "窗口(&W)"
BEGIN
diff --git a/SourceCode/Bond/Servo/ServoDlg.cpp b/SourceCode/Bond/Servo/ServoDlg.cpp
index 7ab2e44..b374f84 100644
--- a/SourceCode/Bond/Servo/ServoDlg.cpp
+++ b/SourceCode/Bond/Servo/ServoDlg.cpp
@@ -150,6 +150,10 @@
ON_UPDATE_COMMAND_UI(ID_MENU_TEST_MESSAGE_CLEAR, &CServoDlg::OnUpdateMenuTestMessageClear)
ON_COMMAND(ID_MENU_TOOLS_CLIENT_LIST, &CServoDlg::OnMenuToolsClientList)
ON_UPDATE_COMMAND_UI(ID_MENU_TOOLS_CLIENT_LIST, &CServoDlg::OnUpdateMenuToolsClientList)
+ ON_COMMAND(ID_MENU_TOOLS_CURVE_EMPTY, &CServoDlg::OnMenuToolsCurveEmptyMode)
+ ON_UPDATE_COMMAND_UI(ID_MENU_TOOLS_CURVE_EMPTY, &CServoDlg::OnUpdateMenuToolsCurveEmptyMode)
+ ON_COMMAND(ID_MENU_TOOLS_CURVE_PRODUCTION, &CServoDlg::OnMenuToolsCurveProductionMode)
+ ON_UPDATE_COMMAND_UI(ID_MENU_TOOLS_CURVE_PRODUCTION, &CServoDlg::OnUpdateMenuToolsCurveProductionMode)
ON_COMMAND(ID_MENU_WND_TEST_PANEL, &CServoDlg::OnMenuWndTestPanel)
ON_UPDATE_COMMAND_UI(ID_MENU_WND_TEST_PANEL, &CServoDlg::OnUpdateMenuWndTestPanel)
ON_COMMAND(ID_MENU_WND_PRO_PANEL, &CServoDlg::OnMenuWndProPanel)
@@ -892,6 +896,28 @@
pCmdUI->Enable(TRUE);
}
+void CServoDlg::OnMenuToolsCurveEmptyMode()
+{
+ theApp.m_model.getMaster().setCurveMode(SERVO::CurveMode::EmptyChamber);
+}
+
+void CServoDlg::OnUpdateMenuToolsCurveEmptyMode(CCmdUI* pCmdUI)
+{
+ pCmdUI->Enable(TRUE);
+ pCmdUI->SetCheck(theApp.m_model.getMaster().getCurveMode() == SERVO::CurveMode::EmptyChamber);
+}
+
+void CServoDlg::OnMenuToolsCurveProductionMode()
+{
+ theApp.m_model.getMaster().setCurveMode(SERVO::CurveMode::Production);
+}
+
+void CServoDlg::OnUpdateMenuToolsCurveProductionMode(CCmdUI* pCmdUI)
+{
+ pCmdUI->Enable(TRUE);
+ pCmdUI->SetCheck(theApp.m_model.getMaster().getCurveMode() == SERVO::CurveMode::Production);
+}
+
void CServoDlg::OnMenuWndTestPanel()
{
SetLeftPanelType(1);
diff --git a/SourceCode/Bond/Servo/ServoDlg.h b/SourceCode/Bond/Servo/ServoDlg.h
index 19e56fb..e05c9e5 100644
--- a/SourceCode/Bond/Servo/ServoDlg.h
+++ b/SourceCode/Bond/Servo/ServoDlg.h
@@ -124,6 +124,10 @@
afx_msg void OnUpdateMenuTestMessageClear(CCmdUI* pCmdUI);
afx_msg void OnMenuToolsClientList();
afx_msg void OnUpdateMenuToolsClientList(CCmdUI* pCmdUI);
+ afx_msg void OnMenuToolsCurveEmptyMode();
+ afx_msg void OnUpdateMenuToolsCurveEmptyMode(CCmdUI* pCmdUI);
+ afx_msg void OnMenuToolsCurveProductionMode();
+ afx_msg void OnUpdateMenuToolsCurveProductionMode(CCmdUI* pCmdUI);
afx_msg void OnMenuWndTestPanel();
afx_msg void OnUpdateMenuWndTestPanel(CCmdUI* pCmdUI);
afx_msg void OnMenuWndProPanel();
diff --git a/SourceCode/Bond/Servo/resource.h b/SourceCode/Bond/Servo/resource.h
index d9639e2..ef26aa5 100644
--- a/SourceCode/Bond/Servo/resource.h
+++ b/SourceCode/Bond/Servo/resource.h
@@ -384,13 +384,15 @@
#define ID_MENU_WND_PRO_PANEL 32803
#define ID_MENU_TEST_ALARM_ON 32804
#define ID_MENU_TEST_ALARM_OFF 32805
+#define ID_MENU_TOOLS_CURVE_EMPTY 32806
+#define ID_MENU_TOOLS_CURVE_PRODUCTION 32807
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 192
-#define _APS_NEXT_COMMAND_VALUE 32806
+#define _APS_NEXT_COMMAND_VALUE 32808
#define _APS_NEXT_CONTROL_VALUE 1274
#define _APS_NEXT_SYMED_VALUE 101
#endif
--
Gitblit v1.9.3