From b78a202c2933d345e1983de26948dbdae5d72382 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期四, 12 二月 2026 10:28:06 +0800
Subject: [PATCH] 1.加上限制条件,Port1必须配置Port2, Port3必须配Port4,且是同一ProcessJob

---
 SourceCode/Bond/Servo/HsmsPassive.cpp |   41 ++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 40 insertions(+), 1 deletions(-)

diff --git a/SourceCode/Bond/Servo/HsmsPassive.cpp b/SourceCode/Bond/Servo/HsmsPassive.cpp
index 0d0f8a3..da0eb24 100644
--- a/SourceCode/Bond/Servo/HsmsPassive.cpp
+++ b/SourceCode/Bond/Servo/HsmsPassive.cpp
@@ -1736,9 +1736,15 @@
 			replySelectedEquipmentStatusData(pMessage);
 		}
 		else if (nStream == 1 && pHeader->function == 11) {
+			// [EAP_MAPPING][S1F11] Status Variable namelist request -> S1F12.
+			// If customer requires swapping SV/DV mapping, this is one of the two switch points.
+			// Swap target with S1F21 branch below.
 			replyStatusVariableNamelistRequest(pMessage);
 		}
 		else if (nStream == 1 && pHeader->function == 21) {
+			// [EAP_MAPPING][S1F21] Data Variable namelist request -> S1F22.
+			// If customer requires swapping SV/DV mapping, this is one of the two switch points.
+			// Swap target with S1F11 branch above.
 			replyDataVariableNamelistRequest(pMessage);
 		}
 		else if (nStream == 1 && pHeader->function == 23) {
@@ -2342,6 +2348,10 @@
 // S1F11
 int CHsmsPassive::replyStatusVariableNamelistRequest(IMessage* pRecv)
 {
+	// [EAP_MAPPING][SV_HANDLER]
+	// Current behavior: handles S1F11 and replies S1F12 with SVID/SVNAME/UNITS.
+	// If customer requires SV/DV swap, this function body can be swapped with
+	// replyDataVariableNamelistRequest (or dispatch branches can be swapped instead).
 	if (m_pPassive == NULL || STATE::SELECTED != m_pPassive->getState()) {
 		return ER_NOTSELECT;
 	}
@@ -2451,6 +2461,10 @@
 // S1F21/S1F22 - Data Variable Namelist
 int CHsmsPassive::replyDataVariableNamelistRequest(IMessage* pRecv)
 {
+	// [EAP_MAPPING][DV_HANDLER]
+	// Current behavior: handles S1F21 and replies S1F22 with DVID/DVNAME/UNITS.
+	// If customer requires SV/DV swap, this function body can be swapped with
+	// replyStatusVariableNamelistRequest (or dispatch branches can be swapped instead).
 	if (m_pPassive == NULL || STATE::SELECTED != m_pPassive->getState()) {
 		return ER_NOTSELECT;
 	}
@@ -3771,7 +3785,32 @@
 
 int CHsmsPassive::requestEventReportSend_OCR_PanelID_Read_OK()
 {
-	return requestEventReportSend("OCR_PanelID_Read_OK");
+	return requestEventReportSend_OCR_PanelID_Read(1);
+}
+
+int CHsmsPassive::requestEventReportSend_OCR_PanelID_Read(short vcrResult)
+{
+	const char* eventName = "OCR_PanelID_Read_OK";
+	switch (vcrResult) {
+	case 1: // OK & Match
+		eventName = "OCR_PanelID_Read_OK";
+		break;
+	case 2: // OK & Mismatch
+		eventName = "OCR_PanelID_Read_Mismatch";
+		break;
+	case 3: // Fail & KeyIn Match
+		eventName = "OCR_PanelID_Read_NG";
+		break;
+	case 4: // Fail & KeyIn Mismatch
+		eventName = "OCR_PanelID_Read_NG_Mismatch";
+		break;
+	default:
+		LOGE("<CHsmsPassive>Unknown VCR result=%d, fallback to OCR_PanelID_Read_OK", vcrResult);
+		eventName = "OCR_PanelID_Read_OK";
+		break;
+	}
+
+	return requestEventReportSend(eventName);
 }
 
 int CHsmsPassive::requestEventReportSend_LoadPortNotAssoc()

--
Gitblit v1.9.3