From 944e8f3dea723404e21168e97116cca2c09c70cb Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期二, 27 一月 2026 15:26:29 +0800
Subject: [PATCH] 1.扫码事件上报,之前只上报OK一种情况,现在有事种状态。 2.Port事件上报关联PortID, 统一修改为VID:PortID,之前分开很多种。

---
 SourceCode/Bond/Servo/HsmsPassive.h               |    1 
 SourceCode/Bond/x64/Debug/CollectionEventList.txt |    5 ++
 SourceCode/Bond/Servo/HsmsPassive.cpp             |   27 +++++++++++++
 SourceCode/Bond/Servo/Model.cpp                   |   16 ++++----
 SourceCode/Bond/x64/Debug/ReportList.txt          |   12 +++---
 SourceCode/Bond/x64/Debug/VariableList.txt        |    7 ---
 6 files changed, 46 insertions(+), 22 deletions(-)

diff --git a/SourceCode/Bond/Servo/HsmsPassive.cpp b/SourceCode/Bond/Servo/HsmsPassive.cpp
index 0d0f8a3..98d6a85 100644
--- a/SourceCode/Bond/Servo/HsmsPassive.cpp
+++ b/SourceCode/Bond/Servo/HsmsPassive.cpp
@@ -3771,7 +3771,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()
diff --git a/SourceCode/Bond/Servo/HsmsPassive.h b/SourceCode/Bond/Servo/HsmsPassive.h
index abbe05e..81c5188 100644
--- a/SourceCode/Bond/Servo/HsmsPassive.h
+++ b/SourceCode/Bond/Servo/HsmsPassive.h
@@ -235,6 +235,7 @@
 	int requestEventReportSend_Panel_Start();
 	int requestEventReportSend_Panel_End();
 	int requestEventReportSend_OCR_PanelID_Read_OK();
+	int requestEventReportSend_OCR_PanelID_Read(short vcrResult);
 	int requestEventReportSend_LoadPortNotAssoc();
 	int requestEventReportSend_ProcessDataReport();
 	int requestEventReportSend_SubEqpStart();
diff --git a/SourceCode/Bond/Servo/Model.cpp b/SourceCode/Bond/Servo/Model.cpp
index 6cbe9c2..b345e3d 100644
--- a/SourceCode/Bond/Servo/Model.cpp
+++ b/SourceCode/Bond/Servo/Model.cpp
@@ -525,9 +525,9 @@
 		if (pReport != nullptr) {
 			m_hsmsPassive.withVariableLock([&] {
 				m_hsmsPassive.setVariableValue("VCRPanelID", pReport->getGlassId().c_str());
-				int nRet = m_hsmsPassive.requestEventReportSend_OCR_PanelID_Read_OK();
+				int nRet = m_hsmsPassive.requestEventReportSend_OCR_PanelID_Read(pReport->getVcrResult());
 				if (nRet != ER_NOERROR) {
-					LOGE("<CModel>requestEventReportSend_OCR_PanelID_Read_OK failed, ret=%d", nRet);
+					LOGE("<CModel>requestEventReportSend_OCR_PanelID_Read failed, ret=%d", nRet);
 				}
 			});
 		}
@@ -681,7 +681,7 @@
 			m_hsmsPassive.withVariableLock([&] {
 				m_hsmsPassive.setVariableValue(stateVid, (__int64)status);
 				m_hsmsPassive.setVariableValue(modeVid, (__int64)pLoadPort->getPortMode());
-				m_hsmsPassive.setVariableValue("PortStateChangePortId", pLoadPort->getID());
+				m_hsmsPassive.setVariableValue("PortId", pLoadPort->getID());
 				m_hsmsPassive.setVariableValue("PortState", (__int64)status);
 				m_hsmsPassive.requestEventReportSend("PortStateChange");
 			});
@@ -708,7 +708,7 @@
 			SERVO::CLoadPort* pLoadPort = dynamic_cast<SERVO::CLoadPort*>(pEquipment);
 			m_hsmsPassive.withVariableLock([&] {
 				if (pLoadPort != nullptr) {
-					m_hsmsPassive.setVariableValue("BlockedPortId", pLoadPort->getID());
+					m_hsmsPassive.setVariableValue("PortId", pLoadPort->getID());
 				}
 				m_hsmsPassive.requestEventReportSend_Port_Blocked();
 			});
@@ -717,7 +717,7 @@
 			SERVO::CLoadPort* pLoadPort = dynamic_cast<SERVO::CLoadPort*>(pEquipment);
 			m_hsmsPassive.withVariableLock([&] {
 				if (pLoadPort != nullptr) {
-					m_hsmsPassive.setVariableValue("LoadReadyPortId", pLoadPort->getID());
+					m_hsmsPassive.setVariableValue("PortId", pLoadPort->getID());
 				}
 				m_hsmsPassive.requestEventReportSend_Port_Load_Ready();
 			});
@@ -726,9 +726,9 @@
 			SERVO::CLoadPort* pLoadPort = dynamic_cast<SERVO::CLoadPort*>(pEquipment);
 			m_hsmsPassive.withVariableLock([&] {
 				if (pLoadPort != nullptr) {
-					m_hsmsPassive.setVariableValue("UnloadReadyPortId", pLoadPort->getID());
+					m_hsmsPassive.setVariableValue("PortId", pLoadPort->getID());
 					if (prevStatus == PORT_INUSE) {
-						m_hsmsPassive.setVariableValue("ReadyToReleasePortId", pLoadPort->getID());
+						m_hsmsPassive.setVariableValue("PortId", pLoadPort->getID());
 						m_hsmsPassive.requestEventReportSend_Port_Ready_To_Release();
 					}
 				}
@@ -739,7 +739,7 @@
 			SERVO::CLoadPort* pLoadPort = dynamic_cast<SERVO::CLoadPort*>(pEquipment);
 			m_hsmsPassive.withVariableLock([&] {
 				if (pLoadPort != nullptr) {
-					m_hsmsPassive.setVariableValue("LoadPortNotAssocPortId", pLoadPort->getID());
+					m_hsmsPassive.setVariableValue("PortId", pLoadPort->getID());
 				}
 				m_hsmsPassive.requestEventReportSend_LoadPortNotAssoc();
 			});
diff --git a/SourceCode/Bond/x64/Debug/CollectionEventList.txt b/SourceCode/Bond/x64/Debug/CollectionEventList.txt
index d342e94..d6ddc79 100644
--- a/SourceCode/Bond/x64/Debug/CollectionEventList.txt
+++ b/SourceCode/Bond/x64/Debug/CollectionEventList.txt
@@ -55,7 +55,10 @@
 50008,Port_Unload_Ready,,(50008)
 50009,Port_Load_Ready,,(50009)
 50010,Port_Blocked,,(50010)
-50011,OCR_PanelID_Read_OK,鎵爜浜嬩欢涓婃姤,(50012)
+50011,OCR_PanelID_Read_OK,,(50012)
+50015,OCR_PanelID_Read_NG,,(50012)
+50016,OCR_PanelID_Read_Mismatch,,(50012)
+50017,OCR_PanelID_Read_NG_Mismatch,,(50012)
 50012,Port_Ready_To_Release,,(50013)
 50020,PortStateChange,,(50020)
 60000,BonderSVData,,(60000)
diff --git a/SourceCode/Bond/x64/Debug/ReportList.txt b/SourceCode/Bond/x64/Debug/ReportList.txt
index c5f4abd..c03d298 100644
--- a/SourceCode/Bond/x64/Debug/ReportList.txt
+++ b/SourceCode/Bond/x64/Debug/ReportList.txt
@@ -24,14 +24,14 @@
 50005,(5007)
 50006,(5008)
 50007,(5009)
-50008,(5010)
-50009,(5011)
-50010,(5012)
+50008,(5022)
+50009,(5022)
+50010,(5022)
 50011,(5013)
 50012,(5014)
-50013,(5015)
-50014,(5016)
-50020,(500,5020,5021)
+50013,(5022)
+50014,(5022)
+50020,(500,5022,5021)
 60000,(500,6000,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018)
 61000,(500,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121)
 62000,(500,6200,6201,6202,6203,6204,6205,6206,6207,6208,6209,6210,6211,6212,6213,6214,6215,6216,6217)
diff --git a/SourceCode/Bond/x64/Debug/VariableList.txt b/SourceCode/Bond/x64/Debug/VariableList.txt
index 386ba84..3c4d61f 100644
--- a/SourceCode/Bond/x64/Debug/VariableList.txt
+++ b/SourceCode/Bond/x64/Debug/VariableList.txt
@@ -33,14 +33,9 @@
 5007,PanelEndID,A20,Panel end ID
 5008,CJStartID,A20,CJ start ID
 5009,CJEndID,A20,CJ end ID
-5010,UnloadReadyPortId,U1,Port ID (ReadyToUnload)
-5011,LoadReadyPortId,U1,Port ID (ReadyToLoad)
-5012,BlockedPortId,U1,Port ID (TransferBlocked)
 5014,VCRPanelID,A20,Panel ID from reader
-5015,ReadyToReleasePortId,U1,Port ID (ReadyToRelease)
-5016,LoadPortNotAssocPortId,U1,Port ID (LoadPortNotAssoc)
 5017,ProcessDataReportText,A50,EV_PROCESS_DATA_REPORT payload (placeholder)
 5018,SubEqpName,A20,Sub equipment name for SubEqp events
 5019,SubEqpSlot,U1,Slot number for SubEqp events
-5020,PortStateChangePortId,U1,Port ID for PortStateChange
 5021,PortState,U1,Port transfer/state code for PortStateChange
+5022,PortId,U1,Port ID for Port events

--
Gitblit v1.9.3