From 29f9008039e21f377d968ee67cb26d3cf8363809 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期四, 11 九月 2025 15:37:54 +0800
Subject: [PATCH] 1.修复数据库类联G1和Buddy的问题;

---
 SourceCode/Bond/Servo/Model.cpp |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/SourceCode/Bond/Servo/Model.cpp b/SourceCode/Bond/Servo/Model.cpp
index 47ea454..b9c5505 100644
--- a/SourceCode/Bond/Servo/Model.cpp
+++ b/SourceCode/Bond/Servo/Model.cpp
@@ -428,13 +428,19 @@
 		m_hsmsPassive.setVariableValue("PJEndID", ((SERVO::CProcessJob*)pj)->id().c_str());
 		m_hsmsPassive.requestEventReportSend_PJ_End();
 	};
-	masterListener.onPanelStart = [&](void* pMaster, void* pj) {
-		m_hsmsPassive.setVariableValue("PanelStartID", ((SERVO::CGlass*)pj)->getID().c_str());
+	masterListener.onPanelStart = [&](void* pMaster, void* pPanel) {
+		m_hsmsPassive.setVariableValue("PanelStartID", ((SERVO::CGlass*)pPanel)->getID().c_str());
 		m_hsmsPassive.requestEventReportSend_Panel_Start();
 	};
-	masterListener.onPanelEnd = [&](void* pMaster, void* pj) {
-		m_hsmsPassive.setVariableValue("PanelEndID", ((SERVO::CGlass*)pj)->getID().c_str());
+	masterListener.onPanelEnd = [&](void* pMaster, void* pPanel) {
+		m_hsmsPassive.setVariableValue("PanelEndID", ((SERVO::CGlass*)pPanel)->getID().c_str());
 		m_hsmsPassive.requestEventReportSend_Panel_End();
+		auto& db = GlassLogDb::Instance();
+		db.insertFromCGlass((*(SERVO::CGlass*)pPanel));
+		SERVO::CGlass* pBuddy = ((SERVO::CGlass*)pPanel)->getBuddy();
+		if (pBuddy != nullptr) {
+			db.insertFromCGlass(*pBuddy);
+		}
 	};
 	m_master.setListener(masterListener);
 	m_master.setContinuousTransferCount(m_configuration.getContinuousTransferCount());

--
Gitblit v1.9.3