From 62a56d6003638a7c0a477cc549d1811e6b17a4a4 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期四, 03 七月 2025 11:06:34 +0800
Subject: [PATCH] 1.增加下载的map和efem扫描的map的比较,如果不一致,则Cassette Process Cancel 并抛出到应用层。一致则Cassette Process Start。

---
 SourceCode/Bond/Servo/CLoadPort.cpp |   31 ++++++++++++++++++++++++++++---
 1 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/SourceCode/Bond/Servo/CLoadPort.cpp b/SourceCode/Bond/Servo/CLoadPort.cpp
index f6afed4..ee5a8d1 100644
--- a/SourceCode/Bond/Servo/CLoadPort.cpp
+++ b/SourceCode/Bond/Servo/CLoadPort.cpp
@@ -884,8 +884,22 @@
 		if (nRet < 0) return nRet;
 		m_portStatusReport.copyEx(portStatusReport);
 
+
+		// 当port状态为InUse, 比较map
 		if (m_portStatusReport.getPortStatus() == PORT_INUSE) {
-			this->sendCassetteCtrlCmd(5, nullptr, 0, 0, 0, nullptr, nullptr);
+			short scanMap = m_portStatusReport.getJobExistenceSlot();
+			short downMap = getCassetteMap();
+			if (scanMap == downMap) {
+				this->sendCassetteCtrlCmd(5, nullptr, 0, 0, 0, nullptr, nullptr);
+			}
+			else {
+				this->sendCassetteCtrlCmd(10, nullptr, 0, 0, 0, nullptr, nullptr);
+
+				// 抛出到应用层做提示
+				if (m_listener.onMapMismatch != nullptr) {
+					m_listener.onMapMismatch(this, scanMap, downMap);
+				}
+			}
 		}
 
 
@@ -1112,6 +1126,18 @@
 		m_bAutoChangeEnable = bEnable;
 	}
 
+	short CLoadPort::getCassetteMap()
+	{
+		short map = 0;
+		for (int i = 0; i < SLOT_MAX; i++) {
+			if (!m_slot[i].isEnable()) continue;
+			if (m_slot[i].getContext() == nullptr) continue;
+			map |= (1 << i);
+		}
+
+		return map;
+	}
+
 	/*
 	 * 生成测试用的玻璃列表
 	 */
@@ -1127,14 +1153,13 @@
 
 
 		char szBuffer[64];
-		for (int i = 0; i < 1; i++) {
+		for (int i = 0; i < SLOT_MAX; i++) {
 			if (!m_slot[i].isEnable()) continue;
 
 			CJobDataS js;
 			js.setCassetteSequenceNo(getNextCassetteSequenceNo());
 			js.setJobSequenceNo(m_slot[i].getNo());
 			sprintf_s(szBuffer, 64, "%05d%05d", js.getCassetteSequenceNo(), js.getJobSequenceNo());
-			//js.setGlass1Id(szBuffer);
 			js.setJobType(1);
 			js.setMaterialsType((int)type);
 

--
Gitblit v1.9.3