From 6b80da0fe2a6053b39802a6701db6df0ab1fde24 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期五, 05 九月 2025 17:27:35 +0800
Subject: [PATCH] 1. 添加设备配方参数显示界面

---
 SourceCode/Bond/Servo/CBakeCooling.cpp |   96 +++++++++++++++++++++++++++++++++++-------------
 1 files changed, 70 insertions(+), 26 deletions(-)

diff --git a/SourceCode/Bond/Servo/CBakeCooling.cpp b/SourceCode/Bond/Servo/CBakeCooling.cpp
index 5a7bbb0..dbfa816 100644
--- a/SourceCode/Bond/Servo/CBakeCooling.cpp
+++ b/SourceCode/Bond/Servo/CBakeCooling.cpp
@@ -188,12 +188,13 @@
 			// master recipe list report
 			CEqReadStep* pStep = new CEqReadStep(0x12955, 255 * 2,
 				[&](void* pFrom, int code, const char* pszData, size_t size) -> int {
+					CEqReadStep* pTmpStep = (CEqReadStep*)pFrom;
+					short ret = MRLRC_OK;
 					if (code == ROK && pszData != nullptr && size > 0) {
 						// 此处解释配方数据
-						short ret = decodeRecipeListReport(pszData, size);
-						pStep->setReturnCode(ret);
+						ret = decodeRecipeListReport(pszData, size);
 					}
-					pStep->setReturnCode(MRLRC_OK);
+					pTmpStep->setReturnCode(ret);
 					return -1;
 				});
 			pStep->setName(STEP_EQ_MASTER_RECIPE_LIST);
@@ -206,33 +207,34 @@
 
 		{
 			// 请求配方参数
-			//CEqWriteStep* pStep = new CEqWriteStep();
-			//pStep->setName(STEP_EQ_RECIPE_PARAMETER_REQ);
-			//pStep->setWriteSignalDev(0x967);
-			//pStep->setDataDev(0x379b);
-			//if (addStep(STEP_ID_RECIPE_PARAMETER_CMD_REPLY, pStep) != 0) {
-			//	delete pStep;
-			//}
+			CEqWriteStep* pStep = new CEqWriteStep();
+			pStep->setName(STEP_EQ_RECIPE_PARAMETER_REQ);
+			pStep->setWriteSignalDev(0x967);
+			pStep->setDataDev(0x24fb);
+			if (addStep(STEP_ID_RECIPE_PARAMETER_CMD_REPLY, pStep) != 0) {
+				delete pStep;
+			}
 		}
 
 		{
 			// recipe parameter report
-			//CEqReadStep* pStep = new CEqReadStep(0x1aa54, 257 * 2,
-			//	[&](void* pFrom, int code, const char* pszData, size_t size) -> int {
-			//		if (code == ROK && pszData != nullptr && size > 0) {
-			//			// 此处解释配方数据
-			//			short ret = decodeRecipeParameterReport(pszData, size);
-			//			pStep->setReturnCode(ret);
-			//		}
-			//		pStep->setReturnCode(MRLRC_OK);
-			//		return -1;
-			//	});
-			//pStep->setName(STEP_EQ_RECIPE_PARAMETER);
-			//pStep->setWriteSignalDev(0x94c);
-			//pStep->setReturnDev(m_nIndex == 0 ? 0x126c : 0x1bbc);
-			//if (addStep(STEP_ID_RECIPE_PARAMETER_REPORT, pStep) != 0) {
-			//	delete pStep;
-			//}
+			CEqReadStep* pStep = new CEqReadStep(0x12a54, 257 * 2,
+				[&](void* pFrom, int code, const char* pszData, size_t size) -> int {
+					CEqReadStep* pTmpStep = (CEqReadStep*)pFrom;
+					if (code == ROK && pszData != nullptr && size > 0) {
+						// 此处解释配方数据
+						short ret = decodeRecipeParameterReport(pszData, size);
+						pTmpStep->setReturnCode(ret);
+					}
+					pTmpStep->setReturnCode(MRLRC_OK);
+					return -1;
+				});
+			pStep->setName(STEP_EQ_RECIPE_PARAMETER);
+			pStep->setWriteSignalDev(0x94c);
+			pStep->setReturnDev(0x250c);
+			if (addStep(STEP_ID_RECIPE_PARAMETER_REPORT, pStep) != 0) {
+				delete pStep;
+			}
 		}
 
 		// 使用CEqReadStep替换CEqJobEventStep
@@ -421,4 +423,46 @@
 		if (pGlass == nullptr) return false;
 		return pGlass->isProcessed(m_nID, getSlotUnit(slot));
 	}
+
+	int CBakeCooling::parsingParams(const char* pszData, size_t size, std::vector<CParam>& params)
+	{
+		ASSERT(pszData);
+		if (size < 250) return 0;
+		int i = 0, v;
+
+
+		// 1.A_腔烘烤时间
+		v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8;
+		params.push_back(CParam("A_腔烘烤时间", "", this->getName().c_str(), v * 0.01f));
+		i += 2;
+
+		// 2.A_腔冷却时间
+		v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8;
+		params.push_back(CParam("A_腔冷却时间", "", this->getName().c_str(), v * 0.01f));
+		i += 2;
+
+		// 3.B_腔烘烤时间
+		v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8;
+		params.push_back(CParam("B_腔烘烤时间", "", this->getName().c_str(), v * 0.01f));
+		i += 2;
+
+		// 4.BB_腔冷却时间
+		v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8;
+		params.push_back(CParam("B_腔冷却时间", "", this->getName().c_str(), v * 0.01f));
+		i += 2;
+
+		// 5.A_烘烤温度设定
+		v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8;
+		params.push_back(CParam("A_烘烤温度设定", "", this->getName().c_str(), v * 0.1f));
+		i += 2;
+
+		// 6.B_烘烤温度设定
+		v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8;
+		params.push_back(CParam("B_烘烤温度设定", "", this->getName().c_str(), v * 0.1f));
+		i += 2;
+
+
+		return (int)params.size();
+	}
+
 }

--
Gitblit v1.9.3