From db980adce32f563a8c65e4bff680a15471904531 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期二, 27 一月 2026 10:49:12 +0800
Subject: [PATCH] 1.AccessMode / PortTransferState 按 4 端口拆分

---
 Document/VariableList.txt                         |   14 ++++++++++++--
 SourceCode/Bond/x64/Debug/CollectionEventList.txt |    1 +
 SourceCode/Bond/Servo/Model.cpp                   |   13 +++++++++++--
 SourceCode/Bond/x64/Debug/ReportList.txt          |   16 ++++++++--------
 4 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/Document/VariableList.txt b/Document/VariableList.txt
index 1c92863..9db9582 100644
--- a/Document/VariableList.txt
+++ b/Document/VariableList.txt
@@ -1,6 +1,16 @@
 SVID,SV Name,SV Format,SV Remark
-100,PortTransferState,U1,"0=OutOfService\r\n1=TransferBlocked\r\n2=ReadyToLoad\r\n3=ReadyToUnload\r\n4=InService\r\n5=TransferReady"
-300,AccessMode,U1,"1=Manual\r\n2=Auto"
+10000,CarrierID_P1,A50,Carrier ID for Port 1
+10001,CarrierID_P2,A50,Carrier ID for Port 2
+10002,CarrierID_P3,A50,Carrier ID for Port 3
+10003,CarrierID_P4,A50,Carrier ID for Port 4
+100,PortTransferState_P1,U1,1=LoadReady;2=Loaded;3=InUse;4=UnloadReady;5=Empty;6=Blocked
+101,PortTransferState_P2,U1,1=LoadReady;2=Loaded;3=InUse;4=UnloadReady;5=Empty;6=Blocked
+102,PortTransferState_P3,U1,1=LoadReady;2=Loaded;3=InUse;4=UnloadReady;5=Empty;6=Blocked
+103,PortTransferState_P4,U1,1=LoadReady;2=Loaded;3=InUse;4=UnloadReady;5=Empty;6=Blocked
+300,AccessMode_P1,U1,0=OutOfService;1=TransferBlocked;2=ReadyToLoad;3=ReadyToUnload;4=InService;5=TransferReady
+301,AccessMode_P2,U1,0=OutOfService;1=TransferBlocked;2=ReadyToLoad;3=ReadyToUnload;4=InService;5=TransferReady
+302,AccessMode_P3,U1,0=OutOfService;1=TransferBlocked;2=ReadyToLoad;3=ReadyToUnload;4=InService;5=TransferReady
+303,AccessMode_P4,U1,0=OutOfService;1=TransferBlocked;2=ReadyToLoad;3=ReadyToUnload;4=InService;5=TransferReady
 500,Clock,A50,
 600,CurrentControlState,U1,"0:Offline:equipment\r\n1:Offline-Attempt\r\n2:Online\r\n3:Offline:host\r\n4:Online:Local\r\n5:Online:Remote"
 601,PreviousControlState,U1,
diff --git a/SourceCode/Bond/Servo/Model.cpp b/SourceCode/Bond/Servo/Model.cpp
index ed29052..ce34d63 100644
--- a/SourceCode/Bond/Servo/Model.cpp
+++ b/SourceCode/Bond/Servo/Model.cpp
@@ -660,8 +660,14 @@
 
 		// Unified PortStateChange event + SV maintenance
 		if (pLoadPort != nullptr) {
+			const unsigned int portIndex = pLoadPort->getIndex() + 1;
+			char stateVid[64] = {0};
+			char modeVid[64] = {0};
+			sprintf_s(stateVid, "PortTransferState_P%u", portIndex);
+			sprintf_s(modeVid, "AccessMode_P%u", portIndex);
 			m_hsmsPassive.withVariableLock([&] {
-				m_hsmsPassive.setVariableValue("PortTransferState", (__int64)status); // maintain SVID=100
+				m_hsmsPassive.setVariableValue(stateVid, (__int64)status);
+				m_hsmsPassive.setVariableValue(modeVid, (__int64)pLoadPort->getPortMode());
 				m_hsmsPassive.setVariableValue("PortStateChangePortId", pLoadPort->getID());
 				m_hsmsPassive.setVariableValue("PortState", (__int64)status);
 				m_hsmsPassive.requestEventReportSend("PortStateChange");
@@ -671,7 +677,10 @@
 		if (status == PORT_INUSE) {
 			m_hsmsPassive.withVariableLock([&] {
 				if (pLoadPort != nullptr) {
-					m_hsmsPassive.setVariableValue("CarrierID", pLoadPort->getCassetteId().c_str());
+					const unsigned int portIndex = pLoadPort->getIndex() + 1;
+					char carrierVid[64] = {0};
+					sprintf_s(carrierVid, "CarrierID_P%u", portIndex);
+					m_hsmsPassive.setVariableValue(carrierVid, pLoadPort->getCassetteId().c_str());
 					if (prevStatus != PORT_INUSE && pLoadPort->isCompareMapsBeforeProceeding()) {
 						// TODO(Host鍗忓晢):
 						// 鏂囨。涓爣鏄庯細1-Empty锛�3-Exist锛屽洜姝ゆ垜浠彲鑳介渶瑕佸皢uint鐨刴ap杞崲涓簂ist涓婁紶 
diff --git a/SourceCode/Bond/x64/Debug/CollectionEventList.txt b/SourceCode/Bond/x64/Debug/CollectionEventList.txt
index a5f32aa..d342e94 100644
--- a/SourceCode/Bond/x64/Debug/CollectionEventList.txt
+++ b/SourceCode/Bond/x64/Debug/CollectionEventList.txt
@@ -19,6 +19,7 @@
 10061,CheckSlotMap,,(10061)
 10062,SlotMapVerificationOK,,(10062)
 10063,SlotMapVerificationNG,,(10062)
+10064,SlotMapMismatch,,(10062)
 10071,GlassIDReadWaitingForHost,,(10071)
 10072,GlassIDReadVerificationOK,,(10072)
 10073,GlassIDReadVerificationNG,,(10072)
diff --git a/SourceCode/Bond/x64/Debug/ReportList.txt b/SourceCode/Bond/x64/Debug/ReportList.txt
index 8412387..c5f4abd 100644
--- a/SourceCode/Bond/x64/Debug/ReportList.txt
+++ b/SourceCode/Bond/x64/Debug/ReportList.txt
@@ -5,14 +5,14 @@
 600,(500,600,601)
 700,(500,700,701)
 10000,(200,201)
-10300,(1,10000)
-10051,(1,10000,10100,10101)
-10061,(1,10000,10100,10200)
-10062,(1,10000,10100,10201,10202)
-10071,(1,10000,10100,10203,20000)
-10072,(1,10000,10100,10203,20000,20001)
-10080,(1,10000,10100)
-20000,(1,10000,10203)
+10300,(1,10000,10001,10002,10003)
+10051,(1,10000,10001,10002,10003,10100,10101)
+10061,(1,10000,10001,10002,10003,10100,10200)
+10062,(1,10000,10001,10002,10003,10100,10201,10202)
+10071,(1,10000,10001,10002,10003,10100,10203,20000)
+10072,(1,10000,10001,10002,10003,10100,10203,20000,20001)
+10080,(1,10000,10001,10002,10003,10100)
+20000,(1,10000,10001,10002,10003,10203)
 30000,(1,30000,30001)
 31000,(1,31000,31001)
 40000,(1,10203,20000)

--
Gitblit v1.9.3