From 829fe6c6bc33d53fda9c31fd45a37e1df87befff Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期五, 30 一月 2026 11:16:24 +0800
Subject: [PATCH] Merge branch 'clh' into liuyang

---
 SourceCode/Bond/Servo/Model.cpp |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 53 insertions(+), 0 deletions(-)

diff --git a/SourceCode/Bond/Servo/Model.cpp b/SourceCode/Bond/Servo/Model.cpp
index b345e3d..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);
@@ -661,6 +682,30 @@
 				m_hsmsPassive.setVariableValue(recipeVid, recipe.c_str());
 			}
 			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) {
@@ -803,6 +848,10 @@
 		auto sendSv = [&](const auto& vidMap, const char* evName) {
 			const size_t count = (std::min)(params.size(), vidMap.size());
 			m_hsmsPassive.withVariableLock([&] {
+				if (pEquipment != nullptr) {
+					m_hsmsPassive.setVariableValue("SubEqpName", pEquipment->getName().c_str());
+				}
+				m_hsmsPassive.setVariableValue("SubEqpSlot", 0);
 				m_hsmsPassive.setVariableValue("Clock", CToolUnits::getCurrentTimeString().c_str());
 				for (size_t idx = 0; idx < count; ++idx) {
 					const std::string val = formatParamValue(params[idx]);
@@ -845,6 +894,10 @@
 		auto sendProcess = [&](const auto& vidMap, const char* evName) {
 			const size_t count = (std::min)(params.size(), vidMap.size());
 			m_hsmsPassive.withVariableLock([&] {
+				if (pEquipment != nullptr) {
+					m_hsmsPassive.setVariableValue("SubEqpName", pEquipment->getName().c_str());
+				}
+				m_hsmsPassive.setVariableValue("SubEqpSlot", 0);
 				m_hsmsPassive.setVariableValue("Clock", CToolUnits::getCurrentTimeString().c_str());
 				for (size_t idx = 0; idx < count; ++idx) {
 					const std::string val = formatParamValue(params[idx]);

--
Gitblit v1.9.3