From 498b8e781603ae007f41d0056b616f95140dd273 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期三, 28 一月 2026 10:04:51 +0800
Subject: [PATCH] 1.新增出入料事件

---
 SourceCode/Bond/x64/Debug/CollectionEventList.txt |   12 +++--
 SourceCode/Bond/Servo/CEquipment.cpp              |    4 ++
 Document/EventSummary_v2.1.xlsx                   |    0 
 SourceCode/Bond/Servo/CMaster.cpp                 |    5 ++
 SourceCode/Bond/Servo/CMaster.h                   |    2 +
 SourceCode/Bond/Servo/Model.cpp                   |   45 ++++++++++++++++++++++
 SourceCode/Bond/Servo/CEquipment.h                |    2 +
 SourceCode/Bond/x64/Debug/ReportList.txt          |    9 ++++
 SourceCode/Bond/x64/Debug/VariableList.txt        |    7 ++-
 9 files changed, 77 insertions(+), 9 deletions(-)

diff --git a/Document/EventSummary_v2.1.xlsx b/Document/EventSummary_v2.1.xlsx
new file mode 100644
index 0000000..9948a9e
--- /dev/null
+++ b/Document/EventSummary_v2.1.xlsx
Binary files differ
diff --git a/SourceCode/Bond/Servo/CEquipment.cpp b/SourceCode/Bond/Servo/CEquipment.cpp
index 9f29ea6..36217c3 100644
--- a/SourceCode/Bond/Servo/CEquipment.cpp
+++ b/SourceCode/Bond/Servo/CEquipment.cpp
@@ -1696,6 +1696,10 @@
 	{
 		LOGI("<CEquipment-%s>onSentOutJob.", m_strName.c_str());
 
+		if (m_listener.onSentOutJob != nullptr) {
+			m_listener.onSentOutJob(this, port, pJobDataS);
+		}
+
 		return 0;
 	}
 
diff --git a/SourceCode/Bond/Servo/CEquipment.h b/SourceCode/Bond/Servo/CEquipment.h
index 024b9e9..0ed9452 100644
--- a/SourceCode/Bond/Servo/CEquipment.h
+++ b/SourceCode/Bond/Servo/CEquipment.h
@@ -60,6 +60,7 @@
 	typedef std::function<void(void* pEiuipment, short status, __int64 data)> ONPORTSTATUSCHANGED;
 	typedef std::function<void(void* pEiuipment, const std::vector<CParam>& params)> ONPROCESSDATAREPORT;
 	typedef std::function<void(void* pEiuipment, int port, CJobDataS* pJobDataS)> ONRECEIVEDJOB;
+	typedef std::function<void(void* pEiuipment, int port, CJobDataS* pJobDataS)> ONSENTOUTJOB;
 	
 	typedef struct _EquipmentListener
 	{
@@ -77,6 +78,7 @@
 		ONVCREVENTREPORT	onPanelDataReport;
 		ONPROCESSDATAREPORT	onProcessDataReport;
 		ONRECEIVEDJOB		onReceivedJob;
+		ONSENTOUTJOB		onSentOutJob;
 	} EquipmentListener;
 
 
diff --git a/SourceCode/Bond/Servo/CMaster.cpp b/SourceCode/Bond/Servo/CMaster.cpp
index c17be6b..bd2e9ab 100644
--- a/SourceCode/Bond/Servo/CMaster.cpp
+++ b/SourceCode/Bond/Servo/CMaster.cpp
@@ -1930,6 +1930,11 @@
 				m_listener.onJobReceived(this, (CEquipment*)pEquipment, port, pJobDataS);
 			}
 		};
+		listener.onSentOutJob = [&](void* pEquipment, int port, CJobDataS* pJobDataS) {
+			if (m_listener.onJobSentOut != nullptr) {
+				m_listener.onJobSentOut(this, (CEquipment*)pEquipment, port, pJobDataS);
+			}
+		};
 		pEquipment->setListener(listener);
 		pEquipment->setCcLink(&m_cclink);
 		m_listEquipment.push_back(pEquipment);
diff --git a/SourceCode/Bond/Servo/CMaster.h b/SourceCode/Bond/Servo/CMaster.h
index 39f2579..3db1a19 100644
--- a/SourceCode/Bond/Servo/CMaster.h
+++ b/SourceCode/Bond/Servo/CMaster.h
@@ -71,6 +71,7 @@
     typedef std::function<void(void* pMaster, CEquipment* pEquipment, const std::vector<CParam>& params)> ONPROCESSDATAREPORTEX;
     typedef std::function<void(void* pMaster, CEquipment* pEquipment, const std::vector<CParam>& params)> ONSVDATAREPORT;
     typedef std::function<void(void* pMaster, CEquipment* pEquipment, int port, CJobDataS* pJobDataS)> ONJOBRECEIVED;
+    typedef std::function<void(void* pMaster, CEquipment* pEquipment, int port, CJobDataS* pJobDataS)> ONJOBSENTOUT;
     typedef std::function<void(void* pMaster, int round)> ONCTROUNDEND;
     typedef std::function<void(void* pMaster, void* pj)> ONPJSTART;
     typedef std::function<void(void* pMaster)> ONCONTROLJOBCHANGED;
@@ -88,6 +89,7 @@
         ONSVDATAREPORT          onSVDataReport;
         ONPROCESSDATAREPORTEX   onProcessDataReport;
         ONJOBRECEIVED           onJobReceived;
+        ONJOBSENTOUT            onJobSentOut;
         ONCTROUNDEND            onCTRoundEnd;
         ONPJSTART               onCjStart;
         ONPJSTART               onCjEnd;
diff --git a/SourceCode/Bond/Servo/Model.cpp b/SourceCode/Bond/Servo/Model.cpp
index c7d3597..e5afc98 100644
--- a/SourceCode/Bond/Servo/Model.cpp
+++ b/SourceCode/Bond/Servo/Model.cpp
@@ -631,6 +631,27 @@
 		(void)pMaster;
 		(void)port;
 		if (pEquipment == nullptr || pJobDataS == nullptr) return;
+		{
+			const std::string& g1 = pJobDataS->getGlass1Id();
+			const std::string& g2 = pJobDataS->getGlass2Id();
+			std::string glassId;
+			if (!g1.empty() && !g2.empty()) {
+				glassId = g1 + "+" + g2;
+			}
+			else if (!g1.empty()) {
+				glassId = g1;
+			}
+			else {
+				glassId = g2;
+			}
+			const int slotNo = pJobDataS->getTargetSlotNo();
+			m_hsmsPassive.withVariableLock([&] {
+				m_hsmsPassive.setVariableValue("SubEqpName", pEquipment->getName().c_str());
+				m_hsmsPassive.setVariableValue("SubEqpSlot", slotNo);
+				m_hsmsPassive.setVariableValue("MaterialId", glassId.c_str());
+				m_hsmsPassive.requestEventReportSend("GlassReceivedJob");
+			});
+		}
 		const int eqId = pEquipment->getID();
 		const int recipeId = pJobDataS->getMasterRecipe();
 		std::string recipe = RecipeManager::getInstance().getPPIDById(recipeId);
@@ -663,6 +684,30 @@
 			m_hsmsPassive.requestEventReportSend("RecipeChanged");
 		});
 	};
+	masterListener.onJobSentOut = [&](void* pMaster, SERVO::CEquipment* pEquipment, int port, SERVO::CJobDataS* pJobDataS) {
+		(void)pMaster;
+		(void)port;
+		if (pEquipment == nullptr || pJobDataS == nullptr) return;
+		const std::string& g1 = pJobDataS->getGlass1Id();
+		const std::string& g2 = pJobDataS->getGlass2Id();
+		std::string glassId;
+		if (!g1.empty() && !g2.empty()) {
+			glassId = g1 + "+" + g2;
+		}
+		else if (!g1.empty()) {
+			glassId = g1;
+		}
+		else {
+			glassId = g2;
+		}
+		const int slotNo = pJobDataS->getSourceSlotNo();
+		m_hsmsPassive.withVariableLock([&] {
+			m_hsmsPassive.setVariableValue("SubEqpName", pEquipment->getName().c_str());
+			m_hsmsPassive.setVariableValue("SubEqpSlot", slotNo);
+			m_hsmsPassive.setVariableValue("MaterialId", glassId.c_str());
+			m_hsmsPassive.requestEventReportSend("GlassSentOutJob");
+		});
+	};
 	masterListener.onLoadPortStatusChanged = [&] (void* pMaster, SERVO::CEquipment* pEquipment, short status, __int64 data) {
 		LOGE("<CModel>onLoadPortStatusChanged. status = %d", status);
 		static std::map<int, short> s_prevPortStatus;
diff --git a/SourceCode/Bond/x64/Debug/CollectionEventList.txt b/SourceCode/Bond/x64/Debug/CollectionEventList.txt
index d6ddc79..b42a9e6 100644
--- a/SourceCode/Bond/x64/Debug/CollectionEventList.txt
+++ b/SourceCode/Bond/x64/Debug/CollectionEventList.txt
@@ -19,7 +19,7 @@
 10061,CheckSlotMap,,(10061)
 10062,SlotMapVerificationOK,,(10062)
 10063,SlotMapVerificationNG,,(10062)
-10064,SlotMapMismatch,,(10062)
+10064,SlotMapMismatch,Slot map mismatch between scan and download,(10062)
 10071,GlassIDReadWaitingForHost,,(10071)
 10072,GlassIDReadVerificationOK,,(10072)
 10073,GlassIDReadVerificationNG,,(10072)
@@ -55,12 +55,14 @@
 50008,Port_Unload_Ready,,(50008)
 50009,Port_Load_Ready,,(50009)
 50010,Port_Blocked,,(50010)
-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)
+50011,OCR_PanelID_Read_OK,OCR read OK and match,(50012)
+50015,OCR_PanelID_Read_NG,OCR read fail (key-in match),(50012)
+50016,OCR_PanelID_Read_Mismatch,OCR read OK but mismatch,(50012)
+50017,OCR_PanelID_Read_NG_Mismatch,OCR read fail and key-in mismatch,(50012)
 50012,Port_Ready_To_Release,,(50013)
 50020,PortStateChange,,(50020)
+50021,GlassReceivedJob,Glass received into equipment slot,(50021)
+50022,GlassSentOutJob,Glass sent out from equipment slot,(50022)
 60000,BonderSVData,,(60000)
 61000,BonderProcessData,,(61000)
 62000,VacuumBakeSVData,,(62000)
diff --git a/SourceCode/Bond/x64/Debug/ReportList.txt b/SourceCode/Bond/x64/Debug/ReportList.txt
index a19021d..b4d31bc 100644
--- a/SourceCode/Bond/x64/Debug/ReportList.txt
+++ b/SourceCode/Bond/x64/Debug/ReportList.txt
@@ -1,4 +1,9 @@
-RPTID,(VID1,VID2,...)
+锘縍PTID,(VID1,VID2,...)
+# Notes:
+# - RPTIDs 60000-67000, 700, 10017, 20000 include SubEqpName(5018) and SubEqpSlot(5019).
+# - RPTIDs 50008/50009/50010/50013/50014/50020 use PortId(5022).
+# - OCR events (CEID 50011/50015/50016/50017) use RPTID 50012 with VCRPanelID(5014).
+
 33,(5017)
 300,(1,300)
 301,(1,300)
@@ -32,6 +37,8 @@
 50013,(5022)
 50014,(5022)
 50020,(500,5022,5021)
+50021,(5018,5019,5023)
+50022,(5018,5019,5023)
 60000,(500,5018,5019,6000,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018)
 61000,(500,5018,5019,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121)
 62000,(500,5018,5019,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 3c4d61f..06499c8 100644
--- a/SourceCode/Bond/x64/Debug/VariableList.txt
+++ b/SourceCode/Bond/x64/Debug/VariableList.txt
@@ -35,7 +35,8 @@
 5009,CJEndID,A20,CJ end ID
 5014,VCRPanelID,A20,Panel ID from reader
 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
+5018,SubEqpName,A20,Sub equipment name (SubEqp/Unit/Process/SV/ProcessData events)
+5019,SubEqpSlot,U1,Slot number for SubEqp/Unit; 0 when not applicable
 5021,PortState,U1,Port transfer/state code for PortStateChange
-5022,PortId,U1,Port ID for Port events
+5022,PortId,U1,Unified port ID for all Port events
+5023,MaterialId,A50,Material/Glass ID for Received/SentOut events

--
Gitblit v1.9.3