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 端口拆分

---
 SourceCode/Bond/Servo/Model.cpp |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

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涓婁紶 

--
Gitblit v1.9.3