From f6a5e27c91e635ad59d2fd45a52d56c085c7d066 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期二, 26 八月 2025 12:37:22 +0800
Subject: [PATCH] 1.顶部工具条增加按钮"批运行",用于ControlJob模式调度的运行; 2.CMaster增加startBatch,启动批运动模式; 3.CMaster在兼容原单片Glass调试的情况下,增加startBatch调度,开始实现调度功能。

---
 SourceCode/Bond/Servo/CMaster.h |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/SourceCode/Bond/Servo/CMaster.h b/SourceCode/Bond/Servo/CMaster.h
index 41d4fb0..8187fc3 100644
--- a/SourceCode/Bond/Servo/CMaster.h
+++ b/SourceCode/Bond/Servo/CMaster.h
@@ -39,6 +39,7 @@
         STARTING,
         RUNNING,
         RUNNING_CONTINUOUS_TRANSFER,
+        RUNNING_BATCH,
         STOPPING,
         MSERROR
     };
@@ -79,6 +80,7 @@
         int term();
         int start();
         int startContinuousTransfer();
+        int startBatch();
         int stop();
         void clearError();
         ULONGLONG getRunTime();
@@ -154,6 +156,15 @@
         bool slotUsable(const std::string& carrierId, uint16_t slot) const override;
         bool ceidDefined(uint32_t ceid) const override;
 
+    public:
+        // 新增函数
+        CProcessJob* acquireNextProcessJob();
+        CGlass* acquireNextGlass();
+        int acquireGlassToQueue();
+        bool addGlassToQueue(CGlass* pGlass);
+        bool glassFromQueueToInPorcess(CGlass* pGlass);
+        bool glassFromInPorcessToComplete(CGlass* pGlass);
+
     private:
         CRITICAL_SECTION m_criticalSection;
         MasterListener m_listener;
@@ -162,6 +173,7 @@
         std::string m_strFilepath;
         BOOL m_bDataModify;
         bool m_bContinuousTransfer;
+        bool m_bBatch;
 
     private:
         /* 监控比特位的线程*/
@@ -197,6 +209,12 @@
         int m_nContinuousTransferCount;
         int m_nContinuousTransferStep;
 
+        // 新增已经开始处理的ProcessJob列表
+        std::vector<CProcessJob*> m_inProcesJobs;
+        std::vector<CGlass*> m_queueGlasses;
+        std::vector<CGlass*> m_inProcesGlasses;
+        std::vector<CGlass*> m_completeGlasses;
+
     private:
         bool m_bEnableEventReport;
         bool m_bEnableAlarmReport;

--
Gitblit v1.9.3