IRayDefinition.h 12 KB

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