From 03dc81df7fe0ea0e754abcc5af3d329527428853 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期五, 09 一月 2026 20:06:45 +0800
Subject: [PATCH] 1.工节数据上报。

---
 SourceCode/Bond/x64/Debug/CollectionEventList.txt |    2 +
 SourceCode/Bond/Servo/CEquipment.cpp              |    8 +++
 SourceCode/Bond/Servo/CMaster.cpp                 |    5 ++
 SourceCode/Bond/Servo/CMaster.h                   |    9 ++--
 SourceCode/Bond/Servo/Model.cpp                   |   30 +++++++++++++++
 SourceCode/Bond/Servo/CEquipment.h                |    2 +
 SourceCode/Bond/Servo/CParam.h                    |    4 +-
 SourceCode/Bond/x64/Debug/ReportList.txt          |    2 +
 SourceCode/Bond/x64/Debug/VariableList.txt        |   43 +++++++++++++++++++++
 SourceCode/Bond/Servo/CParam.cpp                  |    4 +-
 10 files changed, 100 insertions(+), 9 deletions(-)

diff --git a/SourceCode/Bond/Servo/CEquipment.cpp b/SourceCode/Bond/Servo/CEquipment.cpp
index e4085e9..2cddb34 100644
--- a/SourceCode/Bond/Servo/CEquipment.cpp
+++ b/SourceCode/Bond/Servo/CEquipment.cpp
@@ -1608,8 +1608,11 @@
 		std::vector<CParam> tempParams;
 		this->parsingProcessData((const char*)rawData.data(), rawData.size(), tempParams);
 		int n = processData.getTotalParameter();
-		std::vector<CParam> params(tempParams.begin(), tempParams.begin() + min(n, (int)tempParams.size()));
+		std::vector<CParam> params(tempParams.begin(), tempParams.begin() + (std::min)(n, (int)tempParams.size()));
 		pGlass->addParams(params);
+		if (m_listener.onProcessDataReport != nullptr) {
+			m_listener.onProcessDataReport(this, params);
+		}
 		
 		// 鍏宠仈鐨凣lass涔熻鏇存柊
 		CGlass* pBuddy = pGlass->getBuddy();
@@ -1617,6 +1620,9 @@
 		if (pBuddy != nullptr) {
 			LOGI("<Equipment-%s>decodeProcessDataReport addParams pBuddy=%x %s", getName().c_str(), pBuddy, pGlass->getID().c_str());
 			pBuddy->addParams(params);
+			if (m_listener.onProcessDataReport != nullptr) {
+				m_listener.onProcessDataReport(this, params);
+			}
 		}
 
 		return nRet;
diff --git a/SourceCode/Bond/Servo/CEquipment.h b/SourceCode/Bond/Servo/CEquipment.h
index d447634..6f314c0 100644
--- a/SourceCode/Bond/Servo/CEquipment.h
+++ b/SourceCode/Bond/Servo/CEquipment.h
@@ -58,6 +58,7 @@
 	typedef std::function<void(void* pEiuipment, int nSlotNo, PROCESS_STATE prevState, PROCESS_STATE state)> ONPROCESSSTATE;
 	typedef std::function<void(void* pEiuipment, short scanMap, short downMap)> ONMAPMISMATCH;
 	typedef std::function<void(void* pEiuipment, short status, __int64 data)> ONPORTSTATUSCHANGED;
+	typedef std::function<void(void* pEiuipment, const std::vector<CParam>& params)> ONPROCESSDATAREPORT;
 	
 	typedef struct _EquipmentListener
 	{
@@ -73,6 +74,7 @@
 		ONPORTSTATUSCHANGED	onPortStatusChanged;
 		ONVCREVENTREPORT	onSVDataReport;
 		ONVCREVENTREPORT	onPanelDataReport;
+		ONPROCESSDATAREPORT	onProcessDataReport;
 	} EquipmentListener;
 
 
diff --git a/SourceCode/Bond/Servo/CMaster.cpp b/SourceCode/Bond/Servo/CMaster.cpp
index 0192312..f179421 100644
--- a/SourceCode/Bond/Servo/CMaster.cpp
+++ b/SourceCode/Bond/Servo/CMaster.cpp
@@ -1561,6 +1561,11 @@
 				m_listener.onProcessStateChanged(this, (CEquipment*)pEquipment, slotNo, prevState, state);
 			}
 		};
+		listener.onProcessDataReport = [&](void* pEquipment, const std::vector<CParam>& params) {
+			if (m_listener.onProcessDataReport != nullptr) {
+				m_listener.onProcessDataReport(this, (CEquipment*)pEquipment, params);
+			}
+		};
 		listener.onMapMismatch = [&](void* pEquipment, short scanMap, short downMap) {
 			LOGE("<Master-%s>Port InUse, map(%d!=%d)涓嶄竴鑷达紝璇锋鏌ャ��",
 				((CEquipment*)pEquipment)->getName().c_str(), scanMap, downMap);
diff --git a/SourceCode/Bond/Servo/CMaster.h b/SourceCode/Bond/Servo/CMaster.h
index dd2fa6e..d143a26 100644
--- a/SourceCode/Bond/Servo/CMaster.h
+++ b/SourceCode/Bond/Servo/CMaster.h
@@ -59,6 +59,7 @@
     typedef std::function<void(void* pMaster, CRobotTask* pTask, int code)> ONROBOTTASKEVENT;
     typedef std::function<void(void* pMaster, CEquipment* pEquipment, short status, __int64 data)> ONLOADPORTSTATUSCHANGED;
     typedef std::function<void(void* pMaster, CEquipment* pEquipment, int slotNo, PROCESS_STATE prevState, PROCESS_STATE state)> ONPROCESSSTATECHANGED;
+    typedef std::function<void(void* pMaster, CEquipment* pEquipment, const std::vector<CParam>& params)> ONPROCESSDATAREPORTEX;
     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;
@@ -73,6 +74,7 @@
         ONROBOTTASKEVENT        onRobotTaskEvent;
         ONLOADPORTSTATUSCHANGED	onLoadPortStatusChanged;
         ONPROCESSSTATECHANGED   onProcessStateChanged;
+        ONPROCESSDATAREPORTEX   onProcessDataReport;
         ONCTROUNDEND            onCTRoundEnd;
         ONPJSTART               onCjStart;
         ONPJSTART               onCjEnd;
@@ -205,7 +207,7 @@
         bool canCompleteControlJob();
         bool canDeleteControlJob();
         
-        // DAQ Bridge閻╃鍙�
+        // DAQ Bridge 鐩稿叧
         Collector* getCollector() const { return m_pCollector; }
 
     private:
@@ -243,10 +245,9 @@
         int m_nLastError;
         std::string m_strLastError;
 
-        // 鍦ㄥ紑濮嬪伐鑹哄墠鏄惁鍏堥渶瑕佸厛姣旇緝map
+        // 鍦ㄥ紑濮嬪伐鑹哄墠鏄惁闇�瑕佸厛姣旇緝 map
         BOOL m_isCompareMapsBeforeProceeding;
         BOOL m_bJobMode;
-
 
         // 鍗冧紶鍦堟暟璁℃暟
         int m_nContinuousTransferCount;
@@ -254,7 +255,7 @@
         int m_nContinuousWorkingPort;
         int m_nContinuousWorkingSlot;
 
-        // 鏂板宸茬粡寮�濮嬪鐞嗙殑ProcessJob鍒楄〃
+        // 宸茬粡寮�濮嬪鐞嗙殑 ProcessJob 鍒楄〃
         std::vector<CProcessJob*> m_inProcesJobs;
         std::vector<CProcessJob*> m_completeProcessJobs;
         std::vector<CGlass*> m_queueGlasses;
diff --git a/SourceCode/Bond/Servo/CParam.cpp b/SourceCode/Bond/Servo/CParam.cpp
index 57a8f0c..9162b12 100644
--- a/SourceCode/Bond/Servo/CParam.cpp
+++ b/SourceCode/Bond/Servo/CParam.cpp
@@ -53,7 +53,7 @@
 	return m_nValueType;
 }
 
-int CParam::getIntValue()
+int CParam::getIntValue() const
 {
 	return m_nValue;
 }
@@ -63,7 +63,7 @@
 	m_nValue = value;
 }
 
-double CParam::getDoubleValue()
+double CParam::getDoubleValue() const
 {
 	if(m_nValueType == PVT_DOUBLE)
 		return m_fValue;
diff --git a/SourceCode/Bond/Servo/CParam.h b/SourceCode/Bond/Servo/CParam.h
index f8562a1..3e8dd1c 100644
--- a/SourceCode/Bond/Servo/CParam.h
+++ b/SourceCode/Bond/Servo/CParam.h
@@ -17,9 +17,9 @@
 	std::string& getName();
 	std::string& getUnit();
 	int getValueType();
-	int getIntValue();
+	int getIntValue() const;
 	void setIntValue(int value);
-	double getDoubleValue();
+	double getDoubleValue() const;
 	void setDoubleValue(double value);
 	void Serialize(CArchive& ar);
 
diff --git a/SourceCode/Bond/Servo/Model.cpp b/SourceCode/Bond/Servo/Model.cpp
index 3f03a3d..e86862d 100644
--- a/SourceCode/Bond/Servo/Model.cpp
+++ b/SourceCode/Bond/Servo/Model.cpp
@@ -9,6 +9,9 @@
 #include "TransferManager.h"
 #include "RecipeManager.h"
 #include "GlassLogDb.h"
+#include "CParam.h"
+#include <algorithm>
+#include <iomanip>
 #include <map>
 
 
@@ -608,6 +611,33 @@
 			}
 		});
 	};
+	masterListener.onProcessDataReport = [&](void* pMaster, SERVO::CEquipment* pEquipment, const std::vector<CParam>& params) {
+		(void)pMaster;
+		const int eqId = pEquipment ? pEquipment->getID() : 0;
+		if (eqId != EQ_ID_Bonder1 && eqId != EQ_ID_Bonder2) return;
+
+		auto formatVal = [](const CParam& p) {
+			std::ostringstream oss;
+			oss.setf(std::ios::fixed);
+			oss << std::setprecision(4) << p.getDoubleValue();
+			return oss.str();
+		};
+
+		static const int vidMap[] = {
+			6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,
+			6111,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121
+		};
+		const size_t count = (std::min)(params.size(), sizeof(vidMap) / sizeof(vidMap[0]));
+		m_hsmsPassive.withVariableLock([&] {
+			m_hsmsPassive.setVariableValue("Clock", CToolUnits::getCurrentTimeString().c_str());
+			for (size_t idx = 0; idx < count; ++idx) {
+				auto& p = params[idx];
+				std::string val = formatVal(p);
+				m_hsmsPassive.setVariableValue(std::to_string(vidMap[idx]).c_str(), val.c_str());
+			}
+			m_hsmsPassive.requestEventReportSend("BonderProcessData");
+		});
+	};
 	masterListener.onCTRoundEnd = [&](void* pMaster, int round) {
 		m_configuration.setContinuousTransferCount(round);
 	};
diff --git a/SourceCode/Bond/x64/Debug/CollectionEventList.txt b/SourceCode/Bond/x64/Debug/CollectionEventList.txt
index c8c031f..81db963 100644
--- a/SourceCode/Bond/x64/Debug/CollectionEventList.txt
+++ b/SourceCode/Bond/x64/Debug/CollectionEventList.txt
@@ -57,6 +57,8 @@
 50011,OCR_PanelID_Read_OK,鎵爜浜嬩欢涓婃姤,(50012)
 50012,Port_Ready_To_Release,,(50013)
 50020,PortStateChange,,(50020)
+60000,BonderSVData,,(60000)
+61000,BonderProcessData,,(61000)
 12000,UnitStart,,(12000)
 12001,UnitStateChange,,(12001)
 12002,UnitEnd,,(12002)
diff --git a/SourceCode/Bond/x64/Debug/ReportList.txt b/SourceCode/Bond/x64/Debug/ReportList.txt
index cfc1f94..c8f5089 100644
--- a/SourceCode/Bond/x64/Debug/ReportList.txt
+++ b/SourceCode/Bond/x64/Debug/ReportList.txt
@@ -32,6 +32,8 @@
 50013,(5015)
 50014,(5016)
 50020,(500,5020,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)
 10015,(5018,5019)
 10016,(5018,5019)
 10017,(500,5018)
diff --git a/SourceCode/Bond/x64/Debug/VariableList.txt b/SourceCode/Bond/x64/Debug/VariableList.txt
index 2381563..932b7dd 100644
--- a/SourceCode/Bond/x64/Debug/VariableList.txt
+++ b/SourceCode/Bond/x64/Debug/VariableList.txt
@@ -54,6 +54,49 @@
 5017,ProcessDataReportText,A50,EV_PROCESS_DATA_REPORT payload string (placeholder)
 5018,SubEqpName,A20,Equipment name for EV_SubEqpStart/EV_SubEqpEnd
 5019,SubEqpSlot,U1,Slot number for EV_SubEqpStart/EV_SubEqpEnd
+5020,PortStateChangePortId,U1,"Port ID for PortStateChange"
+5021,PortState,U1,"Port transfer/state code for PortStateChange"
+6000,Bonder_SV_ProcessStep,A20,Bonder SV
+6001,Bonder_SV_BladderPressure,A20,Bonder SV
+6002,Bonder_SV_UpperChamberPressure,A20,Bonder SV
+6003,Bonder_SV_PipeVacuumGauge,A20,Bonder SV
+6004,Bonder_SV_ChamberVacuumGauge,A20,Bonder SV
+6005,Bonder_SV_UpperTemp1,A20,Bonder SV
+6006,Bonder_SV_UpperTemp2,A20,Bonder SV
+6007,Bonder_SV_UpperTemp3,A20,Bonder SV
+6008,Bonder_SV_UpperTemp4,A20,Bonder SV
+6009,Bonder_SV_UpperTemp5,A20,Bonder SV
+6010,Bonder_SV_UpperTemp6,A20,Bonder SV
+6011,Bonder_SV_LowerTemp1,A20,Bonder SV
+6012,Bonder_SV_LowerTemp2,A20,Bonder SV
+6013,Bonder_SV_LowerTemp3,A20,Bonder SV
+6014,Bonder_SV_LowerTemp4,A20,Bonder SV
+6015,Bonder_SV_LowerTemp5,A20,Bonder SV
+6016,Bonder_SV_LowerTemp6,A20,Bonder SV
+6017,Bonder_SV_HeatingRemaining,A20,Bonder SV
+6018,Bonder_SV_PressingRemaining,A20,Bonder SV
+6100,Bonder_PD_AlignDelay,A20,Bonder ProcessData
+6101,Bonder_PD_DwellTime,A20,Bonder ProcessData
+6102,Bonder_PD_BreakVacuumDelay,A20,Bonder ProcessData
+6103,Bonder_PD_TurboPumpStartDelay,A20,Bonder ProcessData
+6104,Bonder_PD_AttachVacuumDelay,A20,Bonder ProcessData
+6105,Bonder_PD_HeatingWaitDelay,A20,Bonder ProcessData
+6106,Bonder_PD_BladderPressureSet,A20,Bonder ProcessData
+6107,Bonder_PD_BladderPressurizeRate,A20,Bonder ProcessData
+6108,Bonder_PD_BladderDepressurizeRate,A20,Bonder ProcessData
+6109,Bonder_PD_AttachPressureLimit,A20,Bonder ProcessData
+6110,Bonder_PD_UpperZTorqueSpeed,A20,Bonder ProcessData
+6111,Bonder_PD_UpperTempSet,A20,Bonder ProcessData
+6112,Bonder_PD_LowerTempSet,A20,Bonder ProcessData
+6113,Bonder_PD_PreAttachSpeed,A20,Bonder ProcessData
+6114,Bonder_PD_AttachSpeed,A20,Bonder ProcessData
+6115,Bonder_PD_UpperHeatDistance,A20,Bonder ProcessData
+6116,Bonder_PD_AttachPressIn,A20,Bonder ProcessData
+6117,Bonder_PD_UpperBreakVacuumDist,A20,Bonder ProcessData
+6118,Bonder_PD_LowerPinBreakVacuumDist,A20,Bonder ProcessData
+6119,Bonder_PD_LowerPinHeatDistance,A20,Bonder ProcessData
+6120,Bonder_PD_PumpGaugeSet,A20,Bonder ProcessData
+6121,Bonder_PD_TurboReachSet,A20,Bonder ProcessData
 10200,SlotMap,U2,SlotMap(Scan)
 10201,SlotMapScan,U2,SlotMap(Scan)
 10202,SlotMapDownload,U2,SlotMap(Download)

--
Gitblit v1.9.3