DetectorCtrlDefinition.h 11 KB

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