#pragma once #include "CStepBase.h" #include "Machine.h" //#define FSM_TEST 1 //状态机测试 #define FSM_NOT_EXECUTE 0xFFFF #define BOND_TABLE_ID 1 //固晶台Id号,当前机台只有一个固晶台 #ifdef FSM_TEST typedef struct _BOND_PT_TEST { UINT id; ATTRIBUTE att; bool status; _BOND_PT_TEST(UINT id, ATTRIBUTE att, bool status) { this->id = id; this->att = att; this->status = status; } }BOND_PT_TEST; #define MAX_TEST_PT 6 #endif class __declspec(dllexport) CEventBase { private: static bool m_bStopStepExecute; //自动过程中某一步聚出错,退出其它状态机执行Step #ifdef FSM_TEST protected: std::default_random_engine e; void sleep_(); void sleep_(int iTimerMin, int iTimerMax); virtual LONG ActionTest(); static BOND_PT_TEST TestPt[MAX_TEST_PT]; BOND_PT_TEST GetTestPt(UINT id); void SetStatus(UINT id, bool status); void ClearStatus(ATTRIBUTE att); #endif protected: bool m_bIsInitSuccess; Machine* m_pMachine; CStaticStepData* m_pStepPublicData; //保存Step运行过程中的数据操作 virtual LONG Action() = 0; //停止Stop时的例外,用于自动固晶出错后的收尾事件CEventAutoBondDone virtual bool StopStepException(); CEventBase(); public: //设置(获取)是否停止所有Step执行标志 static void SetStopStepExecute(bool b); static bool GetStopStepExecute(); virtual LONG EventRun(string sStepDescribe, string m_chClass, string m_chState, string step); };