FPDCtrlDefinition.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  1. #pragma once
  2. #include <string>
  3. #pragma region DEFINITION
  4. enum IRAY_SYNCMODE_CHANGE
  5. {
  6. E_IRAY_SYNCMODE_NOCHANGE = 0,
  7. E_IRAY_SYNCMODE_CHANGED = 2,
  8. E_IRAY_SYNCMODE_SETFAILED = 4
  9. };
  10. enum AcqMode
  11. {
  12. DEFAULT = 0,
  13. RAD,
  14. CF,
  15. PF,
  16. STITCH,
  17. DDR
  18. };
  19. typedef enum
  20. {
  21. EVT_CODE_NA = 0,
  22. FPD_ACTIVE,//1
  23. FPD_NOT_ACTIVE,//2
  24. } ste_code;
  25. enum ENUM_EXPOSE_STATUS
  26. {
  27. DOSE_ACCEPT = 0,
  28. DOSE_TOO_HIGH = 1,
  29. DOSE_TOO_LOW = 2,
  30. DOSE_OBJECT = 3
  31. };
  32. typedef enum
  33. {
  34. WS_DIRE = 2,
  35. }Struct_WS;
  36. //探测器异步事件状态
  37. enum ENUM_PANEL_EVENT_STATE
  38. {
  39. PANEL_EVENT_END_OK = 0,
  40. PANEL_EVENT_END_ERROR = 1,
  41. PANEL_EVENT_START = 2,
  42. PANEL_EVENT_SUCCESS = 3,
  43. PANEL_EVENT_END = 4,
  44. PANEL_EVENT_BEGIN = 5,
  45. PANEL_EVENT_TIMEOUT = 6
  46. };
  47. enum SIEMENS_FD_STATUS
  48. {
  49. FD_SUCCESS = 0, //
  50. FD_ERROR = 5, //DFR not ready because there is an Detector error.
  51. NO_OGP_SELECT = 8,
  52. //FD_RECOVERING = 9, //DFR is not ready because the FD is recovering.
  53. FD_TOO_HOT = 11, //DFR is not ready because the Detector is too hot.
  54. //FD_OFFSET_IN_PROGRESS = 15, //FD offset is in progress
  55. FD_WLAN_TOO_LOW = 16, //For NRF: WLAN power is too low for acquisition.
  56. FD_BATTERY_TOO_LOW = 18, //Battery of mobile detector is too low for Acquisition.
  57. //LOW_BATT_ACQ_POSSIBLE = 19, //Battery of wireless FD is low but acquisition still possible (for future use)
  58. //FD_NOT_IN_OP_STATE = 20, //Detector not in operating state
  59. //FD_CONFG_OUT = 21, //Detector configured out
  60. //FD_IMG_RECOV = 22, //Detector image recovery in progress
  61. };
  62. typedef enum
  63. {
  64. EVT_LEVEL_CONFIGURATION = 0x00,
  65. EVT_LEVEL_INFORMATOION = 0x01,
  66. EVT_LEVEL_STATUS = 0x02,
  67. EVT_LEVEL_DATA = 0x03,
  68. EVT_LEVEL_WARNING = 0x04,
  69. EVT_LEVEL_ERROR = 0x05,
  70. } CcosEventLevel;
  71. typedef enum
  72. {
  73. EVT_CONF_PANEL_SERIAL = 0x00,
  74. EVT_CONF_RAW_WIDTH = 0x01,
  75. EVT_CONF_RAW_HIGHT = 0x02,
  76. EVT_CONF_RAW_BITS = 0x03,
  77. EVT_CONF_PIXELSPACE = 0x04,
  78. EVT_CONF_PREVIEW_WIDTH = 0x05,
  79. EVT_CONF_PREVIEW_HIGHT = 0x06,
  80. EVT_CONF_MODULE_TYPE = 0x07,
  81. EVT_CONF_MODULE_IP = 0x08,
  82. EVT_CONF_MODULE_SN = 0x09,
  83. EVT_CONF_FIRWARE_UPDATE = 0x0A,
  84. EVT_CONF_PART_NUMBER = 0x0B,
  85. EVT_CONF_BATTERY_SN = 0x0C,
  86. EVT_CONF_WIFI_SSID = 0x0D,
  87. EVT_CONF_IFBOARD = 0x0E,
  88. EVT_CONF_DATECODE = 0x0F,
  89. EVT_CONF_LIFETIME = 0x10,
  90. } CcosEventConfigID;
  91. typedef enum
  92. {
  93. EVT_INFO_POWER_ON = 0x00,
  94. EVT_INFO_BATTERY_CAPACITY = 0x01,
  95. EVT_INFO_BATTERY_TEMPERATURE = 0x02,
  96. EVT_INFO_BATTERY_CHARGES = 0x03,
  97. EVT_INFO_WIFI_DATARATE = 0x04,
  98. EVT_INFO_WIFI_CHANNEL = 0x05,
  99. EVT_INFO_WIFI_SIGNALPOWER = 0x06,
  100. EVT_INFO_WIFI_NOISEPOWER = 0x07,
  101. EVT_INFO_FIRMWARE = 0x08,
  102. EVT_INFO_SHOCKSENSOR_INFO = 0x09,
  103. EVT_INFO_CALIBRATIOIN_TIME = 0x0A,
  104. EVT_INFO_FPVOLTAGE = 0x0B,
  105. EVT_INFO_CALIBRATIOIN_TIMEL = 0x0C, //长曝光模式
  106. } CcosEventInfoID;
  107. typedef enum
  108. {
  109. EVT_STATUS_INIT = 0x00,
  110. EVT_STATUS_MOTION = 0x01,
  111. EVT_STATUS_UPDATE_FIRMWARE = 0x02,
  112. EVT_STATUS_SELFTEST = 0x03,
  113. EVT_STATUS_DETECTORSHARE = 0x04,
  114. EVT_STATUS_SINGLEINIT = 0x05,
  115. EVT_STATUS_SELECTPANEL = 0x06,
  116. EVT_STATUS_PANEL = 0x07,
  117. EVT_STATUS_CALIBRATIOIN = 0x08,
  118. EVT_STATUS_SAVECALIB = 0x09,
  119. EVT_STATUS_SAVEDEFECT = 0x0A,
  120. EVT_STATUS_ACQUISITION = 0x0B,
  121. EVT_STATUS_SINGLEEXP = 0x0C,
  122. EVT_STATUS_IMAGEPENDING = 0x0D,
  123. EVT_STATUS_TEMPERATURE = 0x0E,
  124. EVT_STATUS_WIFI = 0x0F,
  125. EVT_STATUS_BATTERY_VALUE = 0x10,
  126. EVT_STATUS_BATTERY_CHARGING = 0x11,
  127. EVT_STATUS_SHOCK_SENSOR = 0x12,
  128. EVT_STATUS_HALL_SENSOR = 0x13,
  129. EVT_STATUS_PING = 0x14,
  130. EVT_STATUS_PMSNOTOPEN = 0x15,
  131. EVT_STATUS_RESTOREFILES = 0x16,
  132. EVT_STATUS_LASTERROR = 0x17,
  133. EVT_STATUS_RESET = 0x18,
  134. } CcosEventStatusID;
  135. typedef enum
  136. {
  137. EVT_DATA_RAW_IMAGE = 0x00,
  138. EVT_DATA_PREVIEW_IMAGE = 0x01,
  139. EVT_DATA_DOSEPARAM = 0x02,
  140. } CcosEventDataID;
  141. typedef enum
  142. {
  143. EVT_ERR_COMMUNICATE = 0x00,
  144. EVT_ERR_EXP_REQUEST = 0x01,
  145. EVT_ERR_GET_IMAGE = 0x02,
  146. EVT_ERR_MAX_NUMBER = 0x03,
  147. EVT_ERR_SN_NOTINLIST = 0x04,
  148. EVT_ERR_POWER_OFF = 0x05,
  149. EVT_ERR_INIT_FAILED = 0x06,
  150. } CcosEventErrorID;
  151. enum ENUM_PANEL_RESET
  152. {
  153. PANEL_RESET_BEGIN = 1, //
  154. PANEL_RESET_OK = 2, //
  155. PANEL_RESET_ERROR = 3
  156. };
  157. //探测器状态
  158. enum ENUM_PANEL_STATUS
  159. {
  160. PANEL_CLOSE = 0,
  161. PANEL_STANDBY = 1,
  162. PANEL_READY_EXP = 2,
  163. PANEL_XWINDOW_ON = 3,
  164. PANEL_XWINDOW_OFF = 4,
  165. PANEL_START_TRANSMIT = 5,
  166. PANEL_END_TRANSMIT = 6,
  167. PANEL_START_ACQ = 7,
  168. PANEL_END_ACQ = 8,
  169. PANEL_EXP_END_TIMEOUT = 9,
  170. PANEL_OFFSET_CAL = 10,
  171. PANEL_OFFSET_FINISH = 11,
  172. PANEL_GAIN_CAL = 12,
  173. PANEL_GAIN_FINISH = 13,
  174. PANEL_DEFECT_CAL = 14,
  175. PANEL_DEFECT_FINISH = 15,
  176. PANEL_INIT = 21,
  177. PANEL_SLEEP = 22,
  178. PANEL_GET_IMAGE = 23,
  179. PANEL_GAIN_PREPARE = 24,
  180. PANEL_GAIN_READY_EXP = 25,
  181. };
  182. enum
  183. {
  184. NOCAL,
  185. CAL_START,
  186. CAL_CONFIRM,
  187. CAL_REJECT,
  188. CAL_ABORT,
  189. CAL_END
  190. };
  191. struct DeviceIndexStruct
  192. {
  193. bool bPreviewEnable;
  194. bool bInitOK;
  195. bool bConnectStatus;
  196. bool bModuleEnable;
  197. bool bExisted;
  198. bool bEventReturn;
  199. bool bSetCorrection;
  200. bool bReadWifi;
  201. bool bHallSensor;
  202. bool bReadTemperature;
  203. bool bReadBattery;
  204. bool bWriteROM;
  205. bool bTaskEnd;
  206. bool bCharging;
  207. bool bOffsetOver;
  208. bool bUpdateFirmware;
  209. bool bUploadCalibFile;
  210. bool bRecoveringImage;
  211. bool bWireless;
  212. bool bLivingTime;
  213. bool bImagePending;
  214. bool bConnectChanged;
  215. bool bActived;
  216. int HWindex;
  217. int Realindex;
  218. int nSyncMode;
  219. int nPanelExpWindowMode;
  220. int nSaturationValue;
  221. int nPanelID;
  222. int nDoseOfEXI;
  223. int nRequirehwMode;
  224. int nWorkstation;
  225. int nWifiWarning;
  226. int nWifiLimit;
  227. int nCurrentWifiValue;
  228. int nBatteryWarning;
  229. int nBatteryLimit;
  230. int nCurrentBatteryValue;
  231. int nShockTimes;
  232. int nWifiChannel;
  233. int nWifiDataRate;
  234. int nWifiSignalPower;
  235. int nWifiNoisePower;
  236. int nCalibDueSetting;
  237. int nMaxShockNumber;
  238. int nForceGridSuppress;
  239. int nTemperCheckTimeConf;
  240. int nGridSuppressed;
  241. float fTemperatureMin;
  242. float fTemperatureMax;
  243. float fGradientMean;
  244. float fGradientStdDev;
  245. float fGridSuppressParam1;
  246. float fGridSuppressParam2;
  247. float fGridSuppressParam3;
  248. float fGridSuppressParam4;
  249. float fGridSuppressParam5;
  250. float fGridSuppressParam6;
  251. float fGridSuppressParam7;
  252. float fGridSuppressParam8;
  253. float fGridSuppressParam9;
  254. float fCalibTemperature;
  255. float fCalibTemperature1;
  256. float fCalibTemperature2;
  257. float fLTEthreshold;
  258. int nSaveRaw;
  259. int nSID;
  260. int nSendImageInterval;
  261. //ECM信息相关
  262. int nImageBits;
  263. int nRawWidth;
  264. int nRawHeight;
  265. int nFullImageWidth;
  266. int nFullImageHeight;
  267. int nPreviewWidth;
  268. int nPreviewHeight;
  269. int nWidthOffset;
  270. int nHeightOffset;
  271. int nImageTopffset;
  272. int nImageRightOffset;
  273. int nImageBottomOffset;
  274. int nImageLeftOffset;
  275. int nGridSuppFilterType;
  276. int nLifeTime;
  277. int nPowerOn;
  278. int nFirmwareStatus;
  279. int nTemperatureStatus;
  280. int nLastImageID;
  281. float fFactorEXI2UGY; //探测器EXI -> UGY 转换系数
  282. float fTemperWarning;
  283. float fTemperMaxLimit;
  284. float fTemperLowLimit;
  285. float fTemperMinLimit;
  286. float fCurrentTemperValue;
  287. float fPixelSpace; //像素大小
  288. std::string strAppConfFilePath; //配置文件路径
  289. std::string strDeviceName; //探测器名称
  290. std::string strPartNumber;
  291. std::string strWifiSSID;
  292. std::string strPanelSerial;
  293. std::string strFPDConfFilePath;//探测器自身配置文件路径
  294. std::string strIPAddress;
  295. std::string strCalibrationDate; //校正日期
  296. std::string strCalibrationDue;
  297. std::string strCalibrationLTEDate; //LTE校正日期
  298. std::string strCalibrationLTEDue;
  299. std::string strInterfaceBoard;
  300. std::string strDateCode;
  301. std::string strFirmware;
  302. std::string strSoftware;
  303. std::string strWorkDir; //SDK配置文件路径
  304. DeviceIndexStruct()
  305. {
  306. bConnectStatus = false;
  307. bExisted = false;
  308. bInitOK = false;
  309. bModuleEnable = false;
  310. bEventReturn = false;
  311. bSetCorrection = false;
  312. bReadWifi = false;
  313. bHallSensor = false;
  314. bReadTemperature = false;
  315. bReadBattery = false;
  316. bWriteROM = false;
  317. bTaskEnd = true;
  318. bCharging = false;
  319. bOffsetOver = false;
  320. bUpdateFirmware = false;
  321. bUploadCalibFile = false;
  322. bRecoveringImage = false;
  323. bWireless = false;
  324. bLivingTime = false;
  325. bImagePending = false;
  326. bConnectChanged = false;
  327. bActived = true;
  328. Realindex = 0;
  329. HWindex = 0;
  330. strAppConfFilePath = ""; //配置文件路径
  331. strDeviceName = ""; //探测器名称
  332. strWifiSSID = "NULL"; //探测器名称
  333. nSyncMode = 0;
  334. nPanelExpWindowMode = 0;
  335. nSaturationValue = 0;
  336. nGridSuppressed = 0;
  337. nPanelID = 0;
  338. nDoseOfEXI = 550;
  339. nRequirehwMode = 0;
  340. strPanelSerial = "";
  341. strFPDConfFilePath = "";//探测器自身配置文件路径
  342. strCalibrationDate = ("0");
  343. strCalibrationDue = ("0");
  344. strCalibrationLTEDate = ("0");
  345. strCalibrationLTEDue = ("0");
  346. fFactorEXI2UGY = 0.0;
  347. bPreviewEnable = false;
  348. fTemperWarning = 0.0;
  349. fTemperMaxLimit = 0.0;
  350. fTemperLowLimit = 0.0;
  351. fTemperMinLimit = 0.0;
  352. fCalibTemperature = 0.0;
  353. fCalibTemperature1 = 0.0;
  354. fCalibTemperature2 = 0.0;
  355. fCurrentTemperValue = 0.0;
  356. nWorkstation = -1;
  357. nWifiWarning = 0;
  358. nWifiLimit = 0;
  359. nCurrentWifiValue = -1;
  360. nBatteryWarning = 0;
  361. nBatteryLimit = 0;
  362. nCurrentBatteryValue = 0;//fixbug 9728泰雷兹探测器电量为0时不给这个值赋值,西门子还是想要0
  363. nGridSuppFilterType = 0;
  364. nShockTimes = -1;
  365. nWifiChannel = 0;
  366. nWifiDataRate = 0;
  367. nWifiSignalPower = 0;
  368. nWifiNoisePower = 0;
  369. nCalibDueSetting = 0;
  370. nMaxShockNumber = 0;
  371. nForceGridSuppress = 0;
  372. nTemperCheckTimeConf = 0;
  373. fTemperatureMin = 0.0;
  374. fTemperatureMax = 0.0;
  375. fGradientMean = 0.0;
  376. fGradientStdDev = 0.0;
  377. nGridSuppressed = 0;
  378. fGridSuppressParam1 = 0.0;
  379. fGridSuppressParam2 = 0.0;
  380. fGridSuppressParam3 = 0.0;
  381. fGridSuppressParam4 = 0.0;
  382. fGridSuppressParam5 = 0.0;
  383. fGridSuppressParam6 = 0.0;
  384. fGridSuppressParam7 = 0.0;
  385. fGridSuppressParam8 = 0.0;
  386. fGridSuppressParam9 = 0.0;
  387. fLTEthreshold = 450.0;
  388. nSaveRaw = 0;
  389. nSID = 0;
  390. nSendImageInterval = 20;
  391. fPixelSpace = 0.143f;
  392. //ECM信息相关
  393. nImageBits = 0;
  394. nRawWidth = 0;
  395. nRawHeight = 0;
  396. nFullImageWidth = 0;
  397. nFullImageHeight = 0;
  398. nPreviewWidth = 0;
  399. nPreviewHeight = 0;
  400. nWidthOffset = 0;
  401. nHeightOffset = 0;
  402. nLifeTime = 0;
  403. nPowerOn = 0;
  404. nFirmwareStatus = -1;
  405. nTemperatureStatus = 0;
  406. nLastImageID = 0;
  407. }
  408. };
  409. enum APP_STATUS
  410. {
  411. APP_STATUS_IDLE = 0,
  412. APP_STATUS_WORK_BEGIN, //1
  413. APP_STATUS_WORK_END, //2
  414. APP_STATUS_DETSHARE_BEGIN, //3
  415. APP_STATUS_DETSHAR_END, //4
  416. APP_STATUS_CAL_BEGIN, //5
  417. APP_STATUS_CAL_END, // 6
  418. APP_STATUS_WORK_IN_SENSITIVITY, //7
  419. };
  420. typedef enum
  421. {
  422. FD_INIT_NULL = -1,
  423. FD_INIT_FAILED = 0,
  424. FD_INIT_SUCCESS = 1,
  425. }fd_init_status;
  426. enum
  427. {
  428. GRID_CONF_AUTO = 0,
  429. GRID_CONF_YES = 1,
  430. GRID_CONF_NO = 2,
  431. };
  432. enum
  433. {
  434. GRID_STATE_ERROR = -3,
  435. GRID_STATE_PARAM_ERROR = -2,
  436. GRID_STATE_PARAM_NULL = -1,
  437. GRID_STATE_NO = 0,
  438. GRID_STATE_VERTICAL = 1,
  439. GRID_STATE_HORIZONTAL = 2,
  440. };
  441. enum TEMP_STATUS
  442. {
  443. TEMP_NORMAL = 0,
  444. TEMP_WARNING, //1
  445. TEMP_TOO_HIGH, //2
  446. TEMP_TOO_LOW, //3
  447. };
  448. #define HEADER_SIZE 128
  449. typedef struct {
  450. long fileMagic;
  451. long numberColumns;
  452. long numberRows;
  453. long numberFrames;
  454. long storageType;
  455. long quantLevels;
  456. float maxSignalLevel;
  457. float minSignalLevel;
  458. long historyLength;
  459. char reservedArea[HEADER_SIZE - 7 * sizeof(long)-2 * sizeof(float)];
  460. } FXDHeader;
  461. #pragma endregion DEFINITION