CEventBase.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #pragma once
  2. #include "CStepBase.h"
  3. #include "Machine.h"
  4. //#define FSM_TEST 1 //状态机测试
  5. #define FSM_NOT_EXECUTE 0xFFFF
  6. #define BOND_TABLE_ID 1 //固晶台Id号,当前机台只有一个固晶台
  7. #ifdef FSM_TEST
  8. typedef struct _BOND_PT_TEST
  9. {
  10. UINT id;
  11. ATTRIBUTE att;
  12. bool status;
  13. _BOND_PT_TEST(UINT id, ATTRIBUTE att, bool status)
  14. {
  15. this->id = id;
  16. this->att = att;
  17. this->status = status;
  18. }
  19. }BOND_PT_TEST;
  20. #define MAX_TEST_PT 6
  21. #endif
  22. class __declspec(dllexport) CEventBase
  23. {
  24. private:
  25. static bool m_bStopStepExecute; //自动过程中某一步聚出错,退出其它状态机执行Step
  26. #ifdef FSM_TEST
  27. protected:
  28. std::default_random_engine e;
  29. void sleep_();
  30. void sleep_(int iTimerMin, int iTimerMax);
  31. virtual LONG ActionTest();
  32. static BOND_PT_TEST TestPt[MAX_TEST_PT];
  33. BOND_PT_TEST GetTestPt(UINT id);
  34. void SetStatus(UINT id, bool status);
  35. void ClearStatus(ATTRIBUTE att);
  36. #endif
  37. protected:
  38. bool m_bIsInitSuccess;
  39. Machine* m_pMachine;
  40. CStaticStepData* m_pStepPublicData; //保存Step运行过程中的数据操作
  41. virtual LONG Action() = 0;
  42. //停止Stop时的例外,用于自动固晶出错后的收尾事件CEventAutoBondDone
  43. virtual bool StopStepException();
  44. CEventBase();
  45. public:
  46. //设置(获取)是否停止所有Step执行标志
  47. static void SetStopStepExecute(bool b);
  48. static bool GetStopStepExecute();
  49. virtual LONG EventRun(string sStepDescribe, string m_chClass, string m_chState, string step);
  50. };