DynamicTask.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. /**************************************************************************************************
  2. 版本所有(C), 2020-2022, 北京普达迪泰
  3. ***************************************************************************************************
  4. 文 件 名: DynamicTask.h
  5. 功能描述: 动态测量任务
  6. 版 本 号: 1.00初版
  7. 作 者: HYF
  8. 生成日期; 2021-12-20
  9. 最近修改:
  10. 函数列表:
  11. 修改历史:
  12. 1.日 期 : 2021-12-20
  13. 作 者 : HYF
  14. 修改内容 : 创建文件
  15. **************************************************************************************************/
  16. #pragma once
  17. // CDynamicTask 窗体视图
  18. #include "LABEL.H"
  19. #include <afxcmn.h> // MFC 对 Windows 公共控件的支持
  20. // CELL Border States
  21. #define TASK_STATUS_0 0
  22. #define TASK_STATUS_RUNNING 1
  23. #define TASK_STATUS_PAUSED 2
  24. class CDmsDoc;
  25. class OSGView;
  26. class DynamicTaskThread;
  27. class CDynamicTask : public CFormView
  28. {
  29. DECLARE_DYNCREATE(CDynamicTask)
  30. public:
  31. CDynamicTask(); // 动态创建所使用的受保护的构造函数
  32. virtual ~CDynamicTask();
  33. private :
  34. public:
  35. #ifdef AFX_DESIGN_TIME
  36. enum { IDD = IDD_VIEW_DYNAMIC_TASK };
  37. #endif
  38. #ifdef _DEBUG
  39. virtual void AssertValid() const;
  40. #ifndef _WIN32_WCE
  41. virtual void Dump(CDumpContext& dc) const;
  42. #endif
  43. #endif
  44. protected:
  45. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
  46. DECLARE_MESSAGE_MAP()
  47. public:
  48. // 背景
  49. CBrush m_BkBrush;
  50. // 标题
  51. CLabel m_Static_Title;
  52. // 开始测量
  53. CMFCButton m_Btn_Start;
  54. // 测量时间
  55. CLabel m_Static_MeasureTime;
  56. CString m_szTimeCost;
  57. int m_iEclapsed;
  58. // 偏移量
  59. CLabel m_Static_Angle_A_Label;
  60. CLabel m_Static_Angle_AX;
  61. CLabel m_Static_Angle_AY;
  62. CLabel m_Static_Angle_AZ;
  63. CString m_szAngleAX;
  64. CString m_szAngleAY;
  65. CString m_szAngleAZ;
  66. // 调校量
  67. CLabel m_Static_Angle_E_Label;
  68. CLabel m_Static_Angle_EX;
  69. CLabel m_Static_Angle_EY;
  70. CLabel m_Static_Angle_EZ;
  71. CString m_szAngleEX;
  72. CString m_szAngleEY;
  73. CString m_szAngleEZ;
  74. // 推力线
  75. CLabel m_Static_Thrust_Label;
  76. CLabel m_Static_Line_Start;
  77. CLabel m_Static_Line_End;
  78. CString m_szLineStart;
  79. CString m_szLineEnd;
  80. // 结果比对
  81. CMFCButton m_Btn_Compare;
  82. // 导出报告
  83. CMFCButton m_Btn_Report;
  84. // 新增部位:分机1、分机2......
  85. CLabel m_Static_AddPlace;
  86. // 部位
  87. CComboBox m_Combo_EquipPlace;
  88. // 类型编码Label
  89. CLabel m_Static_EquipTypeCode;
  90. // 设备编码Label
  91. CLabel m_Static_EquipCode;
  92. // 中止测量
  93. CMFCButton m_BtnStop;
  94. // 测量时间间隔LABEL
  95. CLabel m_Static_Label_TimeSpan;
  96. CLabel m_Static_Label_Second;
  97. // 测量时间频率选择
  98. CComboBox m_Combox_Frequency;
  99. //
  100. BOOL m_bStopClicked;
  101. private:
  102. // 文档对象指针
  103. CDmsDoc *m_pDoc;
  104. // 任务ID
  105. DWORD m_taskId;
  106. // 设备型号
  107. CString m_szEquipTypeCode;
  108. // 设备编号
  109. CString m_szEquipCode;
  110. // 当前选中分机索引
  111. int m_idxEquipPlace;
  112. // 任务状态
  113. int m_iTaskStatus;
  114. // 是否有执行测量
  115. BOOL m_bExecuted;
  116. protected:
  117. // OSG View
  118. OSGView* m_pOSGView;
  119. public:
  120. // 初始化UI数据
  121. void InitFormData(DWORD taskId);
  122. // 重置UI状态
  123. void ResetFormData();
  124. // 显示UI栏位
  125. void ShowTaskFieldStatus();
  126. // 初始化任务信息
  127. void InitTaskInfo();
  128. // 初始化设备部位列表
  129. void InitEquipPlaceList();
  130. virtual void OnInitialUpdate();
  131. virtual void OnUpdate(CView* /*pSender*/, LPARAM /*lHint*/, CObject* /*pHint*/);
  132. public:
  133. BOOL IsModelExist(LPCTSTR szEquipTypeCode, CStringArray& arrModel);
  134. BOOL FetchDynamicTaskData(LPCTSTR szEquipPlace);
  135. BOOL ShowDynamicTaskData(LPCTSTR szEquipPlace);
  136. public:
  137. afx_msg void OnBnClickedBtnStartTask();
  138. afx_msg void OnBnClickedBtnCompareResult();
  139. afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
  140. afx_msg void OnTimer(UINT_PTR nIDEvent);
  141. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  142. afx_msg void OnBnClickedBtnOutputReport();
  143. afx_msg void OnSize(UINT nType, int cx, int cy);
  144. afx_msg void OnDestroy();
  145. afx_msg void OnBnClickedBtnBack();
  146. afx_msg void OnStnClickedStaticAddPlace();
  147. afx_msg LRESULT OnMeasureSuccess(WPARAM wp, LPARAM lp);
  148. afx_msg LRESULT OnMeasureFailure(WPARAM wp, LPARAM lp);
  149. afx_msg LRESULT OnMeasureComplete(WPARAM wp, LPARAM lp);
  150. afx_msg LRESULT OnReStartIDPMS(WPARAM wp, LPARAM lp);
  151. afx_msg void OnBnClickedBtnPause();
  152. afx_msg void OnCbnSelchangeComboTimespan();
  153. afx_msg void OnBnClickedBtnCamConfig();
  154. afx_msg void OnCbnSelchangeEquipPlace();
  155. afx_msg void OnBnClickedBtnFinish();
  156. CMFCButton m_Btn_Finish;
  157. };