DetectorCtrlDefinition.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  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 AcqMode
  16. {
  17. UNDEFINE = 0,
  18. RAD,
  19. DDR
  20. };
  21. enum ENUM_EXPOSE_STATUS
  22. {
  23. DOSE_ACCEPT = 0,
  24. DOSE_TOO_HIGH = 1,
  25. DOSE_TOO_LOW = 2,
  26. DOSE_OBJECT = 3
  27. };
  28. //控制模块给DPC模块反馈的信息类型
  29. typedef enum
  30. {
  31. EVT_LEVEL_CONFIGURATION = 0x00,
  32. EVT_LEVEL_INFORMATOION = 0x01,
  33. EVT_LEVEL_STATUS = 0x02,
  34. EVT_LEVEL_DATA = 0x03,
  35. EVT_LEVEL_WARNING = 0x04,
  36. EVT_LEVEL_ERROR = 0x05,
  37. } CcosEventLevel;
  38. typedef enum
  39. {
  40. EVT_CONF_PANEL_SERIAL = 0x00,
  41. EVT_CONF_RAW_WIDTH = 0x01,
  42. EVT_CONF_RAW_HIGHT = 0x02,
  43. EVT_CONF_RAW_BITS = 0x03,
  44. EVT_CONF_PIXELSPACE = 0x04,
  45. EVT_CONF_PREVIEW_WIDTH = 0x05,
  46. EVT_CONF_PREVIEW_HIGHT = 0x06,
  47. EVT_CONF_MODULE_TYPE = 0x07,
  48. EVT_CONF_MODULE_IP = 0x08,
  49. EVT_CONF_MODULE_SN = 0x09,
  50. EVT_CONF_FIRWARE_UPDATE = 0x0A,
  51. EVT_CONF_PART_NUMBER = 0x0B,
  52. EVT_CONF_BATTERY_SN = 0x0C,
  53. EVT_CONF_WIFI_SSID = 0x0D,
  54. EVT_CONF_IFBOARD = 0x0E,
  55. EVT_CONF_DATECODE = 0x0F,
  56. EVT_CONF_LIFETIME = 0x10,
  57. } CcosEventConfigID;
  58. typedef enum
  59. {
  60. EVT_INFO_POWER_ON = 0x00,
  61. EVT_INFO_BATTERY_CAPACITY = 0x01,
  62. EVT_INFO_BATTERY_TEMPERATURE = 0x02,
  63. EVT_INFO_BATTERY_CHARGES = 0x03,
  64. EVT_INFO_WIFI_DATARATE = 0x04,
  65. EVT_INFO_WIFI_CHANNEL = 0x05,
  66. EVT_INFO_WIFI_SIGNALPOWER = 0x06,
  67. EVT_INFO_WIFI_NOISEPOWER = 0x07,
  68. EVT_INFO_FIRMWARE = 0x08,
  69. EVT_INFO_SHOCKSENSOR_INFO = 0x09,
  70. EVT_INFO_CALIBRATIOIN_TIME = 0x0A,
  71. EVT_INFO_FPVOLTAGE = 0x0B,
  72. EVT_INFO_CALIBRATIOIN_TIMEL = 0x0C, //长曝光模式
  73. } CcosEventInfoID;
  74. typedef enum
  75. {
  76. EVT_STATUS_INIT = 0x00,
  77. EVT_STATUS_MOTION = 0x01,
  78. EVT_STATUS_UPDATE_FIRMWARE = 0x02,
  79. EVT_STATUS_SELFTEST = 0x03,
  80. EVT_STATUS_DETECTORSHARE = 0x04,
  81. EVT_STATUS_SINGLEINIT = 0x05,
  82. EVT_STATUS_SELECTPANEL = 0x06,
  83. EVT_STATUS_PANEL = 0x07,
  84. EVT_STATUS_CALIBRATIOIN = 0x08,
  85. EVT_STATUS_SAVECALIB = 0x09,
  86. EVT_STATUS_SAVEDEFECT = 0x0A,
  87. EVT_STATUS_ACQUISITION = 0x0B,
  88. EVT_STATUS_SINGLEEXP = 0x0C,
  89. EVT_STATUS_IMAGEPENDING = 0x0D,
  90. EVT_STATUS_TEMPERATURE = 0x0E,
  91. EVT_STATUS_WIFI = 0x0F,
  92. EVT_STATUS_BATTERY_VALUE = 0x10,
  93. EVT_STATUS_BATTERY_CHARGING = 0x11,
  94. EVT_STATUS_SHOCK_SENSOR = 0x12,
  95. EVT_STATUS_HALL_SENSOR = 0x13,
  96. EVT_STATUS_PING = 0x14,
  97. EVT_STATUS_PMSNOTOPEN = 0x15,
  98. EVT_STATUS_RESTOREFILES = 0x16,
  99. EVT_STATUS_LASTERROR = 0x17,
  100. EVT_STATUS_RESET = 0x18,
  101. EVT_STATUS_SLEEP = 0x19,
  102. EVT_AUTONUMOUS_STATUS = 0x20,
  103. } CcosEventStatusID;
  104. typedef enum
  105. {
  106. EVT_DATA_RAW_IMAGE = 0x00,
  107. EVT_DATA_PREVIEW_IMAGE = 0x01,
  108. EVT_DATA_DOSEPARAM = 0x02,
  109. } CcosEventDataID;
  110. typedef enum
  111. {
  112. EVT_ERR_COMMUNICATE = 0x00,
  113. EVT_ERR_EXP_REQUEST = 0x01,
  114. EVT_ERR_GET_IMAGE = 0x02,
  115. EVT_ERR_MAX_NUMBER = 0x03,
  116. EVT_ERR_SN_NOTINLIST = 0x04,
  117. EVT_ERR_POWER_OFF = 0x05,
  118. EVT_ERR_INIT_FAILED = 0x06,
  119. } CcosEventErrorID;
  120. enum ENUM_PANEL_RESET
  121. {
  122. PANEL_RESET_BEGIN = 1, //
  123. PANEL_RESET_OK = 2, //
  124. PANEL_RESET_ERROR = 3
  125. };
  126. //探测器状态
  127. enum ENUM_PANEL_STATUS
  128. {
  129. PANEL_CLOSE = 0,
  130. PANEL_STANDBY = 1,
  131. PANEL_READY_EXP = 2,
  132. PANEL_XWINDOW_ON = 3,
  133. PANEL_XWINDOW_OFF = 4,
  134. PANEL_START_TRANSMIT = 5,
  135. PANEL_END_TRANSMIT = 6,
  136. PANEL_START_ACQ = 7,
  137. PANEL_END_ACQ = 8,
  138. PANEL_EXP_END_TIMEOUT = 9,
  139. PANEL_OFFSET_CAL = 10,
  140. PANEL_OFFSET_FINISH = 11,
  141. PANEL_GAIN_CAL = 12,
  142. PANEL_GAIN_FINISH = 13,
  143. PANEL_DEFECT_CAL = 14,
  144. PANEL_DEFECT_FINISH = 15,
  145. PANEL_AED_XRAY_ON = 16,
  146. PANEL_AED_XRAY_OFF = 17,
  147. PANEL_INIT = 21,
  148. PANEL_SLEEP = 22,
  149. PANEL_GET_IMAGE = 23,
  150. PANEL_GAIN_PREPARE = 24,
  151. PANEL_GAIN_READY_EXP = 25,
  152. };
  153. enum
  154. {
  155. NOCAL,
  156. CAL_START,
  157. CAL_CONFIRM,
  158. CAL_REJECT,
  159. CAL_ABORT,
  160. CAL_END
  161. };
  162. struct DetCalibNodeInfo
  163. {
  164. int nCheckType; //0: EXI; 1: nGy; 2: uGy
  165. int nExpNum;
  166. float fDose;
  167. int KVP;
  168. int mA;
  169. int mS;
  170. float mAS;
  171. int FKVP;
  172. int FmA;
  173. int nMaxEXI;
  174. int nMinEXI;
  175. int nExpectEXI;
  176. DetCalibNodeInfo()
  177. {
  178. nCheckType = 0;
  179. nExpNum = 0;
  180. fDose = 0.0f;
  181. KVP = 0;
  182. mA = 0;
  183. mS = 0;
  184. mAS = 0.0f;
  185. FKVP = 0;
  186. FmA = 0;
  187. nMaxEXI = 0;
  188. nMinEXI = 0;
  189. nExpectEXI = 0;
  190. }
  191. };
  192. struct DetCalibInfo
  193. {
  194. int nDetCalibNodeCount;
  195. DetCalibNodeInfo* pDetCalibNodeInfo;
  196. DetCalibInfo()
  197. {
  198. nDetCalibNodeCount = 0;
  199. pDetCalibNodeInfo = nullptr;
  200. }
  201. };
  202. struct DeviceIndexStruct
  203. {
  204. bool bPreviewEnable;
  205. bool bInitOK;
  206. bool bConnectStatus;
  207. bool bModuleEnable;
  208. bool bExisted;
  209. bool bEventReturn;
  210. bool bSetCorrection;
  211. bool bReadWifi;
  212. bool bHallSensor;
  213. bool bReadTemperature;
  214. bool bReadBattery;
  215. bool bWriteROM;
  216. bool bTaskEnd;
  217. bool bCharging;
  218. bool bOffsetOver;
  219. bool bUpdateFirmware;
  220. bool bUploadCalibFile;
  221. bool bRecoveringImage;
  222. bool bWireless;
  223. bool bLivingTime;
  224. bool bImagePending;
  225. bool bConnectChanged;
  226. bool bActived;
  227. int nFrameCount;
  228. int nSyncMode;
  229. int nPanelExpWindowMode;
  230. int nSaturationValue;
  231. int nPanelID;
  232. int nDoseOfEXI;
  233. int nRequirehwMode;
  234. int nWorkstation;
  235. int nWifiWarning;
  236. int nWifiLimit;
  237. int nCurrentWifiValue;
  238. int nBatteryWarning;
  239. int nBatteryLimit;
  240. int nCurrentBatteryValue;
  241. int nShockTimes;
  242. int nWifiChannel;
  243. int nWifiDataRate;
  244. int nWifiSignalPower;
  245. int nWifiNoisePower;
  246. int nCalibDueSetting;
  247. int nMaxShockNumber;
  248. int nForceGridSuppress;
  249. int nGridSuppressed;
  250. float fGridSuppressParam1;
  251. float fGridSuppressParam2;
  252. float fGridSuppressParam3;
  253. float fGridSuppressParam4;
  254. float fGridSuppressParam5;
  255. float fGridSuppressParam6;
  256. float fGridSuppressParam7;
  257. float fGridSuppressParam8;
  258. float fGridSuppressParam9;
  259. float fCalibTemperature;
  260. float fCalibTemperature1;
  261. float fCalibTemperature2;
  262. float fLTEthreshold;
  263. int nSaveRaw;
  264. int nSID;
  265. //ECM信息相关
  266. int nImageBits;
  267. int nRawWidth;
  268. int nRawHeight;
  269. int nFullImageWidth;
  270. int nFullImageHeight;
  271. int nPreviewWidth;
  272. int nPreviewHeight;
  273. int nWidthOffset;
  274. int nHeightOffset;
  275. int nImageTopffset;
  276. int nImageRightOffset;
  277. int nImageBottomOffset;
  278. int nImageLeftOffset;
  279. int nGridSuppFilterType;
  280. int nLifeTime;
  281. int nPowerOn;
  282. int nFirmwareStatus;
  283. int nLastImageID;
  284. float fFactorEXI2UGY; //探测器EXI -> UGY 转换系数
  285. float fTemperMaxLimit; //高温极限错误值
  286. float fTemperUpperLimit; //高温报警值
  287. float fTemperLowLimit; //低温报警值
  288. float fTemperMinLimit; //低温极限错误值
  289. float fCurrentTemperValue;
  290. int nTemperatureStatus;
  291. int nPixelSpace; //像素大小
  292. std::string strLastCalibrationDate; //上一次校正日期时间
  293. std::string strCalibrationFileExpireTime; //校正文件过期天数
  294. std::string strDeviceName; //探测器名称
  295. std::string strPartNumber;
  296. std::string strWifiSSID;
  297. std::string strPanelSerial;
  298. std::string strFPDConfFilePath;//探测器自身配置文件路径
  299. std::string strIPAddress;
  300. std::string strCalibrationDate; //校正日期
  301. std::string strCalibrationDue;
  302. std::string strFirmware;
  303. std::string strSoftware;
  304. std::string strWorkDir; //SDK配置文件路径
  305. std::string strWorkstation; //工作位
  306. DeviceIndexStruct()
  307. {
  308. bConnectStatus = false;
  309. bExisted = false;
  310. bInitOK = false;
  311. bModuleEnable = false;
  312. bEventReturn = false;
  313. bSetCorrection = false;
  314. bReadWifi = false;
  315. bHallSensor = false;
  316. bReadTemperature = false;
  317. bReadBattery = false;
  318. bWriteROM = false;
  319. bTaskEnd = true;
  320. bCharging = false;
  321. bOffsetOver = false;
  322. bUpdateFirmware = false;
  323. bUploadCalibFile = false;
  324. bRecoveringImage = false;
  325. bWireless = false;
  326. bLivingTime = false;
  327. bImagePending = false;
  328. bConnectChanged = false;
  329. bActived = true;
  330. nFrameCount = 0;
  331. strLastCalibrationDate = "0000-00-00 00:00:00";
  332. strCalibrationFileExpireTime = "365";
  333. strDeviceName = ""; //探测器名称
  334. strWifiSSID = "NULL"; //探测器名称
  335. nSyncMode = 0;
  336. nPanelExpWindowMode = 0;
  337. nSaturationValue = 0;
  338. nGridSuppressed = 0;
  339. nPanelID = 0;
  340. nDoseOfEXI = 0;
  341. nRequirehwMode = 0;
  342. strPanelSerial = "";
  343. strFPDConfFilePath = ""; //探测器自身配置文件路径
  344. strCalibrationDate = ("0");
  345. strCalibrationDue = ("0");
  346. fFactorEXI2UGY = 0.0;
  347. bPreviewEnable = false;
  348. fTemperMaxLimit = 0.0;
  349. fTemperUpperLimit = 0.0;
  350. fTemperLowLimit = 0.0;
  351. fTemperMinLimit = 0.0;
  352. fCalibTemperature = 0.0;
  353. fCalibTemperature1 = 0.0;
  354. fCalibTemperature2 = 0.0;
  355. fCurrentTemperValue = 0.0;
  356. nWorkstation = -1;
  357. nWifiWarning = 0;
  358. nWifiLimit = 0;
  359. nCurrentWifiValue = -1;
  360. nBatteryWarning = 0;
  361. nBatteryLimit = 0;
  362. nCurrentBatteryValue = 0;
  363. nGridSuppFilterType = 0;
  364. nShockTimes = -1;
  365. nWifiChannel = 0;
  366. nWifiDataRate = 0;
  367. nWifiSignalPower = 0;
  368. nWifiNoisePower = 0;
  369. nCalibDueSetting = 0;
  370. nMaxShockNumber = 0;
  371. nForceGridSuppress = 0;
  372. nGridSuppressed = 0;
  373. fGridSuppressParam1 = 0.0;
  374. fGridSuppressParam2 = 0.0;
  375. fGridSuppressParam3 = 0.0;
  376. fGridSuppressParam4 = 0.0;
  377. fGridSuppressParam5 = 0.0;
  378. fGridSuppressParam6 = 0.0;
  379. fGridSuppressParam7 = 0.0;
  380. fGridSuppressParam8 = 0.0;
  381. fGridSuppressParam9 = 0.0;
  382. fLTEthreshold = 450.0;
  383. nSaveRaw = 0;
  384. nSID = 0;
  385. nPixelSpace = 143;
  386. //ECM信息相关
  387. nImageBits = 0;
  388. nRawWidth = 0;
  389. nRawHeight = 0;
  390. nFullImageWidth = 0;
  391. nFullImageHeight = 0;
  392. nPreviewWidth = 0;
  393. nPreviewHeight = 0;
  394. nWidthOffset = 0;
  395. nHeightOffset = 0;
  396. nLifeTime = 0;
  397. nPowerOn = 0;
  398. nFirmwareStatus = -1;
  399. nTemperatureStatus = 0;
  400. nLastImageID = 0;
  401. strWorkstation = "Table";
  402. }
  403. };
  404. typedef enum
  405. {
  406. FD_INIT_NULL = -1,
  407. FD_INIT_FAILED = 0,
  408. FD_INIT_SUCCESS = 1,
  409. }fd_init_status;
  410. enum
  411. {
  412. GRID_CONF_AUTO = 0,
  413. GRID_CONF_YES = 1,
  414. GRID_CONF_NO = 2,
  415. };
  416. enum
  417. {
  418. GRID_STATE_ERROR = -3,
  419. GRID_STATE_PARAM_ERROR = -2,
  420. GRID_STATE_PARAM_NULL = -1,
  421. GRID_STATE_NO = 0,
  422. GRID_STATE_VERTICAL = 1,
  423. GRID_STATE_HORIZONTAL = 2,
  424. };
  425. enum TEMP_STATUS
  426. {
  427. TEMP_NORMAL = 0,
  428. TEMP_WARNING, //1
  429. TEMP_TOO_HIGH, //2
  430. TEMP_TOO_LOW, //3
  431. };
  432. enum APP_STATUS
  433. {
  434. APP_STATUS_IDLE = 0,
  435. APP_STATUS_WORK_BEGIN, //1
  436. APP_STATUS_WORK_END, //2
  437. APP_STATUS_DETSHARE_BEGIN, //3
  438. APP_STATUS_DETSHAR_END, //4
  439. APP_STATUS_CAL_BEGIN, //5
  440. APP_STATUS_CAL_END, // 6
  441. APP_STATUS_WORK_IN_SENSITIVITY, //7
  442. APP_STATUS_MAX,
  443. };
  444. #pragma endregion DEFINITION