| | |
| | | #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, |
| | |
| | | RUNNING_CONTINUOUS_TRANSFER, |
| | | RUNNING_BATCH, |
| | | STOPPING, |
| | | MSERROR |
| | | MSERROR, |
| | | ATHERERROR |
| | | }; |
| | | |
| | | typedef std::function<void(void* pMaster, MASTERSTATE state)> ONMASTERSTATECHANGED; |
| | |
| | | ONROBOTTASKEVENT onRobotTaskEvent; |
| | | ONLOADPORTSTATUSCHANGED onLoadPortStatusChanged; |
| | | ONCTROUNDEND onCTRoundEnd; |
| | | ONPJSTART onCjStart; |
| | | ONPJSTART onCjEnd; |
| | | ONPJSTART onPjStart; |
| | | ONPJSTART onPjEnd; |
| | | ONPJSTART onPanelStart; |
| | | ONPJSTART onPanelEnd; |
| | | } MasterListener; |
| | | |
| | | class CMaster : public IResourceView |
| | |
| | | int start(); |
| | | int startContinuousTransfer(); |
| | | int startBatch(); |
| | | int stop(); |
| | | int stop(int nErCode = ER_CODE_NOERROR); |
| | | void clearError(); |
| | | ULONGLONG getRunTime(); |
| | | MASTERSTATE getState(); |
| | |
| | | CControlJob* getControlJob(); |
| | | CLoadPort* getPortWithCarrierId(const std::string& carrierId) const; |
| | | bool saveState() const; |
| | | bool loadState(const std::string& path); |
| | | bool loadState(); |
| | | void setStateFile(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); |
| | | CGlass* getGlass(int scrPort, int scrSlot); |
| | | |
| | | private: |
| | | inline void lock() { EnterCriticalSection(&m_criticalSection); } |
| | |
| | | bool ceidDefined(uint32_t ceid) const override; |
| | | |
| | | public: |
| | | int getLastError(); |
| | | std::string& getLastErrorText(); |
| | | |
| | | public: |
| | | // 新增函数 |
| | | CProcessJob* acquireNextProcessJob(); |
| | | CGlass* acquireNextGlass(); |
| | |
| | | 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(); |
| | | bool forceCompleteControlJob(std::string description); |
| | | bool canCreateControlJob(); |
| | | bool canCompleteControlJob(); |
| | | bool canDeleteControlJob(); |
| | | |
| | | private: |
| | | CRITICAL_SECTION m_criticalSection; |
| | |
| | | // 千传圈数计数 |
| | | 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; |
| | |
| | | SERVO::CControlJob* m_pControlJob; |
| | | std::vector<SERVO::CProcessJob*> m_processJobs; |
| | | std::string m_strStatePath; |
| | | |
| | | int m_nTestFlag; |
| | | std::list<CGlass*> m_bufGlass; |
| | | }; |
| | | } |
| | | |