From 576e5fc2d2db7d106dc264c685d5a59849082d1f Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期四, 19 六月 2025 17:41:52 +0800
Subject: [PATCH] 1. 添加JOB Data交互

---
 SourceCode/Bond/Servo/CEquipment.cpp |   30 ++++++++++++------------------
 SourceCode/Bond/Servo/CEFEM.cpp      |   23 +++++++++++++++++------
 SourceCode/Bond/Servo/CEquipment.h   |    2 +-
 SourceCode/Bond/Servo/Common.h       |    1 +
 4 files changed, 31 insertions(+), 25 deletions(-)

diff --git a/SourceCode/Bond/Servo/CEFEM.cpp b/SourceCode/Bond/Servo/CEFEM.cpp
index 8b5ec2a..4ef727c 100644
--- a/SourceCode/Bond/Servo/CEFEM.cpp
+++ b/SourceCode/Bond/Servo/CEFEM.cpp
@@ -684,7 +684,7 @@
 			CEqReadStep* pStep = new CEqReadStep(0x6301, 108 * 2,
 				[&](void* pFrom, int code, const char* pszData, size_t size) -> int {
 					if (code == ROK && pszData != nullptr && size > 0) {
-						decodePanelDataRequest((CStep*)pFrom, pszData, size);
+						decodeFacDataReport((CStep*)pFrom, pszData, size);
 					}
 					return -1;
 				});
@@ -697,19 +697,30 @@
 		}
 
 		{
-			// Panel Data Request
+			// JOB Data Request
 			CEqReadStep* pStep = new CEqReadStep(0x617d, 2 * 2,
 				[&](void* pFrom, int code, const char* pszData, size_t size) -> int {
 					if (code == ROK && pszData != nullptr && size > 0) {
-						decodePanelDataRequest((CStep*)pFrom, pszData, size);
+						decodeJobDataRequest((CStep*)pFrom, pszData, size);
+
+						// efme, 获取数据后返回
+						// Cassette Sequence No		1W
+						// Job Sequence No			1W
+						// Job DataS				256W
+						char szBuffer[1024] = { 0 };
+						CJobDataS* pJobDataS = m_pPort[3]->getJobDataSWithCassette(4001, 1);
+						if (pJobDataS != nullptr) {
+							int size = pJobDataS->serialize(szBuffer, 1024);
+							((CEqReadStep*)pFrom)->setReturnData(szBuffer, size);
+						}
 					}
 					return -1;
 				});
 			pStep->setName(STEP_EFEM_PANEL_DATA_REQUEST);
 			pStep->setProp("Port", (void*)1);
-			pStep->setWriteSignalDev(0x15d);
-			pStep->setReturnDev(0x73a);
-			if (addStep(STEP_ID_PANEL_DATA_REQUEST, pStep) != 0) {
+			pStep->setWriteSignalDev(0x35);
+			pStep->setReturnDev(0x5EA);
+			if (addStep(STEP_ID_JOB_DATA_REQUEST, pStep) != 0) {
 				delete pStep;
 			}
 		}
diff --git a/SourceCode/Bond/Servo/CEquipment.cpp b/SourceCode/Bond/Servo/CEquipment.cpp
index ea36b48..225c835 100644
--- a/SourceCode/Bond/Servo/CEquipment.cpp
+++ b/SourceCode/Bond/Servo/CEquipment.cpp
@@ -581,6 +581,15 @@
 
 		// Indexer Operation Mode Change
 		CHECK_WRITE_STEP_SIGNAL(STEP_ID_IN_OP_CMD_REPLY, pszData, size);
+
+		// Panel Data Report
+		CHECK_WRITE_STEP_SIGNAL(STEP_ID_PANEL_DATA_REPORT, pszData, size);
+
+		// Panel Data Request
+		CHECK_WRITE_STEP_SIGNAL(STEP_ID_PANEL_DATA_REQUEST, pszData, size);	
+
+		// Job Data Request
+		CHECK_READ_STEP_SIGNAL(STEP_ID_JOB_DATA_REQUEST, pszData, size);
 	}
 
 	BOOL CEquipment::isBitOn(const char* pszData, size_t size, int index)
@@ -1585,7 +1594,7 @@
 		return 0;
 	}
 
-	int CEquipment::decodePanelDataRequest(CStep* pStep, const char* pszData, size_t size)
+	int CEquipment::decodeJobDataRequest(CStep* pStep, const char* pszData, size_t size)
 	{
 		int index = 0;
 		short cassetteSequenceNo, jobSequenceNo;
@@ -1593,24 +1602,9 @@
 		index += sizeof(short);
 		memcpy(&jobSequenceNo, &pszData[index], sizeof(short));
 		index += sizeof(short);
+		cassetteSequenceNo = 4000;
+		jobSequenceNo = 1;
 
-
-		// efme, 获取数据后返回
-		// Cassette Sequence No		1W
-		// Job Sequence No			1W
-		// Job DataS				256W
-		char szBuffer[1024];
-		index = 0;
-		memcpy(&szBuffer[index], &cassetteSequenceNo, sizeof(short));
-		index += sizeof(short);
-		memcpy(&szBuffer[index], &jobSequenceNo, sizeof(short));
-		index += sizeof(short);
-
-		CJobDataS* pJobDataS = getJobDataSWithCassette(cassetteSequenceNo, jobSequenceNo);
-		if (pJobDataS != nullptr) {
-			index += pJobDataS->serialize(&szBuffer[index], 1024 - sizeof(short) - sizeof(short));
-			((CEqReadStep*)pStep)->setReturnData(szBuffer, index);
-		}
 
 
 		// 缓存Attribute,用于调试时显示信息
diff --git a/SourceCode/Bond/Servo/CEquipment.h b/SourceCode/Bond/Servo/CEquipment.h
index 8e45d80..76c0f91 100644
--- a/SourceCode/Bond/Servo/CEquipment.h
+++ b/SourceCode/Bond/Servo/CEquipment.h
@@ -223,7 +223,7 @@
 		int decodeVCREventReport(CStep* pStep, const char* pszData, size_t size);
 		int decodePanelDataReport(CStep* pStep, const char* pszData, size_t size);
 		int decodeFacDataReport(CStep* pStep, const char* pszData, size_t size);
-		int decodePanelDataRequest(CStep* pStep, const char* pszData, size_t size);
+		int decodeJobDataRequest(CStep* pStep, const char* pszData, size_t size);
 		BOOL compareJobData(CJobDataB* pJobDataB, CJobDataS* pJobDataS);
 		void setProcessState(PROCESS_STATE state);
 
diff --git a/SourceCode/Bond/Servo/Common.h b/SourceCode/Bond/Servo/Common.h
index 913285f..5dd53a1 100644
--- a/SourceCode/Bond/Servo/Common.h
+++ b/SourceCode/Bond/Servo/Common.h
@@ -319,6 +319,7 @@
 #define STEP_ID_FETCHED_OUT_JOB_REPORT13		0x5BB
 #define STEP_ID_FETCHED_OUT_JOB_REPORT14		0x5BC
 #define STEP_ID_FETCHED_OUT_JOB_REPORT15		0x5BD
+#define STEP_ID_JOB_DATA_REQUEST				0x5C1
 #define STEP_ID_PANEL_DATA_REQUEST				0x5D0
 #define STEP_ID_PANEL_DATA_REPORT				0x5D1
 #define STEP_ID_IN_OP_CMD_REPLY					0x5F0

--
Gitblit v1.9.3