DetectorCtrlDefinition.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  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. };
  20. enum ENUM_EXPOSE_STATUS
  21. {
  22. DOSE_ACCEPT = 0,
  23. DOSE_TOO_HIGH = 1,
  24. DOSE_TOO_LOW = 2,
  25. DOSE_OBJECT = 3
  26. };
  27. typedef enum
  28. {
  29. EVT_LEVEL_CONFIGURATION = 0x00,
  30. EVT_LEVEL_INFORMATOION = 0x01,
  31. EVT_LEVEL_STATUS = 0x02,
  32. EVT_LEVEL_DATA = 0x03,
  33. EVT_LEVEL_WARNING = 0x04,
  34. EVT_LEVEL_ERROR = 0x05,
  35. } CcosEventLevel;
  36. typedef enum
  37. {
  38. EVT_CONF_PANEL_SERIAL = 0x00,
  39. EVT_CONF_RAW_WIDTH = 0x01,
  40. EVT_CONF_RAW_HIGHT = 0x02,
  41. EVT_CONF_RAW_BITS = 0x03,
  42. EVT_CONF_PIXELSPACE = 0x04,
  43. EVT_CONF_PREVIEW_WIDTH = 0x05,
  44. EVT_CONF_PREVIEW_HIGHT = 0x06,
  45. EVT_CONF_MODULE_TYPE = 0x07,
  46. EVT_CONF_MODULE_IP = 0x08,
  47. EVT_CONF_MODULE_SN = 0x09,
  48. EVT_CONF_FIRWARE_UPDATE = 0x0A,
  49. EVT_CONF_PART_NUMBER = 0x0B,
  50. EVT_CONF_BATTERY_SN = 0x0C,
  51. EVT_CONF_WIFI_SSID = 0x0D,
  52. EVT_CONF_IFBOARD = 0x0E,
  53. EVT_CONF_DATECODE = 0x0F,
  54. EVT_CONF_LIFETIME = 0x10,
  55. } CcosEventConfigID;
  56. typedef enum
  57. {
  58. EVT_INFO_POWER_ON = 0x00,
  59. EVT_INFO_BATTERY_CAPACITY = 0x01,
  60. EVT_INFO_BATTERY_TEMPERATURE = 0x02,
  61. EVT_INFO_BATTERY_CHARGES = 0x03,
  62. EVT_INFO_WIFI_DATARATE = 0x04,
  63. EVT_INFO_WIFI_CHANNEL = 0x05,
  64. EVT_INFO_WIFI_SIGNALPOWER = 0x06,
  65. EVT_INFO_WIFI_NOISEPOWER = 0x07,
  66. EVT_INFO_FIRMWARE = 0x08,
  67. EVT_INFO_SHOCKSENSOR_INFO = 0x09,
  68. EVT_INFO_CALIBRATIOIN_TIME = 0x0A,
  69. EVT_INFO_FPVOLTAGE = 0x0B,
  70. EVT_INFO_CALIBRATIOIN_TIMEL = 0x0C, //长曝光模式
  71. } CcosEventInfoID;
  72. typedef enum
  73. {
  74. EVT_STATUS_INIT = 0x00,
  75. EVT_STATUS_MOTION = 0x01,
  76. EVT_STATUS_UPDATE_FIRMWARE = 0x02,
  77. EVT_STATUS_SELFTEST = 0x03,
  78. EVT_STATUS_DETECTORSHARE = 0x04,
  79. EVT_STATUS_SINGLEINIT = 0x05,
  80. EVT_STATUS_SELECTPANEL = 0x06,
  81. EVT_STATUS_PANEL = 0x07,
  82. EVT_STATUS_CALIBRATIOIN = 0x08,
  83. EVT_STATUS_SAVECALIB = 0x09,
  84. EVT_STATUS_SAVEDEFECT = 0x0A,
  85. EVT_STATUS_ACQUISITION = 0x0B,
  86. EVT_STATUS_SINGLEEXP = 0x0C,
  87. EVT_STATUS_IMAGEPENDING = 0x0D,
  88. EVT_STATUS_TEMPERATURE = 0x0E,
  89. EVT_STATUS_WIFI = 0x0F,
  90. EVT_STATUS_BATTERY_VALUE = 0x10,
  91. EVT_STATUS_BATTERY_CHARGING = 0x11,
  92. EVT_STATUS_SHOCK_SENSOR = 0x12,
  93. EVT_STATUS_HALL_SENSOR = 0x13,
  94. EVT_STATUS_PING = 0x14,
  95. EVT_STATUS_PMSNOTOPEN = 0x15,
  96. EVT_STATUS_RESTOREFILES = 0x16,
  97. EVT_STATUS_LASTERROR = 0x17,
  98. EVT_STATUS_RESET = 0x18,
  99. EVT_STATUS_SLEEP = 0x19,
  100. EVT_AUTONUMOUS_STATUS = 0x20,
  101. } CcosEventStatusID;
  102. typedef enum
  103. {
  104. EVT_DATA_RAW_IMAGE = 0x00,
  105. EVT_DATA_PREVIEW_IMAGE = 0x01,
  106. EVT_DATA_DOSEPARAM = 0x02,
  107. } CcosEventDataID;
  108. typedef enum
  109. {
  110. EVT_ERR_COMMUNICATE = 0x00,
  111. EVT_ERR_EXP_REQUEST = 0x01,
  112. EVT_ERR_GET_IMAGE = 0x02,
  113. EVT_ERR_MAX_NUMBER = 0x03,
  114. EVT_ERR_SN_NOTINLIST = 0x04,
  115. EVT_ERR_POWER_OFF = 0x05,
  116. EVT_ERR_INIT_FAILED = 0x06,
  117. } CcosEventErrorID;
  118. enum ENUM_PANEL_RESET
  119. {
  120. PANEL_RESET_BEGIN = 1,
  121. PANEL_RESET_OK = 2,
  122. PANEL_RESET_ERROR = 3
  123. };
  124. //探测器状态
  125. enum ENUM_PANEL_STATUS
  126. {
  127. PANEL_CLOSE,
  128. PANEL_CONNECT,
  129. PANEL_STANDBY,
  130. PANEL_READY_EXP,
  131. PANEL_XWINDOW_ON,
  132. PANEL_XWINDOW_OFF,
  133. PANEL_START_TRANSMIT,
  134. PANEL_END_TRANSMIT,
  135. PANEL_START_ACQ,
  136. PANEL_END_ACQ,
  137. PANEL_EXP_END_TIMEOUT,
  138. PANEL_OFFSET_CAL,
  139. PANEL_OFFSET_FINISH,
  140. PANEL_GAIN_CAL,
  141. PANEL_GAIN_FINISH,
  142. PANEL_DEFECT_CAL,
  143. PANEL_DEFECT_FINISH,
  144. PANEL_XRAY_ON,
  145. PANEL_XRAY_OFF,
  146. PANEL_INIT = 21,
  147. PANEL_SLEEP,
  148. PANEL_GET_IMAGE,
  149. PANEL_GAIN_PREPARE,
  150. PANEL_GAIN_READY_EXP
  151. };
  152. struct DeviceIndexStruct
  153. {
  154. bool bPreviewEnable;
  155. bool bInitOK;
  156. bool bConnectStatus;
  157. bool bModuleEnable;
  158. bool bExisted;
  159. bool bEventReturn;
  160. bool bSetCorrection;
  161. bool bReadWifi;
  162. bool bHallSensor;
  163. bool bReadTemperature;
  164. bool bReadBattery;
  165. bool bWriteROM;
  166. bool bTaskEnd;
  167. bool bCharging;
  168. bool bOffsetOver;
  169. bool bUpdateFirmware;
  170. bool bUploadCalibFile;
  171. bool bRecoveringImage;
  172. bool bWireless;
  173. bool bLivingTime;
  174. bool bImagePending;
  175. bool bConnectChanged;
  176. bool bActived;
  177. int HWindex;
  178. int Realindex;
  179. int nSyncMode;
  180. int nPanelExpWindowMode;
  181. int nSaturationValue;
  182. int nPanelID;
  183. int nDoseOfEXI;
  184. int nRequirehwMode;
  185. int nWorkstation;
  186. int nSaveRaw;
  187. int nSID;
  188. int nShockTimes;
  189. int nMaxShockNumber;
  190. //温度、电量、wifi
  191. int nNotifyStatusTimePeriod;//通知状态信息时间间隔,从模型文件中读取
  192. int nWifiChannel;
  193. int nWifiDataRate;
  194. int nWifiSignalPower;
  195. int nWifiNoisePower;
  196. int nWifiWarning;//低信号警告
  197. int nWifiLimit;//最低信号值
  198. int nCurrentWifiValue;//当前wifi信号值
  199. int nBatteryWarning;//低电量警告
  200. int nBatteryLimit;//最低电量限制
  201. int nBatLowerLimitInCali;
  202. int nCurrentBatteryValue;//当前电量
  203. float fTemperatureErrorMin;//最低温度值
  204. float fTemperatureErrorMax;//最高温度值
  205. float fTemperatureWarnMin;//低温警告
  206. float fTemperatureWarnMax;//高温警告
  207. float fCurrentTemperValue;//当前温度
  208. //栅相关
  209. int nForceGridSuppress;
  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. //ECM信息相关
  221. int nImageBits;
  222. int nRawWidth;
  223. int nRawHeight;
  224. int nFullImageWidth;
  225. int nFullImageHeight;
  226. int nMaxImgHeight;
  227. int nMaxImgWidth;
  228. int nPreviewWidth;
  229. int nPreviewHeight;
  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. int nPixelSpace;
  243. std::string strAppConfFilePath; //配置文件路径
  244. std::string strDeviceName; //探测器名称
  245. std::string strPartNumber;
  246. std::string strWifiSSID;
  247. std::string strPanelSerial;
  248. std::string strFPDConfFilePath;//探测器自身配置文件路径
  249. std::string strDetectorWiredIP;
  250. std::string strDetectorWirelessIP;
  251. std::string strLocalIP;
  252. std::string strCalibrationDate; //校正日期
  253. std::string strCalibrationDue;
  254. std::string strCalibrationLTEDate; //LTE校正日期
  255. std::string strCalibrationLTEDue;
  256. std::string strInterfaceBoard;
  257. std::string strDateCode;
  258. std::string strFirmware;
  259. std::string strSoftware;
  260. std::string strWorkDir; //SDK配置文件路径
  261. std::string strSupportSyncMode;
  262. std::string strShowTemperature;
  263. std::string strShowWifi;
  264. std::string strShowBattery;
  265. std::string strShowBluetooth;
  266. std::string strLastCalibrationDate;
  267. std::string strCalibrationFileExpireTime;
  268. std::string strCalibrationFileExpirationReminder;
  269. bool bSupportDDR; //是否支持DDR采集模式
  270. int nOffsetInterval;//offset刷新间隔 单位(分钟)
  271. int nDetectorWidth;
  272. int nDetectorHeight;
  273. int nCalibMode;
  274. int nReconnectTimePeriod;
  275. DeviceIndexStruct()
  276. {
  277. bPreviewEnable = false;
  278. bInitOK = false;
  279. bConnectStatus = false;
  280. bModuleEnable = false;
  281. bExisted = false;
  282. bEventReturn = false;
  283. bSetCorrection = false;
  284. bReadWifi = false;
  285. bHallSensor = false;
  286. bReadTemperature = false;
  287. bReadBattery = false;
  288. bWriteROM = false;
  289. bTaskEnd = false;
  290. bCharging = false;
  291. bOffsetOver = false;
  292. bUpdateFirmware = false;
  293. bUploadCalibFile = false;
  294. bRecoveringImage = false;
  295. bWireless = false;
  296. bLivingTime = false;
  297. bImagePending = false;
  298. bConnectChanged = false;
  299. bActived = false;
  300. HWindex = 0;
  301. Realindex = 0;
  302. nSyncMode = 0;
  303. nPanelExpWindowMode = 0;
  304. nSaturationValue = 0;
  305. nPanelID = 0;
  306. nDoseOfEXI = 0;
  307. nRequirehwMode = 0;
  308. nWorkstation = 0;
  309. nSaveRaw = 0;
  310. nSID = 0;
  311. nShockTimes = 0;
  312. nMaxShockNumber = 0;
  313. nNotifyStatusTimePeriod = 0;
  314. nWifiChannel = 0;
  315. nWifiDataRate = 0;
  316. nWifiSignalPower = 0;
  317. nWifiNoisePower = 0;
  318. nWifiWarning = 0;
  319. nWifiLimit = 0;
  320. nCurrentWifiValue = 0;
  321. nBatteryWarning = 0;
  322. nBatteryLimit = 0;
  323. nBatLowerLimitInCali = 0;
  324. nCurrentBatteryValue = 0;
  325. fTemperatureErrorMin = 0.0f;
  326. fTemperatureErrorMax = 0.0f;
  327. fTemperatureWarnMin = 0.0f;
  328. fTemperatureWarnMax = 0.0f;
  329. fCurrentTemperValue = 0.0f;
  330. nForceGridSuppress = 0;
  331. nGridSuppressed = 0;
  332. fGridSuppressParam1 = 0.0f;
  333. fGridSuppressParam2 = 0.0f;
  334. fGridSuppressParam3 = 0.0f;
  335. fGridSuppressParam4 = 0.0f;
  336. fGridSuppressParam5 = 0.0f;
  337. fGridSuppressParam6 = 0.0f;
  338. fGridSuppressParam7 = 0.0f;
  339. fGridSuppressParam8 = 0.0f;
  340. fGridSuppressParam9 = 0.0f;
  341. nImageBits = 0;
  342. nRawWidth = 0;
  343. nRawHeight = 0;
  344. nFullImageWidth = 0;
  345. nFullImageHeight = 0;
  346. nMaxImgHeight = 0;
  347. nMaxImgWidth = 0;
  348. nPreviewWidth = 0;
  349. nPreviewHeight = 0;
  350. nWidthOffset = 0;
  351. nHeightOffset = 0;
  352. nImageTopffset = 0;
  353. nImageRightOffset = 0;
  354. nImageBottomOffset = 0;
  355. nImageLeftOffset = 0;
  356. nGridSuppFilterType = 0;
  357. nLifeTime = 0;
  358. nPowerOn = 0;
  359. nFirmwareStatus = 0;
  360. nTemperatureStatus = 0;
  361. nLastImageID = 0;
  362. nPixelSpace = 0;
  363. strAppConfFilePath = ""; //配置文件路径
  364. strDeviceName = "";//探测器名称
  365. strPartNumber = "";
  366. strWifiSSID = "";
  367. strPanelSerial = "";
  368. strFPDConfFilePath = "";//探测器自身配置文件路径
  369. strDetectorWiredIP = "";
  370. strDetectorWirelessIP = "";
  371. strLocalIP = "";
  372. strCalibrationDate = ""; //校正日期
  373. strCalibrationDue = "";
  374. strCalibrationLTEDate = ""; //LTE校正日期
  375. strCalibrationLTEDue = "";
  376. strInterfaceBoard = "";
  377. strDateCode = "";
  378. strFirmware = "";
  379. strSoftware = "";
  380. strWorkDir = ""; //SDK配置文件路径
  381. strSupportSyncMode = "";
  382. strShowTemperature = "";
  383. strShowWifi = "";
  384. strShowBattery = "";
  385. strShowBluetooth = "";
  386. strLastCalibrationDate = "";
  387. strCalibrationFileExpireTime = "";
  388. strCalibrationFileExpirationReminder = "";
  389. bSupportDDR = false;
  390. nOffsetInterval = 30;
  391. nDetectorWidth = 0;
  392. nDetectorHeight = 0;
  393. nCalibMode = 0;
  394. nReconnectTimePeriod = 0;
  395. }
  396. };
  397. typedef enum
  398. {
  399. FD_INIT_NULL = -1,
  400. FD_INIT_FAILED = 0,
  401. FD_INIT_SUCCESS = 1,
  402. }fd_init_status;
  403. enum
  404. {
  405. GRID_CONF_AUTO = 0,
  406. GRID_CONF_YES = 1,
  407. GRID_CONF_NO = 2,
  408. };
  409. enum
  410. {
  411. GRID_STATE_ERROR = -3,
  412. GRID_STATE_PARAM_ERROR = -2,
  413. GRID_STATE_PARAM_NULL = -1,
  414. GRID_STATE_NO = 0,
  415. GRID_STATE_VERTICAL = 1,
  416. GRID_STATE_HORIZONTAL = 2,
  417. };
  418. enum TEMP_STATUS
  419. {
  420. TEMP_NORMAL = 0,
  421. TEMP_WARNING, //1
  422. TEMP_TOO_HIGH, //2
  423. TEMP_TOO_LOW, //3
  424. };
  425. enum APP_STATUS
  426. {
  427. APP_STATUS_IDLE = 0,
  428. APP_STATUS_WORK_BEGIN, //1
  429. APP_STATUS_WORK_END, //2
  430. APP_STATUS_DETSHARE_BEGIN, //3
  431. APP_STATUS_DETSHAR_END, //4
  432. APP_STATUS_CAL_BEGIN, //5
  433. APP_STATUS_CAL_END, // 6
  434. APP_STATUS_WORK_IN_SENSITIVITY, //7
  435. APP_STATUS_MAX,
  436. };
  437. #ifndef PZDR_INIT_RESULT
  438. #define PZDR_INIT_RESULT
  439. enum INIT_RESULT
  440. {
  441. INIT_FAILED,
  442. INIT_CONNECT_ERR,
  443. INIT_SUCCESS,
  444. INIT_RESULT_MAX,
  445. };
  446. #endif
  447. #ifndef PZDPC_STATE
  448. #define PZDPC_STATE
  449. enum PZDPC_State
  450. {
  451. PZDPC_STATE_INIT = 0,
  452. PZDPC_STATE_STANDBY,
  453. PZDPC_STATE_WORK,
  454. PZDPC_STATE_CALIBRATION,
  455. PZDPC_STATE_EXIT,
  456. PZDPC_STATE_MAX,
  457. };
  458. #endif
  459. // PZMedical校正过程
  460. enum PZ_CALIBRATION_State
  461. {
  462. PZ_CALIBRATION = 0,
  463. PZ_CALIBRATION_INIT,
  464. PZ_CALIBRATION_OFFSET,
  465. PZ_CALIBRATION_GAIN,
  466. PZ_CALIBRATION_MAX,
  467. };
  468. #pragma endregion DEFINITION