DetectorCtrlDefinition.h 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  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. EVT_STATUS_SLEEP = 0x19,
  96. EVT_AUTONUMOUS_STATUS = 0x20,
  97. EVT_PROBE_TYPE = 0x21,
  98. } CcosEventStatusID;
  99. typedef enum
  100. {
  101. EVT_DATA_RAW_IMAGE = 0x00,
  102. EVT_DATA_PREVIEW_IMAGE = 0x01,
  103. EVT_DATA_DOSEPARAM = 0x02,
  104. } CcosEventDataID;
  105. typedef enum
  106. {
  107. EVT_ERR_COMMUNICATE = 0x00,
  108. EVT_ERR_EXP_REQUEST = 0x01,
  109. EVT_ERR_GET_IMAGE = 0x02,
  110. EVT_ERR_MAX_NUMBER = 0x03,
  111. EVT_ERR_SN_NOTINLIST = 0x04,
  112. EVT_ERR_POWER_OFF = 0x05,
  113. EVT_ERR_INIT_FAILED = 0x06,
  114. } CcosEventErrorID;
  115. enum ENUM_PANEL_RESET
  116. {
  117. PANEL_RESET_BEGIN = 1, //
  118. PANEL_RESET_OK = 2, //
  119. PANEL_RESET_ERROR = 3
  120. };
  121. //探测器状态
  122. enum ENUM_PANEL_STATUS
  123. {
  124. PANEL_CLOSE = 0,
  125. PANEL_STANDBY = 1,
  126. PANEL_READY_EXP = 2,
  127. PANEL_XWINDOW_ON = 3,
  128. PANEL_XWINDOW_OFF = 4,
  129. PANEL_START_TRANSMIT = 5,
  130. PANEL_END_TRANSMIT = 6,
  131. PANEL_START_ACQ = 7,
  132. PANEL_END_ACQ = 8,
  133. PANEL_EXP_END_TIMEOUT = 9,
  134. PANEL_OFFSET_CAL = 10,
  135. PANEL_OFFSET_FINISH = 11,
  136. PANEL_GAIN_CAL = 12,
  137. PANEL_GAIN_FINISH = 13,
  138. PANEL_DEFECT_CAL = 14,
  139. PANEL_DEFECT_FINISH = 15,
  140. PANEL_XRAY_ON = 16,
  141. PANEL_XRAY_OFF = 17,
  142. PANEL_INIT = 21,
  143. PANEL_SLEEP = 22,
  144. PANEL_GET_IMAGE = 23,
  145. PANEL_GAIN_PREPARE = 24,
  146. PANEL_GAIN_READY_EXP = 25,
  147. };
  148. struct DeviceIndexStruct
  149. {
  150. bool bPreviewEnable;
  151. bool bInitOK;
  152. bool bConnectStatus;
  153. bool bModuleEnable;
  154. bool bExisted;
  155. bool bEventReturn;
  156. bool bSetCorrection;
  157. bool bReadWifi;
  158. bool bHallSensor;
  159. bool bReadTemperature;
  160. bool bReadBattery;
  161. bool bWriteROM;
  162. bool bTaskEnd;
  163. bool bCharging;
  164. bool bOffsetOver;
  165. bool bUpdateFirmware;
  166. bool bUploadCalibFile;
  167. bool bRecoveringImage;
  168. bool bWireless;
  169. bool bLivingTime;
  170. bool bImagePending;
  171. bool bConnectChanged;
  172. bool bActived;
  173. int HWindex;
  174. int Realindex;
  175. int nSyncMode;
  176. int nPanelExpWindowMode;
  177. int nSaturationValue;
  178. int nPanelID;
  179. int nDoseOfEXI;
  180. int nRequirehwMode;
  181. int nWorkstation;
  182. int nWifiWarning;
  183. int nWifiLimit;
  184. int nCurrentWifiValue;
  185. int nBatteryWarning;
  186. int nBatteryLimit;
  187. int nCurrentBatteryValue;
  188. int nShockTimes;
  189. int nWifiChannel;
  190. int nWifiDataRate;
  191. int nWifiSignalPower;
  192. int nWifiNoisePower;
  193. int nCalibDueSetting;
  194. int nMaxShockNumber;
  195. int nForceGridSuppress;
  196. int nTemperCheckTimeConf;
  197. float fTemperatureMin;
  198. float fTemperatureMax;
  199. float fGradientMean;
  200. float fGradientStdDev;
  201. int nGridSuppressed;
  202. float fGridSuppressParam1;
  203. float fGridSuppressParam2;
  204. float fGridSuppressParam3;
  205. float fGridSuppressParam4;
  206. float fGridSuppressParam5;
  207. float fGridSuppressParam6;
  208. float fGridSuppressParam7;
  209. float fGridSuppressParam8;
  210. float fGridSuppressParam9;
  211. float fCalibTemperature;
  212. float fCalibTemperature1;
  213. float fCalibTemperature2;
  214. float fLTEthreshold;
  215. int nSaveRaw;
  216. int nSID;
  217. //ECM信息相关
  218. int nImageBits;
  219. int nRawWidth;
  220. int nRawHeight;
  221. int nFullImageWidth;
  222. int nFullImageHeight;
  223. int nPreviewWidth;
  224. int nPreviewHeight;
  225. int nWidthOffset;
  226. int nHeightOffset;
  227. int nImageTopffset;
  228. int nImageRightOffset;
  229. int nImageBottomOffset;
  230. int nImageLeftOffset;
  231. int nGridSuppFilterType;
  232. int nLifeTime;
  233. int nPowerOn;
  234. int nFirmwareStatus;
  235. int nTemperatureStatus;
  236. int nLastImageID;
  237. float fFactorEXI2UGY; //探测器EXI -> UGY 转换系数
  238. float fTemperWarning;
  239. float fTemperMaxLimit;
  240. float fTemperLowLimit;
  241. float fTemperMinLimit;
  242. float fCurrentTemperValue;
  243. int nPixelSpace; //像素大小
  244. std::string strAppConfFilePath; //配置文件路径
  245. std::string strDeviceName; //探测器名称
  246. std::string strPartNumber;
  247. std::string strWifiSSID;
  248. std::string strPanelSerial;
  249. std::string strFPDConfFilePath;//探测器自身配置文件路径
  250. std::string strIPAddress;
  251. std::string strCalibrationDate; //校正日期
  252. std::string strCalibrationDue;
  253. std::string strCalibrationLTEDate; //LTE校正日期
  254. std::string strCalibrationLTEDue;
  255. std::string strInterfaceBoard;
  256. std::string strDateCode;
  257. std::string strFirmware;
  258. std::string strSoftware;
  259. std::string strWorkDir; //SDK配置文件路径
  260. DeviceIndexStruct()
  261. {
  262. bConnectStatus = false;
  263. bExisted = false;
  264. bInitOK = false;
  265. bModuleEnable = false;
  266. bEventReturn = false;
  267. bSetCorrection = false;
  268. bReadWifi = false;
  269. bHallSensor = false;
  270. bReadTemperature = false;
  271. bReadBattery = false;
  272. bWriteROM = false;
  273. bTaskEnd = true;
  274. bCharging = false;
  275. bOffsetOver = false;
  276. bUpdateFirmware = false;
  277. bUploadCalibFile = false;
  278. bRecoveringImage = false;
  279. bWireless = false;
  280. bLivingTime = false;
  281. bImagePending = false;
  282. bConnectChanged = false;
  283. bActived = true;
  284. Realindex = 0;
  285. HWindex = 0;
  286. strAppConfFilePath = ""; //配置文件路径
  287. strDeviceName = ""; //探测器名称
  288. strWifiSSID = "NULL"; //探测器名称
  289. nSyncMode = 0;
  290. nPanelExpWindowMode = 0;
  291. nSaturationValue = 0;
  292. nGridSuppressed = 0;
  293. nPanelID = 0;
  294. nDoseOfEXI = 0;
  295. nRequirehwMode = 0;
  296. strPanelSerial = "";
  297. strFPDConfFilePath = "";//探测器自身配置文件路径
  298. strCalibrationDate = ("0");
  299. strCalibrationDue = ("0");
  300. strCalibrationLTEDate = ("0");
  301. strCalibrationLTEDue = ("0");
  302. fFactorEXI2UGY = 0.0;
  303. bPreviewEnable = false;
  304. fTemperWarning = 0.0;
  305. fTemperMaxLimit = 0.0;
  306. fTemperLowLimit = 0.0;
  307. fTemperMinLimit = 0.0;
  308. fCalibTemperature = 0.0;
  309. fCalibTemperature1 = 0.0;
  310. fCalibTemperature2 = 0.0;
  311. fCurrentTemperValue = 0.0;
  312. nWorkstation = -1;
  313. nWifiWarning = 0;
  314. nWifiLimit = 0;
  315. nCurrentWifiValue = -1;
  316. nBatteryWarning = 0;
  317. nBatteryLimit = 0;
  318. nCurrentBatteryValue = 0;//fixbug 9728泰雷兹探测器电量为0时不给这个值赋值,西门子还是想要0
  319. nGridSuppFilterType = 0;
  320. nShockTimes = -1;
  321. nWifiChannel = 0;
  322. nWifiDataRate = 0;
  323. nWifiSignalPower = 0;
  324. nWifiNoisePower = 0;
  325. nCalibDueSetting = 0;
  326. nMaxShockNumber = 0;
  327. nForceGridSuppress = 0;
  328. nTemperCheckTimeConf = 0;
  329. fTemperatureMin = 0.0;
  330. fTemperatureMax = 0.0;
  331. fGradientMean = 0.0;
  332. fGradientStdDev = 0.0;
  333. nGridSuppressed = 0;
  334. fGridSuppressParam1 = 0.0;
  335. fGridSuppressParam2 = 0.0;
  336. fGridSuppressParam3 = 0.0;
  337. fGridSuppressParam4 = 0.0;
  338. fGridSuppressParam5 = 0.0;
  339. fGridSuppressParam6 = 0.0;
  340. fGridSuppressParam7 = 0.0;
  341. fGridSuppressParam8 = 0.0;
  342. fGridSuppressParam9 = 0.0;
  343. fLTEthreshold = 450.0;
  344. nSaveRaw = 0;
  345. nSID = 0;
  346. nPixelSpace = 143;
  347. //ECM信息相关
  348. nImageBits = 0;
  349. nRawWidth = 0;
  350. nRawHeight = 0;
  351. nFullImageWidth = 0;
  352. nFullImageHeight = 0;
  353. nPreviewWidth = 0;
  354. nPreviewHeight = 0;
  355. nWidthOffset = 0;
  356. nHeightOffset = 0;
  357. nLifeTime = 0;
  358. nPowerOn = 0;
  359. nFirmwareStatus = -1;
  360. nTemperatureStatus = 0;
  361. nLastImageID = 0;
  362. }
  363. };
  364. typedef enum
  365. {
  366. FD_INIT_NULL = -1,
  367. FD_INIT_FAILED = 0,
  368. FD_INIT_SUCCESS = 1,
  369. }fd_init_status;
  370. enum TEMP_STATUS
  371. {
  372. TEMP_NORMAL = 0,
  373. TEMP_WARNING, //1
  374. TEMP_TOO_HIGH, //2
  375. TEMP_TOO_LOW, //3
  376. };
  377. enum APP_STATUS
  378. {
  379. APP_STATUS_IDLE = 0,
  380. APP_STATUS_WORK_BEGIN, //1
  381. APP_STATUS_WORK_END, //2
  382. APP_STATUS_DETSHARE_BEGIN, //3
  383. APP_STATUS_DETSHAR_END, //4
  384. APP_STATUS_CAL_BEGIN, //5
  385. APP_STATUS_CAL_END, // 6
  386. APP_STATUS_WORK_IN_SENSITIVITY, //7
  387. APP_STATUS_MAX,
  388. };
  389. enum INIT_RESULT
  390. {
  391. INIT_FAILED,
  392. INIT_CONNECT_ERR,
  393. INIT_SUCCESS,
  394. INIT_RESULT_MAX,
  395. };
  396. enum DPC_State
  397. {
  398. DPC_STATE_INIT = 0,
  399. DPC_STATE_STANDBY,
  400. DPC_STATE_WORK,
  401. DPC_STATE_CALIBRATION,
  402. DPC_STATE_EXIT,
  403. DPC_STATE_MAX,
  404. };
  405. #pragma endregion DEFINITION