framework.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. #pragma once
  2. #ifndef VC_EXTRALEAN
  3. #define VC_EXTRALEAN // 从 Windows 头中排除极少使用的资料
  4. #endif
  5. #include "targetver.h"
  6. #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // 某些 CString 构造函数将是显式的
  7. // 关闭 MFC 的一些常见且经常可放心忽略的隐藏警告消息
  8. #define _AFX_ALL_WARNINGS
  9. #include <afx.h> // MFC基础
  10. #include <afxwin.h> // MFC 核心组件和标准组件
  11. #include <afxext.h> // MFC 扩展
  12. #include <afxdisp.h> // MFC 自动化类
  13. #include <WS2tcpip.h> // Socket TCP
  14. #ifndef _AFX_NO_OLE_SUPPORT
  15. #include <afxdtctl.h> // MFC 对 Internet Explorer 4 公共控件的支持
  16. #endif
  17. #ifndef _AFX_NO_AFXCMN_SUPPORT
  18. #include <afxcmn.h> // MFC 对 Windows 公共控件的支持
  19. #endif // _AFX_NO_AFXCMN_SUPPORT
  20. #include <afxcontrolbars.h> // MFC 支持功能区和控制条
  21. #include <atlimage.h>
  22. #include <afxdlgs.h> // 通用对话框
  23. #include "resource.h"
  24. #define WM_START_STATIC WM_USER+101 // 自定义事件:启动静态任务
  25. #define WM_START_DYNAMIC WM_USER+102 // 自定义事件:启动动态任务
  26. #define WM_BACK_TO_START WM_USER+103 // 自定义事件:返回开始视图
  27. #define WM_COMPLETE WM_USER+104 // 自定义事件:IDPMS处理完成
  28. #define WM_FAILURE WM_USER+105 // 自定义事件:IDPMS处理有错
  29. #define WM_SUCCESS WM_USER+106 // 自定义事件:IDPMS处理成功
  30. #define WM_CAMERA WM_USER+107 // 自定义事件:相机标定
  31. #define WM_STATIC WM_USER+108 // 自定义事件:静态任务
  32. #define WM_STATIC_DATA WM_USER+116 // 自定义事件:重新获取界面数据
  33. #define WM_DYNAMIC WM_USER+109 // 自定义事件:动态任务
  34. #define WM_SINGLE_CAM_CONFIG WM_USER+110 // 自定义线程事件:单相机标定
  35. #define WM_DOUBLE_CAM_CONFIG_STEP1 WM_USER+111 // 自定义线程事件:双相机外参标定:建立工程
  36. #define WM_DOUBLE_CAM_CONFIG_STEP2 WM_USER+112 // 自定义线程事件:双相机外参标定
  37. #define WM_CAM_CONFIG_SUCCESS WM_USER+113 // 相机标定成功
  38. #define WM_CAM_CONFIG_FAILURE WM_USER+114 // 相机标定失败
  39. #define WM_START_IDPMS WM_USER+115 //
  40. #define WM_UPDATE_SUCCESS WM_USER+116 //
  41. #define WM_UPDATE_FAILURE WM_USER+117 //
  42. struct PROCESS_INFO
  43. {
  44. DWORD dwProcessId;
  45. HWND hWnd;
  46. };
  47. extern CString g_szIDPMSHost;
  48. extern int g_iIDPMSPort;
  49. extern DWORD g_dwIDPMSProcessId;
  50. extern HWND g_hIDPMSHWnd;
  51. extern CString g_szIDPMSPath;
  52. extern CString g_szIDPMSWindowTitle;
  53. extern CString g_szDriveOutputFile;
  54. extern CString g_szConfigFile;
  55. extern UINT g_iDBLogOutput;
  56. extern UINT g_iFindIDPMSType;
  57. extern BOOL CALLBACK EnumWindowCallBack(HWND hWnd, LPARAM lParam);
  58. // Text Color
  59. extern COLORREF g_crInfoText;
  60. #define IDPMS_MAX_SIZE 20480*3 // IDPMS报文最大长度60K
  61. #define IDPMS_MAX_DURATION 5000 // 报文返回最大时长5秒
  62. #define DMS_MSG_SIZE 4096 // DMS消息长度
  63. // 设备类型列表类型定义
  64. class CEquipType;
  65. typedef CTypedPtrList<CObList, CEquipType *> CEquipTypeList;
  66. class CTaskRecord;
  67. typedef CTypedPtrList<CObList, CTaskRecord *> CTaskRecordList;
  68. class EquipData;
  69. typedef CTypedPtrList<CObList, EquipData*> CDataList;
  70. class EquipDataPoint;
  71. typedef CTypedPtrList<CObList, EquipDataPoint*> CPointList;
  72. class EquipDataPlane;
  73. typedef CTypedPtrList<CObList, EquipDataPlane*> CPlaneList;
  74. class EquipDataCircle;
  75. typedef CTypedPtrList<CObList, EquipDataCircle*> CCircleList;
  76. class EquipDataLine;
  77. typedef CTypedPtrList<CObList, EquipDataLine*> CLineList;
  78. class EquipDataCylinder;
  79. typedef CTypedPtrList<CObList, EquipDataCylinder*> CCylinderList;
  80. class EquipDataAngle;
  81. typedef CTypedPtrList<CObList, EquipDataAngle*> CAngleList;
  82. class EquipDataPointRelated;
  83. typedef CTypedPtrList<CObList, EquipDataPointRelated*> CPointRelatedList;
  84. class PostureDataAngle;
  85. typedef CTypedPtrList<CObList, PostureDataAngle*> CPostureAngleList;
  86. class PostureDataPoint;
  87. typedef CTypedPtrList<CObList, PostureDataPoint*> CPosturePointList;
  88. #define PI acos(-1)
  89. // 自定义消息
  90. typedef struct tag_DMSResponse {
  91. BOOL bRet;
  92. int iCode;
  93. char szMsg[DMS_MSG_SIZE];
  94. } DMSResponse;
  95. #ifdef _UNICODE
  96. #if defined _M_IX86
  97. #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
  98. #elif defined _M_X64
  99. #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
  100. #else
  101. #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
  102. #endif
  103. #endif