From 68b716b29389a08dd026ddbe51a9c91dfe52e68a Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期三, 21 五月 2025 16:14:31 +0800
Subject: [PATCH] 1. 补全Robot命令界面的激活状态 2. 添加快捷方式的命令调用

---
 SourceCode/Bond/Servo/PageRobotCmd.cpp |   22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/SourceCode/Bond/Servo/PageRobotCmd.cpp b/SourceCode/Bond/Servo/PageRobotCmd.cpp
index 52dcb29..001135a 100644
--- a/SourceCode/Bond/Servo/PageRobotCmd.cpp
+++ b/SourceCode/Bond/Servo/PageRobotCmd.cpp
@@ -32,6 +32,10 @@
 	{ SERVO::RCMD::Get,        { true, true, false, true, false, false } },
 	{ SERVO::RCMD::Put,        { true, false, true, false, true, false } },
 	{ SERVO::RCMD::One_Action_Exchange, { true, true, true, true, true, false } },
+	{ SERVO::RCMD::Two_Action_Exchange, { true, true, true, true, true, false } },
+	{ SERVO::RCMD::Command_Clear, { false, false, false, false, false, false } },
+	{ SERVO::RCMD::Batch_get, { false, true, false, true, false, false } },
+	{ SERVO::RCMD::Batch_put, { false, false, true, false, true, false } }
 };
 
 IMPLEMENT_DYNAMIC(CPageRobotCmd, CDialogEx)
@@ -103,14 +107,16 @@
 	}
 
 	const RCMDFieldMask& mask = it->second;
-	if (mask.useArm)       param.armNo = static_cast<short>(m_nArmNo);
+	if (mask.useArm)       param.armNo = static_cast<short>(m_nArmNo + 1);
 	if (mask.useGetPos)    param.getPosition = static_cast<short>(m_nGetPosition + 1);
 	if (mask.usePutPos)    param.putPosition = static_cast<short>(m_nPutPosition + 1);
 	if (mask.useGetSlot)   param.getSlotNo = static_cast<short>(m_nGetSlotNo + 1);
 	if (mask.usePutSlot)   param.putSlotNo = static_cast<short>(m_nPutSlotNo + 1);
 	if (mask.useSubCmd)    param.subCmd = static_cast<short>(m_nSubCmd + 1);
 
-	if (param.rcmd == static_cast<short>(SERVO::RCMD::Move)) {
+	// 鐗规畩鍛戒护澶勭悊
+	const auto enRcmd = static_cast<SERVO::RCMD>(m_nRcmd + 1);
+	if (SERVO::RCMD::Move == enRcmd) {
 		if (m_nSubCmd == 0) {
 			param.putPosition = 0;
 			param.putSlotNo = 0;
@@ -119,6 +125,9 @@
 			param.getPosition = 0;
 			param.getSlotNo = 0;
 		}
+	}
+	else if (SERVO::RCMD::Batch_get == enRcmd || SERVO::RCMD::Batch_put == enRcmd) {
+		param.armNo = ARM_ALL;
 	}
 
 	return param;
@@ -220,9 +229,14 @@
 
 void CPageRobotCmd::UpdateSlotList(CComboBox* pComboDevice, CComboBox* pComboSlot)
 {
-	if (pComboDevice == nullptr || pComboSlot == nullptr) return;
+	if (pComboDevice == nullptr || pComboSlot == nullptr) { 
+		return;
+	}
+
 	int nSelIndex = pComboDevice->GetCurSel();
-	if (nSelIndex < 0) return;
+	if (nSelIndex < 0) { 
+		return;
+	}
 
 	CString strDeviceName;
 	pComboDevice->GetLBText(nSelIndex, strDeviceName);

--
Gitblit v1.9.3