DetectorCtrlDefinition.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  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. EVT_INFO_OFFSET_PROGRESS = 0x0D,
  77. EVT_INFO_OFFSET_STATUS = 0x0E,
  78. } CcosEventInfoID;
  79. typedef enum
  80. {
  81. EVT_STATUS_INIT = 0x00,
  82. EVT_STATUS_MOTION = 0x01,
  83. EVT_STATUS_UPDATE_FIRMWARE = 0x02,
  84. EVT_STATUS_SELFTEST = 0x03,
  85. EVT_STATUS_DETECTORSHARE = 0x04,
  86. EVT_STATUS_SINGLEINIT = 0x05,
  87. EVT_STATUS_SELECTPANEL = 0x06,
  88. EVT_STATUS_PANEL = 0x07,
  89. EVT_STATUS_CALIBRATIOIN = 0x08,
  90. EVT_STATUS_SAVECALIB = 0x09,
  91. EVT_STATUS_SAVEDEFECT = 0x0A,
  92. EVT_STATUS_ACQUISITION = 0x0B,
  93. EVT_STATUS_SINGLEEXP = 0x0C,
  94. EVT_STATUS_IMAGEPENDING = 0x0D,
  95. EVT_STATUS_TEMPERATURE = 0x0E,
  96. EVT_STATUS_WIFI = 0x0F,
  97. EVT_STATUS_BATTERY_VALUE = 0x10,
  98. EVT_STATUS_BATTERY_CHARGING = 0x11,
  99. EVT_STATUS_SHOCK_SENSOR = 0x12,
  100. EVT_STATUS_HALL_SENSOR = 0x13,
  101. EVT_STATUS_PING = 0x14,
  102. EVT_STATUS_PMSNOTOPEN = 0x15,
  103. EVT_STATUS_RESTOREFILES = 0x16,
  104. EVT_STATUS_LASTERROR = 0x17,
  105. EVT_STATUS_RESET = 0x18,
  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. EVT_ERR_OFFSET_FAILED = 0x07,
  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 = 0,
  134. PANEL_STANDBY = 1,
  135. PANEL_READY_EXP = 2,
  136. PANEL_XWINDOW_ON = 3,
  137. PANEL_XWINDOW_OFF = 4,
  138. PANEL_START_TRANSMIT = 5,
  139. PANEL_END_TRANSMIT = 6,
  140. PANEL_START_ACQ = 7,
  141. PANEL_END_ACQ = 8,
  142. PANEL_EXP_END_TIMEOUT = 9,
  143. PANEL_OFFSET_CAL = 10,
  144. PANEL_OFFSET_FINISH = 11,
  145. PANEL_GAIN_CAL = 12,
  146. PANEL_GAIN_FINISH = 13,
  147. PANEL_DEFECT_CAL = 14,
  148. PANEL_DEFECT_FINISH = 15,
  149. PANEL_INIT = 21,
  150. PANEL_SLEEP = 22,
  151. PANEL_GET_IMAGE = 23,
  152. PANEL_GAIN_PREPARE = 24,
  153. PANEL_GAIN_READY_EXP = 25,
  154. };
  155. enum
  156. {
  157. NOCAL,
  158. CAL_START,
  159. CAL_CONFIRM,
  160. CAL_REJECT,
  161. CAL_ABORT,
  162. CAL_END
  163. };
  164. struct DeviceIndexStruct
  165. {
  166. bool bPreviewEnable;
  167. bool bInitOK;
  168. bool bConnectStatus;
  169. bool bModuleEnable;
  170. bool bExisted;
  171. bool bEventReturn;
  172. bool bSetCorrection;
  173. bool bReadWifi;
  174. bool bHallSensor;
  175. bool bReadTemperature;
  176. bool bReadBattery;
  177. bool bWriteROM;
  178. bool bTaskEnd;
  179. bool bCharging;
  180. bool bOffsetOver;
  181. bool bUpdateFirmware;
  182. bool bUploadCalibFile;
  183. bool bRecoveringImage;
  184. bool bWireless;
  185. bool bLivingTime;
  186. bool bImagePending;
  187. bool bConnectChanged;
  188. bool bActived;
  189. int HWindex;
  190. int Realindex;
  191. int nSyncMode;
  192. int nPanelExpWindowMode;
  193. int nSaturationValue;
  194. int nPanelID;
  195. int nDoseOfEXI;
  196. int nRequirehwMode;
  197. int nWorkstation;
  198. int nWifiWarning;
  199. int nWifiLimit;
  200. int nCurrentWifiValue;
  201. int nBatteryWarning;
  202. int nBatteryLimit;
  203. int nCurrentBatteryValue;
  204. int nShockTimes;
  205. int nWifiChannel;
  206. int nWifiDataRate;
  207. int nWifiSignalPower;
  208. int nWifiNoisePower;
  209. int nCalibModeNum;
  210. int nOffsetInterval;
  211. int nCalibDueSetting;
  212. int nMaxShockNumber;
  213. int nForceGridSuppress;
  214. int nTemperCheckTimeConf;
  215. float fTemperatureMin;
  216. float fTemperatureMax;
  217. float fGradientMean;
  218. float fGradientStdDev;
  219. int nGridSuppressed;
  220. float fGridSuppressParam1;
  221. float fGridSuppressParam2;
  222. float fGridSuppressParam3;
  223. float fGridSuppressParam4;
  224. float fGridSuppressParam5;
  225. float fGridSuppressParam6;
  226. float fGridSuppressParam7;
  227. float fGridSuppressParam8;
  228. float fGridSuppressParam9;
  229. float fCalibTemperature;
  230. float fCalibTemperature1;
  231. float fCalibTemperature2;
  232. float fLTEthreshold;
  233. int nSaveRaw;
  234. int nSID;
  235. //ECM信息相关
  236. int nImageBits;
  237. int nRawWidth;
  238. int nRawHeight;
  239. int nFullImageWidth;
  240. int nFullImageHeight;
  241. int nMaxImgHeight;
  242. int nMaxImgWidth;
  243. int nPreviewWidth;
  244. int nPreviewHeight;
  245. int nWidthOffset;
  246. int nHeightOffset;
  247. int nImageTopffset;
  248. int nImageRightOffset;
  249. int nImageBottomOffset;
  250. int nImageLeftOffset;
  251. int nGridSuppFilterType;
  252. int nLifeTime;
  253. int nPowerOn;
  254. int nFirmwareStatus;
  255. int nTemperatureStatus;
  256. int nLastImageID;
  257. float fFactorEXI2UGY; //探测器EXI -> UGY 转换系数
  258. float fTemperWarning;
  259. float fTemperMaxLimit;
  260. float fTemperLowLimit;
  261. float fTemperMinLimit;
  262. float fCurrentTemperValue;
  263. float fPixelSpace; //像素大小
  264. std::string strAppConfFilePath; //配置文件路径
  265. std::string strDeviceName; //探测器名称
  266. std::string strPartNumber;
  267. std::string strWifiSSID;
  268. std::string strPanelSerial;
  269. std::string strFPDConfFilePath;//探测器自身配置文件路径
  270. std::string strIPAddress;
  271. std::string strCalibrationDate; //校正日期
  272. std::string strCalibrationDue;
  273. std::string strCalibrationLTEDate; //LTE校正日期
  274. std::string strCalibrationLTEDue;
  275. std::string strInterfaceBoard;
  276. std::string strDateCode;
  277. std::string strFirmware;
  278. std::string strSoftware;
  279. std::string strWorkDir; //SDK配置文件路径
  280. bool bSupportDDR; //是否支持DDR采集模式
  281. DeviceIndexStruct()
  282. {
  283. bConnectStatus = false;
  284. bExisted = false;
  285. bInitOK = false;
  286. bModuleEnable = false;
  287. bEventReturn = false;
  288. bSetCorrection = false;
  289. bReadWifi = false;
  290. bHallSensor = false;
  291. bReadTemperature = false;
  292. bReadBattery = false;
  293. bWriteROM = false;
  294. bTaskEnd = true;
  295. bCharging = false;
  296. bOffsetOver = false;
  297. bUpdateFirmware = false;
  298. bUploadCalibFile = false;
  299. bRecoveringImage = false;
  300. bWireless = false;
  301. bLivingTime = false;
  302. bImagePending = false;
  303. bConnectChanged = false;
  304. bActived = true;
  305. Realindex = 0;
  306. HWindex = 0;
  307. strAppConfFilePath = ""; //配置文件路径
  308. strDeviceName = ""; //探测器名称
  309. strWifiSSID = "NULL"; //探测器名称
  310. nSyncMode = 0;
  311. nPanelExpWindowMode = 0;
  312. nSaturationValue = 0;
  313. nGridSuppressed = 0;
  314. nPanelID = 0;
  315. nDoseOfEXI = 0;
  316. nRequirehwMode = 0;
  317. strPanelSerial = "";
  318. strFPDConfFilePath = "";//探测器自身配置文件路径
  319. strCalibrationDate = ("0");
  320. strCalibrationDue = ("0");
  321. strCalibrationLTEDate = ("0");
  322. strCalibrationLTEDue = ("0");
  323. fFactorEXI2UGY = 0.0;
  324. bPreviewEnable = false;
  325. fTemperWarning = 0.0;
  326. fTemperMaxLimit = 0.0;
  327. fTemperLowLimit = 0.0;
  328. fTemperMinLimit = 0.0;
  329. fCalibTemperature = 0.0;
  330. fCalibTemperature1 = 0.0;
  331. fCalibTemperature2 = 0.0;
  332. fCurrentTemperValue = 0.0;
  333. nWorkstation = -1;
  334. nWifiWarning = 0;
  335. nWifiLimit = 0;
  336. nCurrentWifiValue = -1;
  337. nBatteryWarning = 0;
  338. nBatteryLimit = 0;
  339. nCurrentBatteryValue = 0;//fixbug 9728泰雷兹探测器电量为0时不给这个值赋值,西门子还是想要0
  340. nGridSuppFilterType = 0;
  341. nShockTimes = -1;
  342. nWifiChannel = 0;
  343. nWifiDataRate = 0;
  344. nWifiSignalPower = 0;
  345. nWifiNoisePower = 0;
  346. nCalibModeNum = 1;
  347. nOffsetInterval = 30;
  348. nCalibDueSetting = 0;
  349. nMaxShockNumber = 0;
  350. nForceGridSuppress = 0;
  351. nTemperCheckTimeConf = 0;
  352. fTemperatureMin = 0.0;
  353. fTemperatureMax = 0.0;
  354. fGradientMean = 0.0;
  355. fGradientStdDev = 0.0;
  356. nGridSuppressed = 0;
  357. fGridSuppressParam1 = 0.0;
  358. fGridSuppressParam2 = 0.0;
  359. fGridSuppressParam3 = 0.0;
  360. fGridSuppressParam4 = 0.0;
  361. fGridSuppressParam5 = 0.0;
  362. fGridSuppressParam6 = 0.0;
  363. fGridSuppressParam7 = 0.0;
  364. fGridSuppressParam8 = 0.0;
  365. fGridSuppressParam9 = 0.0;
  366. fLTEthreshold = 450.0;
  367. nSaveRaw = 0;
  368. nSID = 0;
  369. fPixelSpace = 0.143f;
  370. //ECM信息相关
  371. nImageBits = 0;
  372. nRawWidth = 0;
  373. nRawHeight = 0;
  374. nFullImageWidth = 0;
  375. nFullImageHeight = 0;
  376. nMaxImgHeight = 0;
  377. nMaxImgWidth = 0;
  378. nPreviewWidth = 0;
  379. nPreviewHeight = 0;
  380. nWidthOffset = 0;
  381. nHeightOffset = 0;
  382. nImageTopffset = 0;
  383. nImageRightOffset = 0;
  384. nImageBottomOffset = 0;
  385. nImageLeftOffset = 0;
  386. nLifeTime = 0;
  387. nPowerOn = 0;
  388. nFirmwareStatus = -1;
  389. nTemperatureStatus = 0;
  390. nLastImageID = 0;
  391. }
  392. };
  393. typedef enum
  394. {
  395. FD_INIT_NULL = -1,
  396. FD_INIT_FAILED = 0,
  397. FD_INIT_SUCCESS = 1,
  398. }fd_init_status;
  399. enum
  400. {
  401. GRID_CONF_AUTO = 0,
  402. GRID_CONF_YES = 1,
  403. GRID_CONF_NO = 2,
  404. };
  405. enum
  406. {
  407. GRID_STATE_ERROR = -3,
  408. GRID_STATE_PARAM_ERROR = -2,
  409. GRID_STATE_PARAM_NULL = -1,
  410. GRID_STATE_NO = 0,
  411. GRID_STATE_VERTICAL = 1,
  412. GRID_STATE_HORIZONTAL = 2,
  413. };
  414. enum TEMP_STATUS
  415. {
  416. TEMP_NORMAL = 0,
  417. TEMP_WARNING, //1
  418. TEMP_TOO_HIGH, //2
  419. TEMP_TOO_LOW, //3
  420. };
  421. #define HEADER_SIZE 128
  422. typedef struct {
  423. long fileMagic;
  424. long numberColumns;
  425. long numberRows;
  426. long numberFrames;
  427. long storageType;
  428. long quantLevels;
  429. float maxSignalLevel;
  430. float minSignalLevel;
  431. long historyLength;
  432. char reservedArea[HEADER_SIZE - 7 * sizeof(long)-2 * sizeof(float)];
  433. } FXDHeader;
  434. enum APP_STATUS
  435. {
  436. APP_STATUS_IDLE = 0,
  437. APP_STATUS_WORK_BEGIN, //1
  438. APP_STATUS_WORK_END, //2
  439. APP_STATUS_DETSHARE_BEGIN, //3
  440. APP_STATUS_DETSHAR_END, //4
  441. APP_STATUS_CAL_BEGIN, //5
  442. APP_STATUS_CAL_END, // 6
  443. APP_STATUS_WORK_IN_SENSITIVITY, //7
  444. APP_STATUS_MAX,
  445. };
  446. #pragma endregion DEFINITION
  447. struct DetectorMode
  448. {
  449. int ModeID;
  450. int imageWidth;
  451. int imageHeight;
  452. int binningMode;
  453. int FrameRate;
  454. int CalImgNum;
  455. };