From 3896bd8be7e7db15e5e1b9f3c07469ad614c8a74 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期五, 19 九月 2025 17:01:33 +0800
Subject: [PATCH] 1.结批处理; 2.Process Job修复未绑定context的问题;

---
 SourceCode/Bond/Servo/CMaster.cpp |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/SourceCode/Bond/Servo/CMaster.cpp b/SourceCode/Bond/Servo/CMaster.cpp
index 5572e53..ac0a419 100644
--- a/SourceCode/Bond/Servo/CMaster.cpp
+++ b/SourceCode/Bond/Servo/CMaster.cpp
@@ -2409,8 +2409,31 @@
 				temp.push_back(p);
 			}
 		}
-
 		m_processJobs = temp;
+
+
+		// 更新context
+		std::vector<uint8_t> newSlots;
+		std::vector<void*> newContexts;
+		for (auto pj : m_processJobs) {
+			for (auto& c : pj->carriers()) {
+				auto pPort = getPortWithCarrierId(c.carrierId);
+				if (pPort == nullptr) continue;
+
+				for (auto s : c.slots) {
+					auto pGlass = pPort->getGlassFromSlot(s);
+					if (pGlass == nullptr) continue;
+
+					newSlots.push_back(s);
+					newContexts.push_back(pGlass);
+				}
+
+				pj->setCarrierSlotsAndContexts(c.carrierId, newSlots, newContexts);
+			}
+		}
+
+
+
 		this->saveState();
 
 		return (int)m_processJobs.size();

--
Gitblit v1.9.3