DetectorCtrlDefinition.h 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  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. AEC
  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_XRAY_ON = 16,
  146. PANEL_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. struct DeviceIndexStruct
  154. {
  155. bool bPreviewEnable;
  156. bool bInitOK;
  157. bool bConnectStatus;
  158. bool bModuleEnable;
  159. bool bExisted;
  160. bool bEventReturn;
  161. bool bSetCorrection;
  162. bool bReadWifi;
  163. bool bHallSensor;
  164. bool bReadTemperature;
  165. bool bReadBattery;
  166. bool bWriteROM;
  167. bool bTaskEnd;
  168. bool bCharging;
  169. bool bOffsetOver;
  170. bool bUpdateFirmware;
  171. bool bUploadCalibFile;
  172. bool bRecoveringImage;
  173. bool bWireless;
  174. bool bLivingTime;
  175. bool bImagePending;
  176. bool bConnectChanged;
  177. bool bActived;
  178. int HWindex;
  179. int Realindex;
  180. int nSyncMode;
  181. int nPanelExpWindowMode;
  182. int nSaturationValue;
  183. int nPanelID;
  184. int nDoseOfEXI;
  185. int nRequirehwMode;
  186. int nWorkstation;
  187. int nWifiWarning;
  188. int nWifiLimit;
  189. int nCurrentWifiValue;
  190. int nBatteryWarning;
  191. int nBatteryLimit;
  192. int nCurrentBatteryValue;
  193. int nShockTimes;
  194. int nWifiChannel;
  195. int nWifiDataRate;
  196. int nWifiSignalPower;
  197. int nWifiNoisePower;
  198. int nCalibDueSetting;
  199. int nMaxShockNumber;
  200. int nForceGridSuppress;
  201. int nTemperCheckTimeConf;
  202. float fGradientMean;
  203. float fGradientStdDev;
  204. int nGridSuppressed;
  205. float fGridSuppressParam1;
  206. float fGridSuppressParam2;
  207. float fGridSuppressParam3;
  208. float fGridSuppressParam4;
  209. float fGridSuppressParam5;
  210. float fGridSuppressParam6;
  211. float fGridSuppressParam7;
  212. float fGridSuppressParam8;
  213. float fGridSuppressParam9;
  214. float fCalibTemperature;
  215. float fCalibTemperature1;
  216. float fCalibTemperature2;
  217. float fLTEthreshold;
  218. int nSaveRaw;
  219. int nSID;
  220. //ECM信息相关
  221. int nImageBits;
  222. int nRawWidth;
  223. int nRawHeight;
  224. int nFullImageWidth;
  225. int nFullImageHeight;
  226. int nPreviewWidth;
  227. int nPreviewHeight;
  228. int nMaxImageWidth;
  229. int nMaxImageHeight;
  230. int nWidthOffset;
  231. int nHeightOffset;
  232. int nImageTopffset;
  233. int nImageRightOffset;
  234. int nImageBottomOffset;
  235. int nImageLeftOffset;
  236. int nGridSuppFilterType;
  237. int nLifeTime;
  238. int nPowerOn;
  239. int nFirmwareStatus;
  240. int nTemperatureStatus;
  241. int nLastImageID;
  242. float fFactorEXI2UGY; //探测器EXI -> UGY 转换系数
  243. float fTemperatureMin;
  244. float fTemperatureMax;
  245. float fTemperMaxLimit;//温度最高
  246. float fTemperUpperLimit;//温度警告
  247. float fTemperLowLimit;//低温警告
  248. float fTemperMinLimit;//温度最低
  249. float fCurrentTemperValue;//当前温度
  250. int nPixelSpace; //像素大小
  251. std::string strAppConfFilePath; //配置文件路径
  252. std::string strDeviceName; //探测器名称
  253. std::string strPartNumber;
  254. std::string strWifiSSID;
  255. std::string strPanelSerial;
  256. std::string strFPDConfFilePath;//探测器自身配置文件路径
  257. std::string strIPAddress;
  258. std::string strCalibrationDate; //校正日期
  259. std::string strCalibrationDue;
  260. std::string strCalibrationLTEDate; //LTE校正日期
  261. std::string strCalibrationLTEDue;
  262. std::string strInterfaceBoard;
  263. std::string strDateCode;
  264. std::string strFirmware;
  265. std::string strSoftware;
  266. std::string strWorkDir; //SDK配置文件路径
  267. DeviceIndexStruct()
  268. {
  269. bConnectStatus = false;
  270. bExisted = false;
  271. bInitOK = false;
  272. bModuleEnable = false;
  273. bEventReturn = false;
  274. bSetCorrection = false;
  275. bReadWifi = false;
  276. bHallSensor = false;
  277. bReadTemperature = false;
  278. bReadBattery = false;
  279. bWriteROM = false;
  280. bTaskEnd = true;
  281. bCharging = false;
  282. bOffsetOver = false;
  283. bUpdateFirmware = false;
  284. bUploadCalibFile = false;
  285. bRecoveringImage = false;
  286. bWireless = false;
  287. bLivingTime = false;
  288. bImagePending = false;
  289. bConnectChanged = false;
  290. bActived = true;
  291. Realindex = 0;
  292. HWindex = 0;
  293. strAppConfFilePath = ""; //配置文件路径
  294. strDeviceName = ""; //探测器名称
  295. strWifiSSID = "NULL"; //探测器名称
  296. nSyncMode = 0;
  297. nPanelExpWindowMode = 0;
  298. nSaturationValue = 0;
  299. nGridSuppressed = 0;
  300. nPanelID = 0;
  301. nDoseOfEXI = 0;
  302. nRequirehwMode = 0;
  303. strPanelSerial = "";
  304. strFPDConfFilePath = "";//探测器自身配置文件路径
  305. strCalibrationDate = ("0");
  306. strCalibrationDue = ("0");
  307. strCalibrationLTEDate = ("0");
  308. strCalibrationLTEDue = ("0");
  309. fFactorEXI2UGY = 0.0;
  310. bPreviewEnable = false;
  311. fTemperUpperLimit = 0.0f;
  312. fTemperMaxLimit = 0.0f;
  313. fTemperLowLimit = 0.0f;
  314. fTemperMinLimit = 0.0f;
  315. fCalibTemperature = 0.0f;
  316. fCalibTemperature1 = 0.0f;
  317. fCalibTemperature2 = 0.0f;
  318. fCurrentTemperValue = 0.0f;
  319. nWorkstation = -1;
  320. nWifiWarning = 0;
  321. nWifiLimit = 0;
  322. nCurrentWifiValue = -1;
  323. nBatteryWarning = 0;
  324. nBatteryLimit = 0;
  325. nCurrentBatteryValue = 0;//fixbug 9728泰雷兹探测器电量为0时不给这个值赋值,西门子还是想要0
  326. nGridSuppFilterType = 0;
  327. nShockTimes = -1;
  328. nWifiChannel = 0;
  329. nWifiDataRate = 0;
  330. nWifiSignalPower = 0;
  331. nWifiNoisePower = 0;
  332. nCalibDueSetting = 0;
  333. nMaxShockNumber = 0;
  334. nForceGridSuppress = 0;
  335. nTemperCheckTimeConf = 0;
  336. fTemperatureMin = 0.0;
  337. fTemperatureMax = 0.0;
  338. fGradientMean = 0.0;
  339. fGradientStdDev = 0.0;
  340. nGridSuppressed = 0;
  341. fGridSuppressParam1 = 0.0f;
  342. fGridSuppressParam2 = 0.0f;
  343. fGridSuppressParam3 = 0.0f;
  344. fGridSuppressParam4 = 0.0f;
  345. fGridSuppressParam5 = 0.0f;
  346. fGridSuppressParam6 = 0.0f;
  347. fGridSuppressParam7 = 0.0f;
  348. fGridSuppressParam8 = 0.0f;
  349. fGridSuppressParam9 = 0.0f;
  350. fLTEthreshold = 450.0f;
  351. nSaveRaw = 0;
  352. nSID = 0;
  353. nPixelSpace = 143;
  354. //ECM信息相关
  355. nImageBits = 0;
  356. nRawWidth = 0;
  357. nRawHeight = 0;
  358. nFullImageWidth = 0;
  359. nFullImageHeight = 0;
  360. nPreviewWidth = 0;
  361. nPreviewHeight = 0;
  362. nMaxImageWidth = 0;
  363. nMaxImageHeight = 0;
  364. nWidthOffset = 0;
  365. nHeightOffset = 0;
  366. nLifeTime = 0;
  367. nPowerOn = 0;
  368. nFirmwareStatus = -1;
  369. nTemperatureStatus = 0;
  370. nLastImageID = 0;
  371. }
  372. };
  373. typedef enum
  374. {
  375. FD_INIT_NULL = -1,
  376. FD_INIT_FAILED = 0,
  377. FD_INIT_SUCCESS = 1,
  378. }fd_init_status;
  379. enum
  380. {
  381. GRID_CONF_AUTO = 0,
  382. GRID_CONF_YES = 1,
  383. GRID_CONF_NO = 2,
  384. };
  385. enum
  386. {
  387. GRID_STATE_ERROR = -3,
  388. GRID_STATE_PARAM_ERROR = -2,
  389. GRID_STATE_PARAM_NULL = -1,
  390. GRID_STATE_NO = 0,
  391. GRID_STATE_VERTICAL = 1,
  392. GRID_STATE_HORIZONTAL = 2,
  393. };
  394. enum TEMP_STATUS
  395. {
  396. TEMP_NORMAL = 0,
  397. TEMP_WARNING, //1
  398. TEMP_TOO_HIGH, //2
  399. TEMP_TOO_LOW, //3
  400. };
  401. enum APP_STATUS
  402. {
  403. APP_STATUS_IDLE = 0,
  404. APP_STATUS_WORK_BEGIN, //1
  405. APP_STATUS_WORK_END, //2
  406. APP_STATUS_DETSHARE_BEGIN, //3
  407. APP_STATUS_DETSHAR_END, //4
  408. APP_STATUS_CAL_BEGIN, //5
  409. APP_STATUS_CAL_END, // 6
  410. APP_STATUS_WORK_IN_SENSITIVITY, //7
  411. APP_STATUS_MAX,
  412. };
  413. #ifndef PZDR_INIT_RESULT
  414. #define PZDR_INIT_RESULT
  415. enum INIT_RESULT
  416. {
  417. INIT_FAILED,
  418. INIT_CONNECT_ERR,
  419. INIT_SUCCESS,
  420. INIT_RESULT_MAX,
  421. };
  422. #endif // !PZDR_INIT_RESULT
  423. #ifndef PZDPC_STATE
  424. #define PZDPC_STATE
  425. enum PZDPC_State
  426. {
  427. PZDPC_STATE_INIT = 0,
  428. PZDPC_STATE_STANDBY,
  429. PZDPC_STATE_WORK,
  430. PZDPC_STATE_CALIBRATION,
  431. PZDPC_STATE_EXIT,
  432. PZDPC_STATE_MAX,
  433. };
  434. #endif
  435. // PZMedical校正过程
  436. enum PZ_CALIBRATION_State
  437. {
  438. PZ_CALIBRATION = 0,
  439. PZ_CALIBRATION_INIT,
  440. PZ_CALIBRATION_OFFSET,
  441. PZ_CALIBRATION_AED,
  442. PZ_CALIBRATION_GAIN,
  443. PZ_CALIBRATION_MAX,
  444. };
  445. #pragma endregion DEFINITION