From c911b82468fcbff3b927f750cefdd1df985085a5 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期一, 19 五月 2025 08:48:00 +0800
Subject: [PATCH] 1.增加调度模式设置(Dispatching mode: 1,EAS, 2:Local)

---
 SourceCode/Bond/Servo/CEquipment.cpp |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/SourceCode/Bond/Servo/CEquipment.cpp b/SourceCode/Bond/Servo/CEquipment.cpp
index f7e2424..1d3f312 100644
--- a/SourceCode/Bond/Servo/CEquipment.cpp
+++ b/SourceCode/Bond/Servo/CEquipment.cpp
@@ -1063,6 +1063,33 @@
 		return pStep->setDateTime(year, month, day, hour, minute, second);
 	}
 
+	int CEquipment::setDispatchingMode(DISPATCHING_MODE mode, ONWRITED onWritedBlock/* = nullptr*/)
+	{
+		SERVO::CEqWriteStep* pStep = (SERVO::CEqWriteStep*)getStepWithName(STEP_EQ_DISPATCHINT_MODE_CHANGE);
+		if (pStep == nullptr) {
+			return -1;
+		}
+
+		LOGI("<CEquipment-%s>准备设置DispatchingMode<%d>", m_strName.c_str(), (int)mode);
+		if (onWritedBlock != nullptr) {
+			pStep->writeShort((short)mode, onWritedBlock);
+		}
+		else {
+			pStep->writeShort((short)mode, [&, mode](int code) -> int {
+				if (code == WOK) {
+					LOGI("<CEquipment-%s>设置DispatchingMode成功.", m_strName.c_str());
+				}
+				else {
+					LOGI("<CEquipment-%s>设置DispatchingMode失败,code:%d", m_strName.c_str(), code);
+				}
+
+				return 0;
+				});
+		}
+
+		return 0;
+	}
+
 	int CEquipment::masterRecipeListRequest(short unitNo)
 	{
 		SERVO::CEqWriteStep* pStep = (SERVO::CEqWriteStep*)getStepWithName(STEP_EQ_MASTER_RECIPE_LIST_REQ);

--
Gitblit v1.9.3