DetectorCtrlDefinition.h 11 KB

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