PZMedicalRFDefinition.h 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  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. };
  144. enum
  145. {
  146. NOCAL,
  147. CAL_START,
  148. CAL_CONFIRM,
  149. CAL_REJECT,
  150. CAL_ABORT,
  151. CAL_END
  152. };
  153. enum CCOS_OFFSET_STAUTS
  154. {
  155. OFFSET_IDLE = 0,
  156. OFFSET_RUNNING = 1,
  157. OFFSET_ERROR = 2
  158. };
  159. /***
  160. * 加载探测器模式配置(不同探测器根据需要增删改)
  161. ***/
  162. struct DetModeInfo
  163. {
  164. int nLogicMode;
  165. string strExamType;
  166. int nImageWidth;
  167. int nImageHeight;
  168. int nWidthOffset;
  169. int nHeightOffset;
  170. int nRawImgWidth;
  171. int nRawImgHeight;
  172. int nPhySizeInfoBit; //探测器位数
  173. int nSensitivity; //单位: ugy
  174. bool bPreviewEnable;
  175. int nPreviewWidth;
  176. int nPreviewHeight;
  177. int nPixelPitch;
  178. int nSyncType;
  179. int nXwindow;
  180. bool bIsSaveRaw;
  181. int nRotateAngle;
  182. int nBinningDx;
  183. int nBinningDy;
  184. int nGainValue;
  185. int nFrequency;
  186. int nFrameCount;
  187. int nWorkStation;
  188. int nOperationMode;
  189. int nExpTime;
  190. int nTriggerType;
  191. int nExiThreshold;
  192. DetModeInfo()
  193. {
  194. nLogicMode = 0;
  195. strExamType = "";
  196. nImageWidth = 0;
  197. nImageHeight = 0;
  198. nWidthOffset = 0;
  199. nHeightOffset = 0;
  200. nRawImgWidth = 0;
  201. nRawImgHeight = 0;
  202. nPhySizeInfoBit = 0;
  203. nSensitivity = 0;
  204. bPreviewEnable = false;
  205. nPreviewWidth = 0;
  206. nPreviewHeight = 0;
  207. nPixelPitch = 0;
  208. nSyncType = 0;
  209. nXwindow = 0;
  210. bIsSaveRaw = false;
  211. nRotateAngle = 0;
  212. nBinningDx = 0;
  213. nBinningDy = 0;
  214. nGainValue = 0;
  215. nFrequency = 0;
  216. nFrameCount = 0;
  217. nWorkStation = 0;
  218. nOperationMode = 100;
  219. nExpTime = 500;
  220. nTriggerType = 0;
  221. nExiThreshold = 500;
  222. }
  223. };
  224. /***
  225. * 加载探测器校正配置
  226. ***/
  227. struct DetCalibNodeInfo
  228. {
  229. int nImgCount; //当前计量点需要曝光的次数
  230. float fDose;
  231. DetCalibNodeInfo()
  232. {
  233. nImgCount = 0;
  234. fDose = 0.0f;
  235. }
  236. };
  237. struct DetCalibInfo
  238. {
  239. int nDetCalibNodeCount;
  240. DetCalibNodeInfo* pDetCalibNodeInfo;
  241. DetCalibInfo()
  242. {
  243. nDetCalibNodeCount = 0;
  244. pDetCalibNodeInfo = nullptr;
  245. }
  246. };
  247. struct DeviceIndexStruct
  248. {
  249. std::string strDeviceName; //探测器名称
  250. std::string strWiredIP;
  251. std::string strWirelessIP;
  252. std::string strLocalIP;
  253. int nPort;
  254. std::string strFPDSN;
  255. bool bInitOK;
  256. bool bConnectStatus;
  257. string strCalibrationDate;
  258. string strCalibrationTime;
  259. int nMaxImgHeight;
  260. int nMaxImgWidth;
  261. int nSyncMode;
  262. int nWifiWarning;
  263. int nWifiLimit;
  264. int nBatteryWarning;
  265. int nBatteryLimit;
  266. float fTemperLowLimit;
  267. float fTemperMinWarn;
  268. float fTemperMaxWarn;
  269. float fTemperMaxLimit;
  270. float fFactorEXI2UGY; //探测器EXI -> UGY 转换系数
  271. bool bSupportDDR; //是否支持DDR采集模式
  272. int nMaxFrameNum;
  273. int nRADDelayTime;
  274. int nOffsetInterval;
  275. float fMaxFrameRate;
  276. DetModeInfo AcqModeInfo;
  277. DetCalibInfo stDetCalibInfo;
  278. DeviceIndexStruct()
  279. {
  280. bInitOK = false;
  281. bConnectStatus = false;
  282. strWiredIP = "192.168.0.0";
  283. strWirelessIP = "192.168.0.0";
  284. strLocalIP = "192.168.0.0";
  285. nPort = 0;
  286. strFPDSN = "XXX";
  287. nMaxImgHeight = 0;
  288. nMaxImgWidth = 0;
  289. nSyncMode = 0;
  290. strCalibrationDate = "1970/01/01";
  291. strCalibrationTime = "00:00:00";
  292. nWifiWarning = 0;
  293. nWifiLimit = 0;
  294. nBatteryWarning = 0;
  295. nBatteryLimit = 0;
  296. fTemperLowLimit = 0.0;
  297. fTemperMinWarn = 0.0;
  298. fTemperMaxWarn = 0.0;
  299. fTemperMaxLimit = 0.0;
  300. fFactorEXI2UGY = 0.0;
  301. strDeviceName = "";
  302. bSupportDDR = false;
  303. nMaxFrameNum = 3;
  304. nRADDelayTime = 0;
  305. fMaxFrameRate = 15.0f;
  306. }
  307. DeviceIndexStruct& operator= (const DeviceIndexStruct& copySource)
  308. {
  309. bInitOK = copySource.bInitOK;
  310. bConnectStatus = copySource.bConnectStatus;
  311. nMaxImgHeight = copySource.nMaxImgHeight;
  312. nMaxImgWidth = copySource.nMaxImgWidth;
  313. nSyncMode = copySource.nSyncMode;
  314. nWifiWarning = copySource.nWifiWarning;
  315. nWifiLimit = copySource.nWifiLimit;
  316. nBatteryWarning = copySource.nBatteryWarning;
  317. nBatteryLimit = copySource.nBatteryLimit;
  318. fTemperLowLimit = copySource.fTemperLowLimit;
  319. fTemperMinWarn = copySource.fTemperMinWarn;
  320. fTemperMaxWarn = copySource.fTemperMaxWarn;
  321. fTemperMaxLimit = copySource.fTemperMaxLimit;
  322. fFactorEXI2UGY = copySource.fFactorEXI2UGY;
  323. strDeviceName = copySource.strDeviceName;
  324. // 拷贝的逻辑实现,避免浅复制问题
  325. nMaxFrameNum = copySource.nMaxFrameNum;
  326. strWiredIP = copySource.strWiredIP;
  327. strWirelessIP = copySource.strWirelessIP;
  328. strLocalIP = copySource.strLocalIP;
  329. nPort = copySource.nPort;
  330. strFPDSN = copySource.strFPDSN;
  331. return *this;
  332. }
  333. };
  334. typedef enum
  335. {
  336. FD_INIT_NULL = -1,
  337. FD_INIT_FAILED = 0,
  338. FD_INIT_SUCCESS = 1,
  339. }fd_init_status;
  340. enum
  341. {
  342. GRID_CONF_AUTO = 0,
  343. GRID_CONF_YES = 1,
  344. GRID_CONF_NO = 2,
  345. };
  346. enum
  347. {
  348. GRID_STATE_ERROR = -3,
  349. GRID_STATE_PARAM_ERROR = -2,
  350. GRID_STATE_PARAM_NULL = -1,
  351. GRID_STATE_NO = 0,
  352. GRID_STATE_VERTICAL = 1,
  353. GRID_STATE_HORIZONTAL = 2,
  354. };
  355. enum TEMP_STATUS
  356. {
  357. TEMP_NORMAL = 0,
  358. TEMP_WARNING, //1
  359. TEMP_TOO_HIGH, //2
  360. TEMP_TOO_LOW, //3
  361. };
  362. enum APP_STATUS
  363. {
  364. APP_STATUS_IDLE = 0,
  365. APP_STATUS_WORK_BEGIN, //1
  366. APP_STATUS_WORK_END, //2
  367. APP_STATUS_DETSHARE_BEGIN, //3
  368. APP_STATUS_DETSHAR_END, //4
  369. APP_STATUS_CAL_BEGIN, //5
  370. APP_STATUS_CAL_END, // 6
  371. APP_STATUS_WORK_IN_SENSITIVITY, //7
  372. APP_STATUS_MAX,
  373. };
  374. #pragma endregion DEFINITION