From 260b16a1debe7dbc33982768a37dfd48ca34b248 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期五, 09 一月 2026 14:27:21 +0800
Subject: [PATCH] 1.EAP模拟器完善

---
 SourceCode/Bond/Servo/CMeasurement.cpp |  143 ++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 120 insertions(+), 23 deletions(-)

diff --git a/SourceCode/Bond/Servo/CMeasurement.cpp b/SourceCode/Bond/Servo/CMeasurement.cpp
index f4b41a4..67f9c9f 100644
--- a/SourceCode/Bond/Servo/CMeasurement.cpp
+++ b/SourceCode/Bond/Servo/CMeasurement.cpp
@@ -207,33 +207,34 @@
 
 		{
 			// 请求配方参数
-			//CEqWriteStep* pStep = new CEqWriteStep();
-			//pStep->setName(STEP_EQ_RECIPE_PARAMETER_REQ);
-			//pStep->setWriteSignalDev(0xf67);
-			//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(0xf67);
+			pStep->setDataDev(0x379b);
+			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(0xf4c);
-			//pStep->setReturnDev(m_nIndex == 0 ? 0x126c : 0x1bbc);
-			//if (addStep(STEP_ID_RECIPE_PARAMETER_REPORT, pStep) != 0) {
-			//	delete pStep;
-			//}
+			CEqReadStep* pStep = new CEqReadStep(0x1aa54, 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(0xf4c);
+			pStep->setReturnDev(0x37ac);
+			if (addStep(STEP_ID_RECIPE_PARAMETER_REPORT, pStep) != 0) {
+				delete pStep;
+			}
 		}
 
 		// 使用CEqReadStep替换CEqJobEventStep
@@ -333,6 +334,26 @@
 			}
 		}
 
+		// FAC Data Report
+		addFacDataReportStep(0x1a589, 0xf4d, 1);
+		/*
+		{
+			CEqReadStep* pStep = new CEqReadStep(0x1a589, 133 * 2,
+				[&](void* pFrom, int code, const char* pszData, size_t size) -> int {
+					if (code == ROK && pszData != nullptr && size > 0) {
+						decodeFacDataReport((CStep*)pFrom, pszData, size);
+					}
+					return -1;
+				});
+			pStep->setName(STEP_EQ_FAC_DATA_REPORT);
+			pStep->setProp("Port", (void*)1);
+			pStep->setWriteSignalDev(0xf4d);
+			if (addStep(STEP_ID_FAC_DATA_REPORT, pStep) != 0) {
+				delete pStep;
+			}
+		}
+		*/
+
 		// process start/end report
 		{
 			CEqReadStep* pStep = new CEqReadStep(0x19D3F, 13 * 2,
@@ -416,4 +437,80 @@
 	{
 		return 35000;
 	}
+
+	int CMeasurement::parsingParams(const char* pszData, size_t size, std::vector<CParam>& params)
+	{
+		ASSERT(pszData);
+		if (size < 250) return 0;
+		int i = 0, v;
+
+
+		// 1.检测功能启用/禁用
+		v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8;
+		params.push_back(CParam("检测功能启用/禁用", "", this->getName().c_str(), v));
+		i += 2;
+
+		// 2.检测速度
+		v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24;
+		params.push_back(CParam("检测速度", "", this->getName().c_str(), v * 0.001));
+		i += 4;
+
+		return (int)params.size();
+	}
+
+	int CMeasurement::parsingProcessData(const char* pszData, size_t size, std::vector<CParam>& params)
+	{
+		ASSERT(pszData);
+		if (size < 250) return 0;
+		int i = 0, v;
+
+
+		// 1.检测功能启用/禁用
+		v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8;
+		params.push_back(CParam("检测功能启用/禁用", "", this->getName().c_str(), v));
+		i += 2;
+
+		// 2.检测速度
+		v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24;
+		params.push_back(CParam("检测速度", "", this->getName().c_str(), v * 0.001));
+		i += 4;
+
+		// 3.检测1数据
+		v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24;
+		params.push_back(CParam("检测1数据", "", this->getName().c_str(), v * 0.001));
+		i += 4;
+
+		// 4.检测2数据
+		v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24;
+		params.push_back(CParam("检测2数据", "", this->getName().c_str(), v * 0.001));
+		i += 4;
+
+		return (int)params.size();
+	}
+
+	int CMeasurement::parsingSVData(const char* pszData, size_t size, std::vector<CParam>& params)
+	{
+		/*/
+		1	工艺运行步骤	1Word	123456
+			2	AOI检测速度	2Word	123.456
+		*/
+
+		ASSERT(pszData);
+		if (size < 125) return 0;
+		int i = 0, v;
+
+
+		// 1.工艺运行步骤
+		v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8;
+		params.push_back(CParam("工艺运行步骤", "", this->getName().c_str(), v));
+		i += 2;
+
+		// 2.检测速度
+		v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24;
+		params.push_back(CParam("A腔温控表1当前值", "", this->getName().c_str(), v * 0.001f));
+		i += 4;
+
+		return (int)params.size();
+	}
+
 }

--
Gitblit v1.9.3