From 0de0a72329a77fbf20bc299c542e435a6d47256b Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期六, 21 六月 2025 17:12:01 +0800
Subject: [PATCH] Merge branch 'liuyang' into clh

---
 SourceCode/Bond/Servo/CEFEM.cpp |   77 ++++++++++++++------------------------
 1 files changed, 28 insertions(+), 49 deletions(-)

diff --git a/SourceCode/Bond/Servo/CEFEM.cpp b/SourceCode/Bond/Servo/CEFEM.cpp
index 995763b..8a0e9cc 100644
--- a/SourceCode/Bond/Servo/CEFEM.cpp
+++ b/SourceCode/Bond/Servo/CEFEM.cpp
@@ -713,7 +713,7 @@
 			// JOB Data Request
 			CEqReadStep* pStep = new CEqReadStep(0x0, 0,
 				[&](void* pFrom, int code, const char* pszData, size_t size) -> int {
-					if (code == ROK && pszData != nullptr && size > 0) {
+					if (code == ROK /* && pszData != nullptr && size > 0*/) {
 						// 由于EFEM没有发送参数到master, 我们只需要返回数据
 						// Cassette Sequence No和Job Sequence No根据上一次调试缓存而来
 						// decodeJobDataRequest((CStep*)pFrom, pszData, size);
@@ -843,66 +843,45 @@
 
 	int CEFEM::onFetchedOutJob(int port, CJobDataB* pJobDataB)
 	{
-		if (port == 1) {
-			return m_pPort[0]->onFetchedOutJob(port, pJobDataB);
-		}
-		if (port == 2) {
-			return m_pPort[1]->onFetchedOutJob(port, pJobDataB);
-		}
-		if (port == 3) {
-			return m_pPort[2]->onFetchedOutJob(port, pJobDataB);
-		}
-		if (port == 4) {
-			return m_pPort[3]->onFetchedOutJob(port, pJobDataB);
-		}
-		if (port == 5) {
-			return m_pArmTray[0]->onFetchedOutJob(port, pJobDataB);
-		}
-		if (port == 6) {
-			return m_pArmTray[1]->onFetchedOutJob(port, pJobDataB);
-		}
-		if (port == 7) {
-			return m_pAligner->onFetchedOutJob(port, pJobDataB);
-		}
-		if (port == 8) {
-			return m_pFliper->onFetchedOutJob(port, pJobDataB);
+		// 转发到子单元设备
+		CEquipment* pEqs[] = { m_pPort[0], m_pPort[1], m_pPort[2], m_pPort[3], m_pArmTray[0], m_pArmTray[1],
+			m_pAligner, m_pFliper };
+		if (1 <= port && port <= 8) {
+			pEqs[port - 1]->onFetchedOutJob(port, pJobDataB);
 		}
 
-		return -1;
+
+		return 0;
 	}
 
 	int CEFEM::onStoredJob(int port, CJobDataB* pJobDataB)
 	{
-		if (port == 1) {
-			return m_pPort[0]->onStoredJob(port, pJobDataB);
-		}
-		if (port == 2) {
-			return m_pPort[1]->onStoredJob(port, pJobDataB);
-		}
-		if (port == 3) {
-			return m_pPort[2]->onStoredJob(port, pJobDataB);
-		}
-		if (port == 4) {
-			return m_pPort[3]->onStoredJob(port, pJobDataB);
-		}
-		if (port == 5) {
-			return m_pArmTray[0]->onStoredJob(port, pJobDataB);
-		}
-		if (port == 6) {
-			return m_pArmTray[1]->onStoredJob(port, pJobDataB);
-		}
-		if (port == 7) {
-			return m_pAligner->onStoredJob(port, pJobDataB);
-		}
-		if (port == 8) {
-			return m_pFliper->onStoredJob(port, pJobDataB);
+		// 转发到子单元设备
+		CEquipment* pEqs[] = { m_pPort[0], m_pPort[1], m_pPort[2], m_pPort[3], m_pArmTray[0], m_pArmTray[1],
+			m_pAligner, m_pFliper };
+		if (1 <= port && port <= 8) {
+			pEqs[port - 1]->onStoredJob(port, pJobDataB);
 		}
 
-		return -1;
+
+		return 0;
 	}
 
 	int CEFEM::getIndexerOperationModeBaseValue()
 	{
 		return 10000;
 	}
+
+	void CEFEM::printDebugString001()
+	{
+		for (int i = 0; i < 8; i++) {
+			LOGI("<CEquipment-%s>%d, Signal:%s, %s, %s, %s",
+				m_strName.c_str(), i,
+				m_bLinkSignal[i][SIGNAL_UPSTREAM_INLINE] ? "ON" : "OFF",
+				m_bLinkSignal[i][SIGNAL_UPSTREAM_TROUBLE] ? "ON" : "OFF",
+				m_bLinkSignal[i][SIGNAL_INTERLOCK] ? "ON" : "OFF",
+				m_bLinkSignal[i][SIGNAL_SEND_ABLE] ? "ON" : "OFF"
+			);
+		}
+	}
 }

--
Gitblit v1.9.3