From 238f41fd4edac2febc03d2e428bce7206f609e99 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期四, 29 一月 2026 15:38:58 +0800
Subject: [PATCH] 1.完善CJ/PJ事件上报;

---
 SourceCode/Bond/Servo/CMaster.cpp |   29 ++++++++++++++++++++++-------
 1 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/SourceCode/Bond/Servo/CMaster.cpp b/SourceCode/Bond/Servo/CMaster.cpp
index f51c969..d603e0d 100644
--- a/SourceCode/Bond/Servo/CMaster.cpp
+++ b/SourceCode/Bond/Servo/CMaster.cpp
@@ -119,13 +119,6 @@
 			m_hEventDispatchThreadExit[1] = nullptr;
 		}
 
-		// 閲婃斁浜哄伐鎼嚭缂撳啿鍖洪噷鐨勭幓鐠�
-		for (auto* pGlass : m_bufGlass) {
-			if (pGlass != nullptr) {
-				pGlass->release();
-			}
-		}
-		m_bufGlass.clear();
 
 		DeleteCriticalSection(&m_criticalSection);
 	}
@@ -344,6 +337,13 @@
 		}
 		m_listEquipment.clear();
 
+		// release manual-remove buffer before glass pool is torn down
+		for (auto* pGlass : m_bufGlass) {
+			if (pGlass != nullptr) {
+				pGlass->release();
+			}
+		}
+		m_bufGlass.clear();
 
 		if (m_pCollector != nullptr) {
 			m_pCollector->stopLoop();
@@ -1930,6 +1930,16 @@
 				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);
+			}
+		};
+		listener.onEqStatusChanged = [&](void* pEquipment, int unitId, int status, int reason) {
+			if (m_listener.onEqStatusChanged != nullptr) {
+				m_listener.onEqStatusChanged(this, (CEquipment*)pEquipment, unitId, status, reason);
+			}
+		};
 		pEquipment->setListener(listener);
 		pEquipment->setCcLink(&m_cclink);
 		m_listEquipment.push_back(pEquipment);
@@ -3485,6 +3495,11 @@
 		}
 		m_pControlJob->abort(description);
 
+		// 鍏堜笂鎶ヤ竴娆$姸鎬佸彉鍖栵紙渚夸簬 PrJobAbort 瑙﹀彂锛�
+		if (m_listener.onControlJobChanged) {
+			notifyControlJobChanged();
+		}
+
 
 		// 閲婃斁Job鐩稿叧
 		for (auto item : m_processJobs) {

--
Gitblit v1.9.3