From 334b16b4abb4cbe3d1d4e4f211efd6f4468ae09f Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期五, 19 九月 2025 15:12:52 +0800
Subject: [PATCH] 1.ControlJob和ProcessJob的中断操作,强制结批增加字符串描述原因,方便生产跟踪。
---
SourceCode/Bond/Servo/CMaster.h | 40 ++++++++++++++++++++++++++++++++++++++--
1 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/SourceCode/Bond/Servo/CMaster.h b/SourceCode/Bond/Servo/CMaster.h
index 8187fc3..6a17fb1 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;
@@ -53,6 +58,7 @@
typedef std::function<void(void* pMaster, CRobotTask* pTask, int code)> ONROBOTTASKEVENT;
typedef std::function<void(void* pMaster, CEquipment* pEquipment, short status, __int64 data)> ONLOADPORTSTATUSCHANGED;
typedef std::function<void(void* pMaster, int round)> ONCTROUNDEND;
+ typedef std::function<void(void* pMaster, void* pj)> ONPJSTART;
typedef struct _MasterListener
{
ONMASTERSTATECHANGED onMasterStateChanged;
@@ -64,6 +70,12 @@
ONROBOTTASKEVENT onRobotTaskEvent;
ONLOADPORTSTATUSCHANGED onLoadPortStatusChanged;
ONCTROUNDEND onCTRoundEnd;
+ ONPJSTART onCjStart;
+ ONPJSTART onCjEnd;
+ ONPJSTART onPjStart;
+ ONPJSTART onPjEnd;
+ ONPJSTART onPanelStart;
+ ONPJSTART onPanelEnd;
} MasterListener;
class CMaster : public IResourceView
@@ -81,7 +93,7 @@
int start();
int startContinuousTransfer();
int startBatch();
- int stop();
+ int stop(int nErCode = ER_CODE_NOERROR);
void clearError();
ULONGLONG getRunTime();
MASTERSTATE getState();
@@ -117,6 +129,12 @@
CLoadPort* getPortWithCarrierId(const std::string& carrierId) const;
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); }
@@ -157,6 +175,10 @@
bool ceidDefined(uint32_t ceid) const override;
public:
+ int getLastError();
+ std::string& getLastErrorText();
+
+ public:
// 新增函数
CProcessJob* acquireNextProcessJob();
CGlass* acquireNextGlass();
@@ -164,6 +186,14 @@
bool addGlassToQueue(CGlass* pGlass);
bool glassFromQueueToInPorcess(CGlass* pGlass);
bool glassFromInPorcessToComplete(CGlass* pGlass);
+ bool processJobFromInPorcessToComplete(CProcessJob* pProcessJob);
+ bool checkAndUpdatePjComplete(CProcessJob* pJob);
+ bool checkAndUpdateCjComplete(CControlJob* pJob);
+ CProcessJob* getGlassProcessJob(CGlass* pGlass);
+ bool completeControlJob(std::string description);
+ bool canCreateControlJob();
+ bool canCompleteControlJob();
+ bool canDeleteControlJob();
private:
CRITICAL_SECTION m_criticalSection;
@@ -208,9 +238,12 @@
// 千传圈数计数
int m_nContinuousTransferCount;
int m_nContinuousTransferStep;
+ int m_nContinuousWorkingPort;
+ int m_nContinuousWorkingSlot;
// 新增已经开始处理的ProcessJob列表
std::vector<CProcessJob*> m_inProcesJobs;
+ std::vector<CProcessJob*> m_completeProcessJobs;
std::vector<CGlass*> m_queueGlasses;
std::vector<CGlass*> m_inProcesGlasses;
std::vector<CGlass*> m_completeGlasses;
@@ -221,6 +254,9 @@
SERVO::CControlJob* m_pControlJob;
std::vector<SERVO::CProcessJob*> m_processJobs;
std::string m_strStatePath;
+
+ int m_nTestFlag;
+ std::list<CGlass*> m_bufGlass;
};
}
--
Gitblit v1.9.3