From c3aa662297c2182de2e7a53d7bf63f4ab6b1adbd Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期一, 15 九月 2025 17:29:22 +0800
Subject: [PATCH] 1.千传调度调整,修改为物料从哪个Port, 那个Slot搬出就最终终回哪个位置 ;

---
 SourceCode/Bond/Servo/CMaster.h |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/SourceCode/Bond/Servo/CMaster.h b/SourceCode/Bond/Servo/CMaster.h
index e79589d..fa3f6b3 100644
--- a/SourceCode/Bond/Servo/CMaster.h
+++ b/SourceCode/Bond/Servo/CMaster.h
@@ -33,6 +33,10 @@
 #define CTStep_begin                    CTStep_LoadPort_Aligner
 #define CTStep_end                      CTStep_Measurement_LoadPort
 
+#define ER_CODE_NOERROR                0
+#define ER_CODE_OPERATION_MODE_FAIL    -1
+#define ER_CODE_AOI_NG                 -2
+
 namespace SERVO {
     enum class MASTERSTATE {
         READY = 0,
@@ -41,7 +45,8 @@
         RUNNING_CONTINUOUS_TRANSFER,
         RUNNING_BATCH,
         STOPPING,
-        MSERROR
+        MSERROR,
+        ATHERERROR
     };
 
     typedef std::function<void(void* pMaster, MASTERSTATE state)> ONMASTERSTATECHANGED;
@@ -88,7 +93,7 @@
         int start();
         int startContinuousTransfer();
         int startBatch();
-        int stop();
+        int stop(int nErCode = ER_CODE_NOERROR);
         void clearError();
         ULONGLONG getRunTime();
         MASTERSTATE getState();
@@ -125,6 +130,11 @@
         bool saveState() const;
         bool loadState(const std::string& path);
         int getWipGlasses(std::vector<CGlass*>& glasses);
+        void test();
+        bool moveGlassToBuf(int eqid, int slotNo);
+        bool moveGlassToSlot(int eqid, int slotNo);
+        int getPortCassetteSnSeed(int port);
+        void setPortCassetteSnSeed(int port, int seed);
 
     private:
         inline void lock() { EnterCriticalSection(&m_criticalSection); }
@@ -163,6 +173,10 @@
         bool carrierPresent(const std::string& carrierId) const override;
         bool slotUsable(const std::string& carrierId, uint16_t slot) const override;
         bool ceidDefined(uint32_t ceid) const override;
+
+    public:
+        int getLastError();
+        std::string& getLastErrorText();
 
     public:
         // 新增函数
@@ -221,6 +235,8 @@
         // 千传圈数计数
         int m_nContinuousTransferCount;
         int m_nContinuousTransferStep;
+        int m_nContinuousWorkingPort;
+        int m_nContinuousWorkingSlot;
 
         // 新增已经开始处理的ProcessJob列表
         std::vector<CProcessJob*> m_inProcesJobs;
@@ -237,6 +253,7 @@
         std::string m_strStatePath;
 
         int m_nTestFlag;
+        std::list<CGlass*> m_bufGlass;
     };
 }
 

--
Gitblit v1.9.3