From 29623a829f040af2cd27fd6c477d54294063a0ea Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期五, 09 五月 2025 10:46:34 +0800
Subject: [PATCH] 1.部分Dev地址修改

---
 SourceCode/Bond/Servo/CEquipment.cpp |   45 ++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/SourceCode/Bond/Servo/CEquipment.cpp b/SourceCode/Bond/Servo/CEquipment.cpp
index aaf7662..b2e3ad3 100644
--- a/SourceCode/Bond/Servo/CEquipment.cpp
+++ b/SourceCode/Bond/Servo/CEquipment.cpp
@@ -319,7 +319,7 @@
 
 		// 以下解释和处理数据
 		BOOL bFlag;
-		int index = 0x840;
+		int index = 0x540;
 
 
 		// alive
@@ -370,7 +370,7 @@
 			m_bAutoRecipeChange = bFlag;
 		}
 
-		// AutoRecipeChange
+		// VCR Enable
 		bFlag = isBitOn(pszData, size, ++index);
 		if (!equalBool(m_bVCREnable[0], bFlag)) {
 			m_bVCREnable[0] = bFlag;
@@ -887,11 +887,15 @@
 		}
 
 		LOGI("<CEquipment-%s>正在请求单元<%d>主配方列表", m_strName.c_str(), unitNo);
-		pStep->writeShort(unitNo, [&](int code) -> int {
+		if (m_recipesManager.syncing() != 0) {
+			return -2;
+		}
+		pStep->writeShort(unitNo, [&, unitNo](int code) -> int {
 			if (code == WOK) {
 				LOGI("<CEquipment-%s>请求单元<%d>主配方列表成功,正在等待数据.", m_strName.c_str(), unitNo);
 			}
 			else {
+				m_recipesManager.syncFailed();
 				LOGI("<CEquipment-%s>请求单元<%d>主配方列表失败,code:%d", m_strName.c_str(), unitNo, code);
 			}
 
@@ -899,4 +903,39 @@
 		});
 		return 0;
 	}
+
+	int CEquipment::recipeParameterRequest(short masterRecipeId, short localRecipeId, short unitNo)
+	{
+		SERVO::CEqWriteStep* pStep = (SERVO::CEqWriteStep*)getStepWithName(STEP_EQ_MASTER_RECIPE_LIST_REQ);
+		if (pStep == nullptr) {
+			return -1;
+		}
+
+		LOGI("<CEquipment-%s>正在请求单元<%d>主配方列表", m_strName.c_str(), unitNo);
+		if (m_recipesManager.syncing() != 0) {
+			return -2;
+		}
+		pStep->writeShort(unitNo, [&, unitNo](int code) -> int {
+			if (code == WOK) {
+				LOGI("<CEquipment-%s>请求单元<%d>主配方列表成功,正在等待数据.", m_strName.c_str(), unitNo);
+			}
+			else {
+				m_recipesManager.syncFailed();
+				LOGI("<CEquipment-%s>请求单元<%d>主配方列表失败,code:%d", m_strName.c_str(), unitNo, code);
+			}
+
+			return 0;
+			});
+		return 0;
+	}
+
+	short CEquipment::decodeRecipeListReport(const char* pszData, size_t size)
+	{
+		return m_recipesManager.decodeRecipeListReport(pszData, size);
+	}
+
+	short CEquipment::decodeRecipeParameterReport(const char* pszData, size_t size)
+	{
+		return m_recipesManager.decodeRecipeParameterReport(pszData, size);
+	}
 }
\ No newline at end of file

--
Gitblit v1.9.3