CareRayDRDefinition.h 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. #pragma once
  2. #include <string>
  3. #pragma region DEFINITION
  4. //探测器异步事件状态
  5. enum ENUM_PANEL_EVENT_STATE
  6. {
  7. PANEL_EVENT_END_OK = 0,
  8. PANEL_EVENT_END_ERROR = 1,
  9. PANEL_EVENT_START = 2,
  10. PANEL_EVENT_SUCCESS = 3,
  11. PANEL_EVENT_END = 4,
  12. PANEL_EVENT_BEGIN = 5,
  13. PANEL_EVENT_TIMEOUT = 6
  14. };
  15. enum ENUM_EXPOSE_STATUS
  16. {
  17. DOSE_ACCEPT = 0,
  18. DOSE_TOO_HIGH = 1,
  19. DOSE_TOO_LOW = 2,
  20. DOSE_OBJECT = 3
  21. };
  22. //控制模块给DPC模块反馈的信息类型
  23. typedef enum
  24. {
  25. EVT_LEVEL_CONFIGURATION = 0x00,
  26. EVT_LEVEL_INFORMATOION = 0x01,
  27. EVT_LEVEL_STATUS = 0x02,
  28. EVT_LEVEL_DATA = 0x03,
  29. EVT_LEVEL_WARNING = 0x04,
  30. EVT_LEVEL_ERROR = 0x05,
  31. } CcosEventLevel;
  32. typedef enum
  33. {
  34. EVT_CONF_PANEL_SERIAL = 0x00,
  35. EVT_CONF_RAW_WIDTH = 0x01,
  36. EVT_CONF_RAW_HIGHT = 0x02,
  37. EVT_CONF_RAW_BITS = 0x03,
  38. EVT_CONF_PIXELSPACE = 0x04,
  39. EVT_CONF_PREVIEW_WIDTH = 0x05,
  40. EVT_CONF_PREVIEW_HIGHT = 0x06,
  41. EVT_CONF_MODULE_TYPE = 0x07,
  42. EVT_CONF_MODULE_IP = 0x08,
  43. EVT_CONF_MODULE_SN = 0x09,
  44. EVT_CONF_FIRWARE_UPDATE = 0x0A,
  45. EVT_CONF_PART_NUMBER = 0x0B,
  46. EVT_CONF_BATTERY_SN = 0x0C,
  47. EVT_CONF_WIFI_SSID = 0x0D,
  48. EVT_CONF_IFBOARD = 0x0E,
  49. EVT_CONF_DATECODE = 0x0F,
  50. EVT_CONF_LIFETIME = 0x10,
  51. } CcosEventConfigID;
  52. typedef enum
  53. {
  54. EVT_INFO_POWER_ON = 0x00,
  55. EVT_INFO_BATTERY_CAPACITY = 0x01,
  56. EVT_INFO_BATTERY_TEMPERATURE = 0x02,
  57. EVT_INFO_BATTERY_CHARGES = 0x03,
  58. EVT_INFO_WIFI_DATARATE = 0x04,
  59. EVT_INFO_WIFI_CHANNEL = 0x05,
  60. EVT_INFO_WIFI_SIGNALPOWER = 0x06,
  61. EVT_INFO_WIFI_NOISEPOWER = 0x07,
  62. EVT_INFO_FIRMWARE = 0x08,
  63. EVT_INFO_SHOCKSENSOR_INFO = 0x09,
  64. EVT_INFO_CALIBRATIOIN_TIME = 0x0A,
  65. EVT_INFO_FPVOLTAGE = 0x0B,
  66. EVT_INFO_CALIBRATIOIN_TIMEL = 0x0C, //长曝光模式
  67. } CcosEventInfoID;
  68. typedef enum
  69. {
  70. EVT_STATUS_INIT = 0x00,
  71. EVT_STATUS_MOTION = 0x01,
  72. EVT_STATUS_UPDATE_FIRMWARE = 0x02,
  73. EVT_STATUS_SELFTEST = 0x03,
  74. EVT_STATUS_DETECTORSHARE = 0x04,
  75. EVT_STATUS_SINGLEINIT = 0x05,
  76. EVT_STATUS_SELECTPANEL = 0x06,
  77. EVT_STATUS_PANEL = 0x07,
  78. EVT_STATUS_CALIBRATIOIN = 0x08,
  79. EVT_STATUS_SAVECALIB = 0x09,
  80. EVT_STATUS_SAVEDEFECT = 0x0A,
  81. EVT_STATUS_ACQUISITION = 0x0B,
  82. EVT_STATUS_SINGLEEXP = 0x0C,
  83. EVT_STATUS_IMAGEPENDING = 0x0D,
  84. EVT_STATUS_TEMPERATURE = 0x0E,
  85. EVT_STATUS_WIFI = 0x0F,
  86. EVT_STATUS_BATTERY_VALUE = 0x10,
  87. EVT_STATUS_BATTERY_CHARGING = 0x11,
  88. EVT_STATUS_SHOCK_SENSOR = 0x12,
  89. EVT_STATUS_HALL_SENSOR = 0x13,
  90. EVT_STATUS_PING = 0x14,
  91. EVT_STATUS_PMSNOTOPEN = 0x15,
  92. EVT_STATUS_RESTOREFILES = 0x16,
  93. EVT_STATUS_LASTERROR = 0x17,
  94. EVT_STATUS_RESET = 0x18,
  95. } CcosEventStatusID;
  96. typedef enum
  97. {
  98. EVT_DATA_RAW_IMAGE = 0x00,
  99. EVT_DATA_PREVIEW_IMAGE = 0x01,
  100. EVT_DATA_DOSEPARAM = 0x02,
  101. } CcosEventDataID;
  102. typedef enum
  103. {
  104. EVT_ERR_COMMUNICATE = 0x00,
  105. EVT_ERR_EXP_REQUEST = 0x01,
  106. EVT_ERR_GET_IMAGE = 0x02,
  107. EVT_ERR_MAX_NUMBER = 0x03,
  108. EVT_ERR_SN_NOTINLIST = 0x04,
  109. EVT_ERR_POWER_OFF = 0x05,
  110. EVT_ERR_INIT_FAILED = 0x06,
  111. } CcosEventErrorID;
  112. enum ENUM_PANEL_RESET
  113. {
  114. PANEL_RESET_BEGIN = 1, //
  115. PANEL_RESET_OK = 2, //
  116. PANEL_RESET_ERROR = 3
  117. };
  118. //探测器状态
  119. enum ENUM_PANEL_STATUS
  120. {
  121. PANEL_CLOSE = 0,
  122. PANEL_STANDBY = 1,
  123. PANEL_READY_EXP = 2,
  124. PANEL_XWINDOW_ON = 3,
  125. PANEL_XWINDOW_OFF = 4,
  126. PANEL_START_TRANSMIT = 5,
  127. PANEL_END_TRANSMIT = 6,
  128. PANEL_START_ACQ = 7,
  129. PANEL_END_ACQ = 8,
  130. PANEL_EXP_END_TIMEOUT = 9,
  131. PANEL_OFFSET_CAL = 10,
  132. PANEL_OFFSET_FINISH = 11,
  133. PANEL_GAIN_CAL = 12,
  134. PANEL_GAIN_FINISH = 13,
  135. PANEL_DEFECT_CAL = 14,
  136. PANEL_DEFECT_FINISH = 15,
  137. PANEL_AEC_PRE_END = 16,
  138. PANEL_INIT = 21,
  139. PANEL_SLEEP = 22,
  140. PANEL_GET_IMAGE = 23,
  141. PANEL_GAIN_PREPARE = 24,
  142. PANEL_GAIN_READY_EXP = 25,
  143. PANEL_CONNECT = 26,
  144. PANEL_DISCONNECT = 27
  145. };
  146. enum
  147. {
  148. NOCAL,
  149. CAL_START,
  150. CAL_CONFIRM,
  151. CAL_REJECT,
  152. CAL_ABORT,
  153. CAL_END
  154. };
  155. /***
  156. * 加载探测器模式配置(不同探测器根据需要增删改)
  157. ***/
  158. struct DetModeInfoStruct
  159. {
  160. int nLogicMode;
  161. int nImageWidth;
  162. int nImageHeight;
  163. int nWidthOffset;
  164. int nHeightOffset;
  165. int nRawImgWidth;
  166. int nRawImgHeight;
  167. int nPhySizeInfoBit; //探测器位数
  168. int nSensitivity; //单位: ugy
  169. bool bPreviewEnable;
  170. int nPreviewWidth;
  171. int nPreviewHeight;
  172. int nPixelPitch;
  173. int nSyncType;
  174. int nXwindow;
  175. int nIsSaveRaw;
  176. int nRotateAngle;
  177. int nBinningDx;
  178. int nBinningDy;
  179. int nGainValue;
  180. int nFrequency;
  181. int nFrameCount;
  182. int nWorkStation;
  183. DetModeInfoStruct()
  184. {
  185. nLogicMode = 0;
  186. nImageWidth = 0;
  187. nImageHeight = 0;
  188. nWidthOffset = 0;
  189. nHeightOffset = 0;
  190. nRawImgWidth = 0;
  191. nRawImgHeight = 0;
  192. nPhySizeInfoBit = 0;
  193. nSensitivity = 0;
  194. bPreviewEnable = false;
  195. nPreviewWidth = 0;
  196. nPreviewHeight = 0;
  197. nPixelPitch = 0;
  198. nSyncType = 0;
  199. nXwindow = 0;
  200. nIsSaveRaw = 0;
  201. nRotateAngle = 0;
  202. nBinningDx = 0;
  203. nBinningDy = 0;
  204. nGainValue = 0;
  205. nFrequency = 0;
  206. nFrameCount = 0;
  207. nWorkStation = 0;
  208. }
  209. };
  210. /***
  211. * 加载探测器校正配置
  212. ***/
  213. struct DetCalibNodeInfo
  214. {
  215. int nImgCount; //当前计量点需要曝光的次数
  216. float fDose;
  217. DetCalibNodeInfo()
  218. {
  219. nImgCount = 0;
  220. fDose = 0.0f;
  221. }
  222. };
  223. struct DetCalibInfo
  224. {
  225. int nDetCalibNodeCount;
  226. DetCalibNodeInfo* pDetCalibNodeInfo;
  227. DetCalibInfo()
  228. {
  229. nDetCalibNodeCount = 0;
  230. }
  231. };
  232. struct DeviceIndexStruct
  233. {
  234. bool bInitOK;
  235. bool bConnectStatus;
  236. string strPanelSerial;
  237. string strCalibrationDate;
  238. string strCalibrationTime;
  239. int nMaxImgHeight;
  240. int nMaxImgWidth;
  241. int nSyncMode;
  242. int nDoseOfEXI;
  243. int nWifiWarning;
  244. int nWifiLimit;
  245. int nBatteryWarning;
  246. int nBatteryLimit;
  247. float fTemperLowLimit;
  248. float fTemperMinWarn;
  249. float fTemperMaxWarn;
  250. float fTemperMaxLimit;
  251. float fCalibTemperature;
  252. float fCalibTemperature1;
  253. float fCalibTemperature2;
  254. int nForceGridSuppress;
  255. int nGridSuppressed;
  256. float fGridSuppressParam1;
  257. float fGridSuppressParam2;
  258. float fGridSuppressParam3;
  259. float fGridSuppressParam4;
  260. float fGridSuppressParam5;
  261. float fGridSuppressParam6;
  262. float fGridSuppressParam7;
  263. float fGridSuppressParam8;
  264. float fGridSuppressParam9;
  265. float fFactorEXI2UGY; //探测器EXI -> UGY 转换系数
  266. std::string strDeviceName; //探测器名称
  267. float fAmplificationFactor;
  268. float fSid;
  269. float fSod;
  270. int nDetModeCount;
  271. DetModeInfoStruct* pDetModeInfoStruct;
  272. DetCalibInfo stDetCalibInfo;
  273. DeviceIndexStruct()
  274. {
  275. bInitOK = false;
  276. bConnectStatus = false;
  277. nMaxImgHeight = 0;
  278. nMaxImgWidth = 0;
  279. nSyncMode = 0;
  280. nDoseOfEXI = 0;
  281. nDetModeCount = 0;
  282. strPanelSerial = "";
  283. strCalibrationDate = "1970/01/01";
  284. strCalibrationTime = "00:00:00";
  285. nWifiWarning = 0;
  286. nWifiLimit = 0;
  287. nBatteryWarning = 0;
  288. nBatteryLimit = 0;
  289. fTemperLowLimit = 0.0;
  290. fTemperMinWarn = 0.0;
  291. fTemperMaxWarn = 0.0;
  292. fTemperMaxLimit = 0.0;
  293. fCalibTemperature = 0.0;
  294. fCalibTemperature1 = 0.0;
  295. fCalibTemperature2 = 0.0;
  296. //fCurrentTemperValue = 0.0;
  297. //nCurrentWifiValue = -1;
  298. //nCurrentBatteryValue = 0;
  299. nForceGridSuppress = 0;
  300. nGridSuppressed = 0;
  301. fGridSuppressParam1 = 0.0;
  302. fGridSuppressParam2 = 0.0;
  303. fGridSuppressParam3 = 0.0;
  304. fGridSuppressParam4 = 0.0;
  305. fGridSuppressParam5 = 0.0;
  306. fGridSuppressParam6 = 0.0;
  307. fGridSuppressParam7 = 0.0;
  308. fGridSuppressParam8 = 0.0;
  309. fGridSuppressParam9 = 0.0;
  310. fFactorEXI2UGY = 0.0;
  311. strDeviceName = ""; //探测器名称
  312. fAmplificationFactor = 0.0f;
  313. fSid = 0.0f;
  314. fSod = 0.0f;
  315. }
  316. DeviceIndexStruct& operator= (const DeviceIndexStruct& copySource) {
  317. bInitOK = copySource.bInitOK;
  318. bConnectStatus = copySource.bConnectStatus;
  319. nMaxImgHeight = copySource.nMaxImgHeight;
  320. nMaxImgWidth = copySource.nMaxImgWidth;
  321. nSyncMode = copySource.nSyncMode;
  322. nDoseOfEXI = copySource.nDoseOfEXI;
  323. nDetModeCount = copySource.nDetModeCount;
  324. nWifiWarning = copySource.nWifiWarning;
  325. nWifiLimit = copySource.nWifiLimit;
  326. nBatteryWarning = copySource.nBatteryWarning;
  327. nBatteryLimit = copySource.nBatteryLimit;
  328. fTemperLowLimit = copySource.fTemperLowLimit;
  329. fTemperMinWarn = copySource.fTemperMinWarn;
  330. fTemperMaxWarn = copySource.fTemperMaxWarn;
  331. fTemperMaxLimit = copySource.fTemperMaxLimit;
  332. fCalibTemperature = copySource.fCalibTemperature;
  333. fCalibTemperature1 = copySource.fCalibTemperature1;
  334. fCalibTemperature2 = copySource.fCalibTemperature2;
  335. nForceGridSuppress = copySource.nForceGridSuppress;
  336. nGridSuppressed = copySource.nGridSuppressed;
  337. fGridSuppressParam1 = copySource.fGridSuppressParam1;
  338. fGridSuppressParam2 = copySource.fGridSuppressParam2;
  339. fGridSuppressParam3 = copySource.fGridSuppressParam3;
  340. fGridSuppressParam4 = copySource.fGridSuppressParam4;
  341. fGridSuppressParam5 = copySource.fGridSuppressParam5;
  342. fGridSuppressParam6 = copySource.fGridSuppressParam6;
  343. fGridSuppressParam7 = copySource.fGridSuppressParam7;
  344. fGridSuppressParam8 = copySource.fGridSuppressParam8;
  345. fGridSuppressParam9 = copySource.fGridSuppressParam9;
  346. fFactorEXI2UGY = copySource.fFactorEXI2UGY;
  347. strDeviceName = copySource.strDeviceName;//探测器名称
  348. // 拷贝的逻辑实现,避免浅复制问题
  349. return *this;
  350. }
  351. };
  352. typedef enum
  353. {
  354. FD_INIT_NULL = -1,
  355. FD_INIT_FAILED = 0,
  356. FD_INIT_SUCCESS = 1,
  357. }fd_init_status;
  358. enum
  359. {
  360. GRID_CONF_AUTO = 0,
  361. GRID_CONF_YES = 1,
  362. GRID_CONF_NO = 2,
  363. };
  364. enum
  365. {
  366. GRID_STATE_ERROR = -3,
  367. GRID_STATE_PARAM_ERROR = -2,
  368. GRID_STATE_PARAM_NULL = -1,
  369. GRID_STATE_NO = 0,
  370. GRID_STATE_VERTICAL = 1,
  371. GRID_STATE_HORIZONTAL = 2,
  372. };
  373. enum TEMP_STATUS
  374. {
  375. TEMP_NORMAL = 0,
  376. TEMP_WARNING, //1
  377. TEMP_TOO_HIGH, //2
  378. TEMP_TOO_LOW, //3
  379. };
  380. enum APP_STATUS
  381. {
  382. APP_STATUS_IDLE = 0,
  383. APP_STATUS_WORK_BEGIN, //1
  384. APP_STATUS_WORK_END, //2
  385. APP_STATUS_DETSHARE_BEGIN, //3
  386. APP_STATUS_DETSHAR_END, //4
  387. APP_STATUS_CAL_BEGIN, //5
  388. APP_STATUS_CAL_END, // 6
  389. APP_STATUS_WORK_IN_SENSITIVITY, //7
  390. APP_STATUS_MAX,
  391. };
  392. #pragma endregion DEFINITION