DetectorCtrlDefinition.h 11 KB

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