CSMachineDlg.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #pragma once
  2. #include "DiosSMachineV3.h"
  3. #define SM_isDisplayCall 0
  4. // CSMachineDlg 对话框
  5. //namespace DIOS::Dev::Detail::SMachine
  6. //{
  7. class CSMachineDlg : public CDiosBasicDlg
  8. {
  9. DECLARE_DYNAMIC(CSMachineDlg)
  10. public:
  11. CSMachineDlg(CWnd* pParent = nullptr); // 标准构造函数
  12. ~CSMachineDlg();
  13. void SetMagMap() override; //设置消息对照表
  14. void InitPageElements(bool act) override;
  15. void ShowPageElements(bool init = FALSE, bool exit = FALSE, bool cfg = FALSE,
  16. bool general = FALSE);
  17. bool CreatMode(bool act) override; //初始化设备模块
  18. // 对话框数据
  19. #ifdef AFX_DESIGN_TIME
  20. enum { IDD = IDD_DIALOG4 };
  21. #endif
  22. protected:
  23. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
  24. bool AppInitial(bool act); //初始化模块
  25. bool InitLog(); //初始化日志模块
  26. void ExitLog();
  27. // 生成的消息映射函数
  28. virtual BOOL OnInitDialog();
  29. //类属性
  30. //SMachine
  31. string m_strWorkflowFile{ "" };
  32. string m_strSetSMName{ "" };
  33. string m_strDeviceUID{ "" };
  34. string m_strWS{ "" };
  35. string m_strTriggerEvent{ "" };
  36. string m_strError{ "" };
  37. string m_strGetSMName{ "" };
  38. string m_strCurrentState{ "" };
  39. bool m_bRunMode{ true };
  40. bool m_bDebugMode{ false };
  41. public:
  42. //按钮
  43. afx_msg void OnBnClickedButton3();//选择配置
  44. afx_msg void OnBnClickedButton1();//初始化
  45. afx_msg void OnBnClickedButton2();//退出
  46. afx_msg void OnBnClickedButton4();//LoadMachine
  47. afx_msg void OnBnClickedButton5();//SetMSName
  48. afx_msg void OnBnClickedButton6();//AddDevices
  49. afx_msg void OnBnClickedButton7();//InitPreState
  50. afx_msg void OnBnClickedButton8();//StartSM
  51. afx_msg void OnBnClickedButton9();//StopSM
  52. afx_msg void OnBnClickedButton10();//TriggerEvent
  53. afx_msg void OnBnClickedButton11();//GetSMError
  54. afx_msg void OnBnClickedButton12();//GetSMName
  55. afx_msg void OnBnClickedButton13();//GoToState
  56. afx_msg void OnBnClickedButton14();//RunMode?
  57. afx_msg void OnBnClickedButton15();//DebugMode?
  58. DECLARE_MESSAGE_MAP()
  59. public:
  60. #if SM_isDisplayCall
  61. inline bool CheckHasFunInMap(const char* name);
  62. #endif
  63. static DWORD WaitforStateNotify(LPVOID pParam); //循环线程
  64. #if SM_isDisplayCall
  65. map<string, void*> m_SMFunMap; //状态机接口映射
  66. DiosSMachine* m_ptrSMachine{ nullptr };
  67. #else
  68. DiosSMachine* m_ptrSMachine{ nullptr };
  69. #endif
  70. HANDLE m_hNotifyThread{ NULL }; //状态更新线程句柄
  71. HANDLE m_hStateFinishFlag{ NULL }; //状态更新结束句柄
  72. HANDLE m_hStateExitFlag{ NULL }; //状态更新线程退出句柄
  73. };
  74. //}