DetectorDefinition.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. #pragma once
  2. #include <string>
  3. extern const char* DetStatus[];
  4. extern const char* DetErrorStatus[];
  5. extern const char* DetTriggerMode[];
  6. extern const char* DetBinningMode[];
  7. enum ENUM_EXPOSE_STATUS
  8. {
  9. DOSE_ACCEPT = 0,
  10. DOSE_TOO_HIGH = 1,
  11. DOSE_TOO_LOW = 2,
  12. DOSE_OBJECT = 3
  13. };
  14. //探测器异步事件状态
  15. enum ENUM_PANEL_EVENT_STATE
  16. {
  17. PANEL_EVENT_END_OK = 0,
  18. PANEL_EVENT_END_ERROR = 1,
  19. PANEL_EVENT_START = 2,
  20. PANEL_EVENT_SUCCESS = 3,
  21. PANEL_EVENT_END = 4,
  22. PANEL_EVENT_BEGIN = 5,
  23. PANEL_EVENT_TIMEOUT = 6,
  24. PANEL_EVENT_FWU_ERROR_BATTERY = 7,
  25. PANEL_EVENT_CALIB_REPORT = 8,
  26. PANEL_EVENT_FWU_ERROR_OMIT = 9,
  27. };
  28. typedef enum
  29. {
  30. EVT_LEVEL_CONFIGURATION = 0x00,
  31. EVT_LEVEL_INFORMATOION = 0x01,
  32. EVT_LEVEL_STATUS = 0x02,
  33. EVT_LEVEL_DATA = 0x03,
  34. EVT_LEVEL_WARNING = 0x04,
  35. EVT_LEVEL_ERROR = 0x05,
  36. } CcosEventLevel;
  37. typedef enum
  38. {
  39. EVT_CONF_PANEL_SERIAL = 0x00,
  40. EVT_CONF_RAW_WIDTH = 0x01,
  41. EVT_CONF_RAW_HIGHT = 0x02,
  42. EVT_CONF_RAW_BITS = 0x03,
  43. EVT_CONF_PIXELSPACE = 0x04,
  44. EVT_CONF_PREVIEW_WIDTH = 0x05,
  45. EVT_CONF_PREVIEW_HIGHT = 0x06,
  46. EVT_CONF_MODULE_TYPE = 0x07,
  47. EVT_CONF_MODULE_IP = 0x08,
  48. EVT_CONF_MODULE_SN = 0x09,
  49. EVT_CONF_FIRWARE_UPDATE = 0x0A,
  50. EVT_CONF_PART_NUMBER = 0x0B,
  51. EVT_CONF_BATTERY_SN = 0x0C,
  52. EVT_CONF_WIFI_SSID = 0x0D,
  53. EVT_CONF_IFBOARD = 0x0E,
  54. EVT_CONF_DATECODE = 0x0F,
  55. EVT_CONF_LIFETIME = 0x10,
  56. } CcosEventConfigID;
  57. typedef enum
  58. {
  59. EVT_INFO_POWER_ON = 0x00,
  60. EVT_INFO_BATTERY_CAPACITY = 0x01,
  61. EVT_INFO_BATTERY_TEMPERATURE = 0x02,
  62. EVT_INFO_BATTERY_CHARGES = 0x03,
  63. EVT_INFO_WIFI_DATARATE = 0x04,
  64. EVT_INFO_WIFI_CHANNEL = 0x05,
  65. EVT_INFO_WIFI_SIGNALPOWER = 0x06,
  66. EVT_INFO_WIFI_NOISEPOWER = 0x07,
  67. EVT_INFO_FIRMWARE = 0x08,
  68. EVT_INFO_SHOCKSENSOR_INFO = 0x09,
  69. EVT_INFO_CALIBRATIOIN_DATE = 0x0A,
  70. EVT_INFO_FPVOLTAGE = 0x0B,
  71. EVT_INFO_CALIBRATIOIN_DATEL = 0x0C, //长曝光模式
  72. EVT_INFO_CALIBRATIOIN_TIME = 0x0D,
  73. EVT_INFO_CALIBRATIOIN_TIMEL = 0x0E,
  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. EVT_STATUS_IMAGERECOVERAUTO = 0x19,
  103. EVT_STATUS_PREPARE_EDNCALIBRATION = 0x21,
  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. //探测器状态
  122. enum ENUM_PANEL_STATUS
  123. {
  124. PANEL_CLOSE = 0,
  125. PANEL_STANDBY = 1,
  126. PANEL_READY_EXP = 2,
  127. PANEL_XWINDOW_ON = 3,
  128. PANEL_XWINDOW_OFF = 4,
  129. PANEL_START_TRANSMIT = 5,
  130. PANEL_END_TRANSMIT = 6,
  131. PANEL_START_ACQ = 7,
  132. PANEL_END_ACQ = 8,
  133. PANEL_EXP_END_TIMEOUT = 9,
  134. PANEL_OFFSET_CAL = 10,
  135. PANEL_OFFSET_FINISH = 11,
  136. PANEL_GAIN_CAL = 12,
  137. PANEL_GAIN_FINISH = 13,
  138. PANEL_DEFECT_CAL = 14,
  139. PANEL_DEFECT_FINISH = 15,
  140. PANEL_INIT = 21,
  141. PANEL_SLEEP = 22,
  142. PANEL_GET_IMAGE = 23,
  143. PANEL_GAIN_PREPARE = 24,
  144. PANEL_GAIN_READY_EXP = 25,
  145. PANEL_OFFSET_FAILED = 26,
  146. PANEL_OFFSET_COUNT = 27,
  147. PANEL_OFFSET_PROGRESS = 28
  148. };
  149. //----------------------------------------------------
  150. enum CCOS_OFFSET_STAUTS
  151. {
  152. OFFSET_IDLE = 0,
  153. OFFSET_RUNNING = 1,
  154. OFFSET_ERROR = 2
  155. };
  156. struct DetCalibNodeInfo
  157. {
  158. int nCheckType; //0: EXI; 1: nGy; 2: uGy
  159. int nExpNum;
  160. float fDose;
  161. int KVP;
  162. int mA;
  163. int mS;
  164. float mAS;
  165. int FKVP;
  166. int FmA;
  167. int nMaxEXI;
  168. int nMinEXI;
  169. int nExpectEXI;
  170. DetCalibNodeInfo()
  171. {
  172. nCheckType = 0;
  173. nExpNum = 0;
  174. fDose = 0.0f;
  175. KVP = 0;
  176. mA = 0;
  177. mS = 0;
  178. mAS = 0.0f;
  179. FKVP = 0;
  180. FmA = 0;
  181. nMaxEXI = 0;
  182. nMinEXI = 0;
  183. nExpectEXI = 0;
  184. }
  185. };
  186. struct DetCalibInfo
  187. {
  188. int nDetCalibNodeCount;
  189. DetCalibNodeInfo* pDetCalibNodeInfo;
  190. DetCalibInfo()
  191. {
  192. nDetCalibNodeCount = 0;
  193. pDetCalibNodeInfo = nullptr;
  194. }
  195. };
  196. struct DetModeInfo
  197. {
  198. int nLogicMode; //采集模式
  199. std::string strExamType; //采集类型
  200. int nOperationMode; //SDK采集模式
  201. int nRawImgWidth; //全尺寸宽
  202. int nRawImgHeight; //全尺寸高
  203. int nImageWidth; //有效宽
  204. int nImageHeight; //有效高
  205. int nPhySizeInfoBit; //探测器位数
  206. int nImageLeftOffset; //左裁剪
  207. int nImageTopOffset; //上
  208. int nImageRightOffset; //右
  209. int nImageBottomOffset; //下
  210. bool bPreviewEnable; //动态不用
  211. int nPreviewWidth; //动态不用
  212. int nPreviewHeight; //动态不用
  213. int nPixelPitch; //像素间距
  214. int nSyncType; //同步模式
  215. int nCorrectionType; //校正策略
  216. int nBinningMode; //Binning模式
  217. int nZoomMode; //Zoom模式
  218. int nGainValue; //Gain模式
  219. int nFrequency; //帧率
  220. int nXwindow; //窗口大小
  221. int nReadoutTime; //读出时间
  222. int nFrameCount; //透视0, 点片1, 双能2
  223. int nTriggerType; //触发模式
  224. int nWorkStation; //工作位
  225. int nSensitivity; //单位: ugy
  226. int nExiThreshold; //EXI阈值
  227. int nRotateAngle; //旋转角度
  228. bool bOffsetEnable; //是否允许Offset
  229. bool bSaveRawEnable; //是否保存原始图
  230. DetModeInfo()
  231. {
  232. nLogicMode = 0;
  233. strExamType = "";
  234. nOperationMode = 0;
  235. nRawImgWidth = 0;
  236. nRawImgHeight = 0;
  237. nImageWidth = 0;
  238. nImageHeight = 0;
  239. nPhySizeInfoBit = 0;
  240. nImageLeftOffset = 0;
  241. nImageTopOffset = 0;
  242. nImageRightOffset = 0;
  243. nImageBottomOffset = 0;
  244. bPreviewEnable = false;
  245. nPreviewWidth = 0;
  246. nPreviewHeight = 0;
  247. nPixelPitch = 0;
  248. nSyncType = 0;
  249. nCorrectionType = 0;
  250. nBinningMode = 0;
  251. nZoomMode = 0;
  252. nGainValue = 0;
  253. nFrequency = 0;
  254. nXwindow = 0;
  255. nReadoutTime = 0;
  256. nFrameCount = 0;
  257. nTriggerType = 0;
  258. nWorkStation = 0;
  259. nSensitivity = 0;
  260. nExiThreshold = 0;
  261. nRotateAngle = 0;
  262. bOffsetEnable = false;
  263. bSaveRawEnable = false;
  264. }
  265. };
  266. struct DeviceIndexStruct
  267. {
  268. bool bInitOK;
  269. bool bConnectStatus;
  270. bool bExisted;
  271. bool bEventReturn;
  272. bool bSetCorrection;
  273. bool bWriteROM;
  274. bool bTaskEnd;
  275. bool bCharging;
  276. bool bUpdateFirmware;
  277. bool bUploadCalibFile;
  278. bool bRecoveringImage;
  279. bool bWireless;
  280. bool bImagePending;
  281. bool bConnectChanged;
  282. bool bPreviewEnable;
  283. bool bTemperatureEnable;
  284. bool bBatteryEnable;
  285. bool bWifiEnable;
  286. int nOffsetMode;
  287. int nSaturationValue;
  288. int nDoseOfEXI;
  289. int nWorkstation;
  290. int nWifiWarning;
  291. int nWifiLimit;
  292. int nCurrentWifiValue;
  293. int nBatteryWarning;
  294. int nBatteryLimit;
  295. int nCurrentBatteryValue;
  296. int nWifiChannel;
  297. int nWifiDataRate;
  298. int nWifiSignalPower;
  299. int nWifiNoisePower;
  300. int nCalibDueSetting;
  301. int nShockTimes;
  302. int nForceGridSuppress;
  303. int nGridSuppressed;
  304. float fGridSuppressParam1;
  305. float fGridSuppressParam2;
  306. float fGridSuppressParam3;
  307. float fGridSuppressParam4;
  308. float fGridSuppressParam5;
  309. float fGridSuppressParam6;
  310. float fGridSuppressParam7;
  311. float fGridSuppressParam8;
  312. float fGridSuppressParam9;
  313. float fCalibTemperature;
  314. float fCalibTemperature1;
  315. float fCalibTemperature2;
  316. int nSaveRaw;
  317. int nSID;
  318. DetModeInfo AcqModeInfo;
  319. //ECM信息相关
  320. int nImageBits;
  321. int nRawWidth;
  322. int nRawHeight;
  323. int nFullImageWidth;
  324. int nFullImageHeight;
  325. int nPreviewWidth;
  326. int nPreviewHeight;
  327. int nFirmwareStatus;
  328. int nTemperatureStatus;
  329. int nLastImageID;
  330. int nExpWindowMode;
  331. int nXWindow;
  332. float fFactorEXI2UGY; //探测器EXI -> UGY 转换系数
  333. //Temperature
  334. float fTemperMaxLimit;
  335. float fTemperUpLimit;
  336. float fTemperLowLimit;
  337. float fTemperMinLimit;
  338. float fCalibTemperUp;
  339. float fCalibTemperLow;
  340. float fCurrentTemperValue;
  341. std::string strDetectorModel; //探测器类型
  342. std::string strDeviceName; //探测器名称
  343. std::string strPartNumber;
  344. std::string strWifiSSID;
  345. std::string strPanelSerial;
  346. std::string strFPDConfFilePath;//探测器自身配置文件路径
  347. std::string strIPAddress; //探测器IP
  348. std::string strWiredIP; //有线IP
  349. std::string strWirelessIP; //无线IP
  350. std::string strLocalIP; //本地IP
  351. std::string strCalibrationDate; //校正日期
  352. std::string strCalibrationTime; //校正时间
  353. std::string strCalibrationDue; //校正过期日
  354. std::string strDateCode;
  355. std::string strFirmware;
  356. std::string strWorkDir; //SDK配置文件路径
  357. DeviceIndexStruct()
  358. {
  359. bInitOK = false;
  360. bConnectStatus = false;
  361. bExisted = false;
  362. bEventReturn = false;
  363. bSetCorrection = false;
  364. bWriteROM = false;
  365. bTaskEnd = true;
  366. bCharging = false;
  367. bUpdateFirmware = false;
  368. bUploadCalibFile = false;
  369. bRecoveringImage = false;
  370. bWireless = false;
  371. bImagePending = false;
  372. bConnectChanged = false;
  373. bTemperatureEnable = false;
  374. bBatteryEnable = false;
  375. bWifiEnable = false;
  376. strDetectorModel = ""; //探测器名称
  377. strDeviceName = ""; //探测器名称
  378. strWifiSSID = "NULL"; //无线探测器SSID名称
  379. nOffsetMode = 0;
  380. nSaturationValue = 0;
  381. nGridSuppressed = 0;
  382. nDoseOfEXI = 0;
  383. strPanelSerial = "";
  384. strFPDConfFilePath = "";//探测器自身配置文件路径
  385. strCalibrationDate = (" ");
  386. strCalibrationTime = (" ");
  387. strCalibrationDue = (" ");
  388. fFactorEXI2UGY = 0.0f;
  389. bPreviewEnable = false;
  390. fTemperMaxLimit = 0.0f;
  391. fTemperUpLimit = 0.0f;
  392. fTemperLowLimit = 0.0f;
  393. fTemperMinLimit = 0.0f;
  394. fCalibTemperUp = 0.0f;
  395. fCalibTemperLow = 0.0f;
  396. fCalibTemperature = 0.0f;
  397. fCalibTemperature1 = 0.0f;
  398. fCalibTemperature2 = 0.0f;
  399. fCurrentTemperValue = 0.0f;
  400. nWorkstation = -1;
  401. nWifiWarning = 0;
  402. nWifiLimit = 0;
  403. nCurrentWifiValue = -1;
  404. nBatteryWarning = 0;
  405. nBatteryLimit = 0;
  406. nCurrentBatteryValue = 0;
  407. nShockTimes = -1;
  408. nWifiChannel = 0;
  409. nWifiDataRate = 0;
  410. nWifiSignalPower = 0;
  411. nWifiNoisePower = 0;
  412. nCalibDueSetting = 0;
  413. nForceGridSuppress = 0;
  414. nGridSuppressed = 0;
  415. fGridSuppressParam1 = 0.0;
  416. fGridSuppressParam2 = 0.0;
  417. fGridSuppressParam3 = 0.0;
  418. fGridSuppressParam4 = 0.0;
  419. fGridSuppressParam5 = 0.0;
  420. fGridSuppressParam6 = 0.0;
  421. fGridSuppressParam7 = 0.0;
  422. fGridSuppressParam8 = 0.0;
  423. fGridSuppressParam9 = 0.0;
  424. nSaveRaw = 0;
  425. nSID = 0;
  426. //ECM信息相关
  427. nImageBits = 0;
  428. nRawWidth = 0;
  429. nRawHeight = 0;
  430. nFullImageWidth = 0;
  431. nFullImageHeight = 0;
  432. nPreviewWidth = 0;
  433. nPreviewHeight = 0;
  434. nFirmwareStatus = -1;
  435. nTemperatureStatus = 0;
  436. nLastImageID = 0;
  437. strWiredIP = "";
  438. strWirelessIP = "";
  439. strLocalIP = "";
  440. strWorkDir = "";
  441. }
  442. };
  443. enum APP_STATUS
  444. {
  445. APP_STATUS_IDLE = 0,
  446. APP_STATUS_WORK_BEGIN, //1
  447. APP_STATUS_WORK_END, //2
  448. APP_STATUS_DETSHARE_BEGIN, //3
  449. APP_STATUS_DETSHAR_END, //4
  450. APP_STATUS_CAL_BEGIN, //5
  451. APP_STATUS_CAL_END, // 6
  452. APP_STATUS_WORK_IN_SENSITIVITY, //7
  453. };
  454. enum GRID_STATUS
  455. {
  456. GRID_STATE_ERROR = -3,
  457. GRID_STATE_PARAM_ERROR = -2,
  458. GRID_STATE_PARAM_NULL = -1,
  459. GRID_STATE_NO = 0,
  460. GRID_STATE_VERTICAL = 1,
  461. GRID_STATE_HORIZONTAL = 2,
  462. };
  463. enum TEMP_STATUS
  464. {
  465. TEMP_NORMAL = 0,
  466. TEMP_WARNING, //1
  467. TEMP_TOO_HIGH, //2
  468. TEMP_TOO_LOW, //3
  469. };