From 02d1df7b4fa1a0e686c112e7bf3c8e794ba42b82 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期四, 19 六月 2025 10:04:26 +0800
Subject: [PATCH] 1. 添加设备配方绑定

---
 SourceCode/Bond/Servo/CLoadPort.cpp |   56 +++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 51 insertions(+), 5 deletions(-)

diff --git a/SourceCode/Bond/Servo/CLoadPort.cpp b/SourceCode/Bond/Servo/CLoadPort.cpp
index fc3f5c5..81361bc 100644
--- a/SourceCode/Bond/Servo/CLoadPort.cpp
+++ b/SourceCode/Bond/Servo/CLoadPort.cpp
@@ -92,7 +92,7 @@
 			// Type
 			static char* pszName[] = { STEP_EQ_PORT1_TYPE, STEP_EQ_PORT2_TYPE, STEP_EQ_PORT3_TYPE, STEP_EQ_PORT4_TYPE };
 			static int dev[] = { 0x6010 , 0x6020, 0x6030, 0x6040 };
-			static int writeSignalDev[] = { 0xa0, 0xa1, 0xa2, 0xa3 };
+			static int writeSignalDev[] = { 0x90, 0x91, 0x92, 0x93 };
 			static int addr[] = { STEP_ID_PORT1_TYPE_CHANGE, STEP_ID_PORT2_TYPE_CHANGE, STEP_ID_PORT3_TYPE_CHANGE, STEP_ID_PORT4_TYPE_CHANGE };
 
 			CEqReadStep* pStep = new CEqReadStep(dev[m_nIndex], sizeof(short),
@@ -113,7 +113,7 @@
 			// Mode
 			static char* pszName[] = { STEP_EQ_PORT1_MODE, STEP_EQ_PORT2_MODE, STEP_EQ_PORT3_MODE, STEP_EQ_PORT4_MODE };
 			static int dev[] = { 0x6011, 0x6021, 0x6031, 0x6041 };
-			static int writeSignalDev[] = { 0xa8, 0xa9, 0xaa, 0xab };
+			static int writeSignalDev[] = { 0x98, 0x99, 0x9a, 0x9b };
 			static int addr[] = { STEP_ID_PORT1_MODE_CHANGE, STEP_ID_PORT2_MODE_CHANGE, STEP_ID_PORT3_MODE_CHANGE, STEP_ID_PORT4_MODE_CHANGE };
 
 			CEqReadStep* pStep = new CEqReadStep(dev[m_nIndex], sizeof(short),
@@ -134,7 +134,7 @@
 			// Cassette type
 			static char* pszName[] = { STEP_EQ_PORT1_CASSETTE_TYPE, STEP_EQ_PORT2_CASSETTE_TYPE, STEP_EQ_PORT3_CASSETTE_TYPE, STEP_EQ_PORT4_CASSETTE_TYPE };
 			static int dev[] = { 0x6012, 0x6022, 0x6032, 0x6042 };
-			static int writeSignalDev[] = { 0xb0, 0xb1, 0xb2, 0xb3 };
+			static int writeSignalDev[] = { 0xa0, 0xa1, 0xa2, 0xa3 };
 			static int addr[] = { STEP_ID_PORT1_CASSETTE_TYPE_CHANGE, STEP_ID_PORT2_CASSETTE_TYPE_CHANGE, STEP_ID_PORT3_CASSETTE_TYPE_CHANGE, STEP_ID_PORT4_CASSETTE_TYPE_CHANGE };
 
 			CEqReadStep* pStep = new CEqReadStep(dev[m_nIndex], sizeof(short),
@@ -155,7 +155,7 @@
 			// Transfer type
 			static char* pszName[] = { STEP_EQ_PORT1_TRANSFER_MODE, STEP_EQ_PORT2_TRANSFER_MODE, STEP_EQ_PORT3_TRANSFER_MODE, STEP_EQ_PORT4_TRANSFER_MODE };
 			static int dev[] = { 0x6014, 0x6024, 0x6034, 0x6044 };
-			static int writeSignalDev[] = { 0xb8, 0xb9, 0xba, 0xbb };
+			static int writeSignalDev[] = { 0xa8, 0xa9, 0xaa, 0xab };
 			static int addr[] = { STEP_ID_PORT1_TRANSFER_MODE_CHANGE, STEP_ID_PORT2_TRANSFER_MODE_CHANGE, STEP_ID_PORT3_TRANSFER_MODE_CHANGE, STEP_ID_PORT4_TRANSFER_MODE_CHANGE };
 
 			CEqReadStep* pStep = new CEqReadStep(dev[m_nIndex], sizeof(short),
@@ -176,7 +176,7 @@
 			// Port enable
 			static char* pszName[] = { STEP_EQ_PORT1_ENABLE, STEP_EQ_PORT2_ENABLE, STEP_EQ_PORT3_ENABLE, STEP_EQ_PORT4_ENABLE };
 			static int dev[] = { 0x6015, 0x6025, 0x6035, 0x6045 };
-			static int writeSignalDev[] = { 0xc0, 0xc1, 0xc2, 0xc3 };
+			static int writeSignalDev[] = { 0xb0, 0xb1, 0xb2, 0xb3 };
 			static int addr[] = { STEP_ID_PORT1_ENABLE_MODE_CHANGE, STEP_ID_PORT2_ENABLE_MODE_CHANGE, STEP_ID_PORT3_ENABLE_MODE_CHANGE, STEP_ID_PORT4_ENABLE_MODE_CHANGE };
 
 			CEqReadStep* pStep = new CEqReadStep(dev[m_nIndex], sizeof(short),
@@ -345,6 +345,50 @@
 				if (addStep(addr[i][m_nIndex], pStep) != 0) {
 					delete pStep;
 				}
+			}
+		}
+		
+		{
+			// Fetched Out Job Report #1~15
+			char szBuffer[256];
+			CEqReadStep* pStep = new CEqReadStep(0x5c31 + 18 * m_nIndex, 18 * 2,
+				[&](void* pFrom, int code, const char* pszData, size_t size) -> int {
+					if (code == ROK && pszData != nullptr && size > 0) {
+						int port = (int)(__int64)((CEqReadStep*)pFrom)->getProp("Port");
+						if (port > 0) {
+							decodeFetchedOutJobReport((CStep*)pFrom, port, pszData, size);
+						}
+					}
+					return -1;
+				});
+			sprintf_s(szBuffer, "%s%d", STEP_EQ_FETCHED_OUT_JOBn, m_nIndex + 1);
+			pStep->setName(szBuffer);
+			pStep->setProp("Port", (void*)(__int64)(m_nIndex + 1));
+			pStep->setWriteSignalDev(0x023 + m_nIndex);
+			if (addStep(STEP_ID_FETCHED_OUT_JOB_REPORT1 + m_nIndex, pStep) != 0) {
+				delete pStep;
+			}
+		}
+
+		{
+			// Store Job Report #1~15
+			char szBuffer[256];
+			CEqReadStep* pStep = new CEqReadStep(0x5b23 + 18 * m_nIndex, 18 * 2,
+				[&](void* pFrom, int code, const char* pszData, size_t size) -> int {
+					if (code == ROK && pszData != nullptr && size > 0) {
+						int port = (int)(__int64)((CEqReadStep*)pFrom)->getProp("Port");
+						if (port > 0) {
+							decodeStoredJobReport((CStep*)pFrom, port, pszData, size);
+						}
+					}
+					return -1;
+				});
+			sprintf_s(szBuffer, "%s%d", STEP_EQ_STORED_JOBn, m_nIndex + 1);
+			pStep->setName(szBuffer);
+			pStep->setProp("Port", (void*)(__int64)(m_nIndex + 1));
+			pStep->setWriteSignalDev(0x014 + m_nIndex);
+			if (addStep(STEP_ID_STORE_JOB_REPORT1 + m_nIndex, pStep) != 0) {
+				delete pStep;
 			}
 		}
 	}
@@ -820,6 +864,8 @@
 
 	void CLoadPort::onReceiveLBData(const char* pszData, size_t size)
 	{
+		__super::onReceiveLBData(pszData, size);
+
 		static int type[] = { STEP_ID_PORT1_TYPE_CHANGE, STEP_ID_PORT2_TYPE_CHANGE,
 			STEP_ID_PORT3_TYPE_CHANGE, STEP_ID_PORT4_TYPE_CHANGE };
 		static int mode[] = { STEP_ID_PORT1_MODE_CHANGE, STEP_ID_PORT2_MODE_CHANGE,

--
Gitblit v1.9.3