DetectorCtrlDefinition.h 11 KB

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