From 22f2984276ff75433ebeab877c96b48905826e6c Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期五, 06 二月 2026 16:51:25 +0800
Subject: [PATCH] 1.Slot防护

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

diff --git a/SourceCode/Bond/Servo/CCjPage2.cpp b/SourceCode/Bond/Servo/CCjPage2.cpp
index 0a1bf21..29eea6a 100644
--- a/SourceCode/Bond/Servo/CCjPage2.cpp
+++ b/SourceCode/Bond/Servo/CCjPage2.cpp
@@ -490,6 +490,15 @@
     short jobExistence[12] = { 0 };
     short slotProcess = 0;
     BuildCassetteCtrlMaps(port, jobExistence, slotProcess);
+    bool hasExistence = false;
+    for (short w : jobExistence) {
+        if (w != 0) { hasExistence = true; break; }
+    }
+    if (!hasExistence) {
+        LOGE("ProcessStart blocked (P1): no JobExistence map (portStatus=%d, scanMap=%d).",
+            port->getPortStatus(), port->getScanCassetteMap());
+        return;
+    }
     port->sendCassetteCtrlCmd(CCC_PROCESS_START, jobExistence, 12, slotProcess, 0, nullptr, nullptr);
 
 }
@@ -502,6 +511,15 @@
     short jobExistence[12] = { 0 };
     short slotProcess = 0;
     BuildCassetteCtrlMaps(port, jobExistence, slotProcess);
+    bool hasExistence = false;
+    for (short w : jobExistence) {
+        if (w != 0) { hasExistence = true; break; }
+    }
+    if (!hasExistence) {
+        LOGE("ProcessStart blocked (P2): no JobExistence map (portStatus=%d, scanMap=%d).",
+            port->getPortStatus(), port->getScanCassetteMap());
+        return;
+    }
     port->sendCassetteCtrlCmd(CCC_PROCESS_START, jobExistence, 12, slotProcess, 0, nullptr, nullptr);
 }
 
@@ -513,6 +531,15 @@
     short jobExistence[12] = { 0 };
     short slotProcess = 0;
     BuildCassetteCtrlMaps(port, jobExistence, slotProcess);
+    bool hasExistence = false;
+    for (short w : jobExistence) {
+        if (w != 0) { hasExistence = true; break; }
+    }
+    if (!hasExistence) {
+        LOGE("ProcessStart blocked (P3): no JobExistence map (portStatus=%d, scanMap=%d).",
+            port->getPortStatus(), port->getScanCassetteMap());
+        return;
+    }
     port->sendCassetteCtrlCmd(CCC_PROCESS_START, jobExistence, 12, slotProcess, 0, nullptr, nullptr);
 }
 
@@ -524,6 +551,15 @@
     short jobExistence[12] = { 0 };
     short slotProcess = 0;
     BuildCassetteCtrlMaps(port, jobExistence, slotProcess);
+    bool hasExistence = false;
+    for (short w : jobExistence) {
+        if (w != 0) { hasExistence = true; break; }
+    }
+    if (!hasExistence) {
+        LOGE("ProcessStart blocked (P4): no JobExistence map (portStatus=%d, scanMap=%d).",
+            port->getPortStatus(), port->getScanCassetteMap());
+        return;
+    }
     port->sendCassetteCtrlCmd(CCC_PROCESS_START, jobExistence, 12, slotProcess, 0, nullptr, nullptr);
 }
 

--
Gitblit v1.9.3