From c3287ad7beab5ed711458d065d0ce125488412ec Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期二, 06 五月 2025 10:10:05 +0800
Subject: [PATCH] 1.主配方列表,需要写入返回值;

---
 SourceCode/Bond/Servo/CReadStep.cpp       |    8 ++++++++
 SourceCode/Bond/Servo/CRecipesManager.cpp |    2 +-
 SourceCode/Bond/Servo/CEquipment.cpp      |    6 +++---
 SourceCode/Bond/Servo/CReadStep.h         |    1 +
 SourceCode/Bond/Servo/CEquipment.h        |    2 +-
 SourceCode/Bond/Servo/CBonder.cpp         |    5 ++++-
 SourceCode/Bond/Servo/CRecipesManager.h   |    2 +-
 7 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/SourceCode/Bond/Servo/CBonder.cpp b/SourceCode/Bond/Servo/CBonder.cpp
index 1652925..5ce0745 100644
--- a/SourceCode/Bond/Servo/CBonder.cpp
+++ b/SourceCode/Bond/Servo/CBonder.cpp
@@ -188,12 +188,15 @@
 				[&](int code, const char* pszData, size_t size) -> int {
 					if (code == ROK && pszData != nullptr && size > 0) {
 						// 此处解释配方数据
-						return decodeRecipeListReport(pszData, size);
+						short ret = decodeRecipeListReport(pszData, size);
+						pStep->setReturnCode(ret);
 					}
+					pStep->setReturnCode(MRLRC_OK);
 					return -1;
 				});
 			pStep->setName(STEP_EQ_MASTER_RECIPE_LIST);
 			pStep->setWriteSignalDev(m_nIndex == 0 ? 0x34b : 0x64b);
+			pStep->setReturnDev(m_nIndex == 0 ? 0x126d : 0x1bbd);
 			if (addStep(STEP_ID_MASTER_RECIPE_LIST_REPORT, pStep) != 0) {
 				delete pStep;
 			}
diff --git a/SourceCode/Bond/Servo/CEquipment.cpp b/SourceCode/Bond/Servo/CEquipment.cpp
index 054457f..096870f 100644
--- a/SourceCode/Bond/Servo/CEquipment.cpp
+++ b/SourceCode/Bond/Servo/CEquipment.cpp
@@ -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;
@@ -895,7 +895,7 @@
 				LOGI("<CEquipment-%s>请求单元<%d>主配方列表成功,正在等待数据.", m_strName.c_str(), unitNo);
 			}
 			else {
-				//m_recipesManager.syncFailed();
+				m_recipesManager.syncFailed();
 				LOGI("<CEquipment-%s>请求单元<%d>主配方列表失败,code:%d", m_strName.c_str(), unitNo, code);
 			}
 
@@ -904,7 +904,7 @@
 		return 0;
 	}
 
-	int CEquipment::decodeRecipeListReport(const char* pszData, size_t size)
+	short CEquipment::decodeRecipeListReport(const char* pszData, size_t size)
 	{
 		return m_recipesManager.decodeRecipeListReport(pszData, size);
 	}
diff --git a/SourceCode/Bond/Servo/CEquipment.h b/SourceCode/Bond/Servo/CEquipment.h
index 1e6d326..14283bd 100644
--- a/SourceCode/Bond/Servo/CEquipment.h
+++ b/SourceCode/Bond/Servo/CEquipment.h
@@ -150,7 +150,7 @@
 		BOOL isBitOn(const char* pszData, size_t size, int index);
 		inline BOOL equalBool(BOOL b1, BOOL b2);
 		void addGlassToList(CGlass* pGlass);
-		int decodeRecipeListReport(const char* pszData, size_t size);
+		short decodeRecipeListReport(const char* pszData, size_t size);
 
 	protected:
 		EquipmentListener m_listener;
diff --git a/SourceCode/Bond/Servo/CReadStep.cpp b/SourceCode/Bond/Servo/CReadStep.cpp
index 787d92a..5fd5dfd 100644
--- a/SourceCode/Bond/Servo/CReadStep.cpp
+++ b/SourceCode/Bond/Servo/CReadStep.cpp
@@ -209,4 +209,12 @@
 	{
 		return 0;
 	}
+
+	int CReadStep::setReturnCode(short code)
+	{
+		memcpy(m_szReturnBuf, &code, sizeof(short));
+		m_nReturnDataSize = sizeof(short);
+
+		return 0;
+	}
 }
diff --git a/SourceCode/Bond/Servo/CReadStep.h b/SourceCode/Bond/Servo/CReadStep.h
index c79ea0f..c74568e 100644
--- a/SourceCode/Bond/Servo/CReadStep.h
+++ b/SourceCode/Bond/Servo/CReadStep.h
@@ -22,6 +22,7 @@
 		virtual int onTimeout();
 		inline void nextStep();
 		inline void resetStep();
+		virtual int setReturnCode(short code);
 
 	protected:
 		HANDLE m_hWorkThreadHandle;
diff --git a/SourceCode/Bond/Servo/CRecipesManager.cpp b/SourceCode/Bond/Servo/CRecipesManager.cpp
index 34bac63..e858b42 100644
--- a/SourceCode/Bond/Servo/CRecipesManager.cpp
+++ b/SourceCode/Bond/Servo/CRecipesManager.cpp
@@ -79,7 +79,7 @@
 		unlock();
 	}
 
-	int CRecipesManager::decodeRecipeListReport(const char* pszData, size_t size)
+	short CRecipesManager::decodeRecipeListReport(const char* pszData, size_t size)
 	{
 		int index = 0;
 		int unitNo, reportType, totalMasterRecipeCount;
diff --git a/SourceCode/Bond/Servo/CRecipesManager.h b/SourceCode/Bond/Servo/CRecipesManager.h
index 489e2a5..d8e01dc 100644
--- a/SourceCode/Bond/Servo/CRecipesManager.h
+++ b/SourceCode/Bond/Servo/CRecipesManager.h
@@ -20,7 +20,7 @@
 		unsigned TimeoutCheckWorkingProc();
 		int syncing();
 		void syncFailed();
-		int decodeRecipeListReport(const char* pszData, size_t size);
+		short decodeRecipeListReport(const char* pszData, size_t size);
 		CRecipeList* getRecipeListFromTemp(int unitNo);
 
 	public:

--
Gitblit v1.9.3