From bc7f1c4e028e69be51079b59dae4ae5c4d43f5bb Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期六, 31 一月 2026 21:54:56 +0800
Subject: [PATCH] 1.状态指示图,目前灰色表示掉线,绿色表示在线。增加Slot的小点表示有没有料,及加工状态 。 2.增加图示

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

diff --git a/SourceCode/Bond/Servo/CMaster.cpp b/SourceCode/Bond/Servo/CMaster.cpp
index d603e0d..d9fb326 100644
--- a/SourceCode/Bond/Servo/CMaster.cpp
+++ b/SourceCode/Bond/Servo/CMaster.cpp
@@ -2907,7 +2907,40 @@
 
 		static int pid[] = { EQ_ID_LOADPORT1, EQ_ID_LOADPORT2, EQ_ID_LOADPORT3, EQ_ID_LOADPORT4};
 		CLoadPort* pPort = (CLoadPort*)getEquipment(pid[port]);
-		pPort->sendCassetteCtrlCmd(CCC_PROCESS_START, nullptr, 0, 0, 0, nullptr, nullptr);
+		if (pPort == nullptr) return -1;
+
+		short jobExistence[12] = { 0 };
+		short slotProcess = 0;
+		short jobCount = 0; // 0 = Process All Glass
+		bool anyScheduled = false;
+
+		// Prefer hardware scan map for job existence (first 16 slots).
+		const short scanMap = pPort->getScanCassetteMap();
+		if (scanMap != 0) {
+			jobExistence[0] = scanMap;
+		}
+
+		const int maxSlots = 12 * 16;
+		const int totalSlots = (SLOT_MAX < maxSlots) ? SLOT_MAX : maxSlots;
+		for (int slot = 1; slot <= totalSlots; ++slot) {
+			CGlass* pGlass = pPort->getGlassFromSlot(slot);
+			if (pGlass == nullptr) continue;
+
+			const int wordIndex = (slot - 1) / 16;
+			const int bitIndex = (slot - 1) % 16;
+			jobExistence[wordIndex] = (short)(jobExistence[wordIndex] | (1 << bitIndex));
+
+			if (slot <= 16 && pGlass->isScheduledForProcessing()) {
+				slotProcess = (short)(slotProcess | (1 << bitIndex));
+				anyScheduled = true;
+			}
+		}
+
+		if (!anyScheduled) {
+			slotProcess = jobExistence[0];
+		}
+
+		pPort->sendCassetteCtrlCmd(CCC_PROCESS_START, jobExistence, 12, slotProcess, jobCount, nullptr, nullptr);
 		return 0;
 	}
 

--
Gitblit v1.9.3