DetectorCtrlDefinition.h 11 KB

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