DetectorDefinition.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. #pragma once
  2. #include <string>
  3. //SDK头文件
  4. #include "SDK/include/YuYingAPI.h"
  5. extern const char * TriggerModeName[];
  6. extern const char * PanelStatus[];
  7. extern const char * PanelErrorStatus[];
  8. extern const char * DetectorState[];
  9. extern const char * PrepCapMode[];
  10. extern const char * Enm_Switch[];
  11. extern const char * InnerSubFlow[];
  12. typedef struct
  13. {
  14. int nReferDose;
  15. int nAvgNum;
  16. }RefrenceCal;
  17. enum FW_STATUS
  18. {
  19. FW_NEED_UPDATE = 1,
  20. FW_MANDATORY_UPDATE,
  21. FW_NOT_SUPPORT,
  22. FW_NEW,
  23. FW_GET_ERROR
  24. };
  25. enum YUYING_SYNC_MODE
  26. {
  27. TRIGGER_NONE,
  28. TRIGGER_SOFT,
  29. TRIGGER_PREP,
  30. TRIGGER_MAX
  31. };
  32. enum ENUM_EXPOSE_STATUS
  33. {
  34. DOSE_ACCEPT = 0,
  35. DOSE_TOO_HIGH = 1,
  36. DOSE_TOO_LOW = 2,
  37. DOSE_OBJECT = 3
  38. };
  39. //探测器异步事件状态
  40. enum ENUM_PANEL_EVENT_STATE
  41. {
  42. PANEL_EVENT_END_OK = 0,
  43. PANEL_EVENT_END_ERROR = 1,
  44. PANEL_EVENT_START = 2,
  45. PANEL_EVENT_SUCCESS = 3,
  46. PANEL_EVENT_END = 4,
  47. PANEL_EVENT_BEGIN = 5,
  48. PANEL_EVENT_TIMEOUT = 6,
  49. PANEL_EVENT_FWU_ERROR_BATTERY = 7,
  50. PANEL_EVENT_CALIB_REPORT = 8,
  51. PANEL_EVENT_FWU_ERROR_OMIT = 9,
  52. };
  53. typedef enum
  54. {
  55. EVT_LEVEL_CONFIGURATION = 0x00,
  56. EVT_LEVEL_INFORMATOION = 0x01,
  57. EVT_LEVEL_STATUS = 0x02,
  58. EVT_LEVEL_DATA = 0x03,
  59. EVT_LEVEL_WARNING = 0x04,
  60. EVT_LEVEL_ERROR = 0x05,
  61. } CcosEventLevel;
  62. typedef enum
  63. {
  64. EVT_CONF_PANEL_SERIAL = 0x00,
  65. EVT_CONF_RAW_WIDTH = 0x01,
  66. EVT_CONF_RAW_HIGHT = 0x02,
  67. EVT_CONF_RAW_BITS = 0x03,
  68. EVT_CONF_PIXELSPACE = 0x04,
  69. EVT_CONF_PREVIEW_WIDTH = 0x05,
  70. EVT_CONF_PREVIEW_HIGHT = 0x06,
  71. EVT_CONF_MODULE_TYPE = 0x07,
  72. EVT_CONF_MODULE_IP = 0x08,
  73. EVT_CONF_MODULE_SN = 0x09,
  74. EVT_CONF_FIRWARE_UPDATE = 0x0A,
  75. EVT_CONF_PART_NUMBER = 0x0B,
  76. EVT_CONF_BATTERY_SN = 0x0C,
  77. EVT_CONF_WIFI_SSID = 0x0D,
  78. EVT_CONF_IFBOARD = 0x0E,
  79. EVT_CONF_DATECODE = 0x0F,
  80. EVT_CONF_LIFETIME = 0x10,
  81. } CcosEventConfigID;
  82. typedef enum
  83. {
  84. EVT_INFO_POWER_ON = 0x00,
  85. EVT_INFO_BATTERY_CAPACITY = 0x01,
  86. EVT_INFO_BATTERY_TEMPERATURE = 0x02,
  87. EVT_INFO_BATTERY_CHARGES = 0x03,
  88. EVT_INFO_WIFI_DATARATE = 0x04,
  89. EVT_INFO_WIFI_CHANNEL = 0x05,
  90. EVT_INFO_WIFI_SIGNALPOWER = 0x06,
  91. EVT_INFO_WIFI_NOISEPOWER = 0x07,
  92. EVT_INFO_FIRMWARE = 0x08,
  93. EVT_INFO_SHOCKSENSOR_INFO = 0x09,
  94. EVT_INFO_CALIBRATIOIN_DATE = 0x0A,
  95. EVT_INFO_FPVOLTAGE = 0x0B,
  96. EVT_INFO_CALIBRATIOIN_DATEL = 0x0C, //长曝光模式
  97. EVT_INFO_CALIBRATIOIN_TIME = 0x0D,
  98. EVT_INFO_CALIBRATIOIN_TIMEL = 0x0E,
  99. } CcosEventInfoID;
  100. typedef enum
  101. {
  102. EVT_STATUS_INIT = 0x00,
  103. EVT_STATUS_MOTION = 0x01,
  104. EVT_STATUS_UPDATE_FIRMWARE = 0x02,
  105. EVT_STATUS_SELFTEST = 0x03,
  106. EVT_STATUS_DETECTORSHARE = 0x04,
  107. EVT_STATUS_SINGLEINIT = 0x05,
  108. EVT_STATUS_SELECTPANEL = 0x06,
  109. EVT_STATUS_PANEL = 0x07,
  110. EVT_STATUS_CALIBRATIOIN = 0x08,
  111. EVT_STATUS_SAVECALIB = 0x09,
  112. EVT_STATUS_SAVEDEFECT = 0x0A,
  113. EVT_STATUS_ACQUISITION = 0x0B,
  114. EVT_STATUS_SINGLEEXP = 0x0C,
  115. EVT_STATUS_IMAGEPENDING = 0x0D,
  116. EVT_STATUS_TEMPERATURE = 0x0E,
  117. EVT_STATUS_WIFI = 0x0F,
  118. EVT_STATUS_BATTERY_VALUE = 0x10,
  119. EVT_STATUS_BATTERY_CHARGING = 0x11,
  120. EVT_STATUS_SHOCK_SENSOR = 0x12,
  121. EVT_STATUS_HALL_SENSOR = 0x13,
  122. EVT_STATUS_PING = 0x14,
  123. EVT_STATUS_PMSNOTOPEN = 0x15,
  124. EVT_STATUS_RESTOREFILES = 0x16,
  125. EVT_STATUS_LASTERROR = 0x17,
  126. EVT_STATUS_RESET = 0x18,
  127. EVT_STATUS_IMAGERECOVERAUTO = 0x19,
  128. EVT_STATUS_PREPARE_EDNCALIBRATION = 0x21,
  129. } CcosEventStatusID;
  130. typedef enum
  131. {
  132. EVT_DATA_RAW_IMAGE = 0x00,
  133. EVT_DATA_PREVIEW_IMAGE = 0x01,
  134. EVT_DATA_DOSEPARAM = 0x02,
  135. } CcosEventDataID;
  136. typedef enum
  137. {
  138. EVT_ERR_COMMUNICATE = 0x00,
  139. EVT_ERR_EXP_REQUEST = 0x01,
  140. EVT_ERR_GET_IMAGE = 0x02,
  141. EVT_ERR_MAX_NUMBER = 0x03,
  142. EVT_ERR_SN_NOTINLIST = 0x04,
  143. EVT_ERR_POWER_OFF = 0x05,
  144. EVT_ERR_INIT_FAILED = 0x06,
  145. } CcosEventErrorID;
  146. //探测器状态
  147. enum ENUM_PANEL_STATUS
  148. {
  149. PANEL_CLOSE = 0,
  150. PANEL_STANDBY = 1,
  151. PANEL_READY_EXP = 2,
  152. PANEL_XWINDOW_ON = 3,
  153. PANEL_XWINDOW_OFF = 4,
  154. PANEL_START_TRANSMIT = 5,
  155. PANEL_END_TRANSMIT = 6,
  156. PANEL_START_ACQ = 7,
  157. PANEL_END_ACQ = 8,
  158. PANEL_EXP_END_TIMEOUT = 9,
  159. PANEL_OFFSET_CAL = 10,
  160. PANEL_OFFSET_FINISH = 11,
  161. PANEL_GAIN_CAL = 12,
  162. PANEL_GAIN_FINISH = 13,
  163. PANEL_DEFECT_CAL = 14,
  164. PANEL_DEFECT_FINISH = 15,
  165. PANEL_INIT = 21,
  166. PANEL_SLEEP = 22,
  167. PANEL_GET_IMAGE = 23,
  168. PANEL_GAIN_PREPARE = 24,
  169. PANEL_GAIN_READY_EXP = 25,
  170. PANEL_OFFSET_FAILED = 26,
  171. };
  172. struct DeviceIndexStruct
  173. {
  174. int nDetectorID;
  175. bool bInitOK;
  176. bool bConnectStatus;
  177. bool bActived;
  178. bool bExisted;
  179. bool bReadWifi;
  180. bool bReadTemperature;
  181. bool bReadBattery;
  182. bool bCharging;
  183. bool bUpdateFirmware;
  184. bool bUploadCalibFile;
  185. bool bRecoveringImage;
  186. bool bWireless;
  187. bool bImagePending;
  188. bool bPreviewEnable;
  189. bool bStatusPollEnable;
  190. bool bTemperatureEnable;
  191. bool bHumidityEnable;
  192. bool bBatteryEnable;
  193. bool bWifiEnable;
  194. bool bGainDefectEnable;
  195. int nSyncMode;
  196. int nSaturationValue;
  197. int nDoseOfEXI;
  198. int nWorkstation;
  199. int nWifiWarning;
  200. int nWifiLimit;
  201. int nCurrentWifiValue;
  202. int nBatteryWarning;
  203. int nBatteryLimit;
  204. int nCurrentBatteryValue;
  205. int nWifiChannel;
  206. int nWifiDataRate;
  207. int nWifiSignalPower;
  208. int nWifiNoisePower;
  209. int nCalibDueSetting;
  210. int nShockTimes;
  211. int nMaxShockNumber;
  212. int nForceGridSuppress;
  213. int nGridSuppressed;
  214. float fGridSuppressParam1;
  215. float fGridSuppressParam2;
  216. float fGridSuppressParam3;
  217. float fGridSuppressParam4;
  218. float fGridSuppressParam5;
  219. float fGridSuppressParam6;
  220. float fGridSuppressParam7;
  221. float fGridSuppressParam8;
  222. float fGridSuppressParam9;
  223. float fCalibTemperature;
  224. int nSaveRaw;
  225. int nSID;
  226. //ECM信息相关
  227. int nImageBits;
  228. int nRawWidth;
  229. int nRawHeight;
  230. int nFullImageWidth;
  231. int nFullImageHeight;
  232. int nPreviewWidth;
  233. int nPreviewHeight;
  234. int nWidthOffset;
  235. int nHeightOffset;
  236. int nImageLeftOffset;
  237. int nImageTopOffset;
  238. int nImageRightOffset;
  239. int nImageBottomOffset;
  240. int nGridSuppFilterType;
  241. int nFirmwareStatus;
  242. int nTemperatureStatus;
  243. int nLastImageID;
  244. int nPixelSpace; //像素大小
  245. int nExpWindowMode;
  246. int nXWindow;
  247. float fFactorEXI2UGY; //探测器EXI -> UGY 转换系数
  248. //Temperature
  249. float fTemperMaxLimit;
  250. float fTemperUpLimit;
  251. float fTemperLowLimit;
  252. float fTemperMinLimit;
  253. float fCalibTemperUp;
  254. float fCalibTemperLow;
  255. float fCurrentTemperValue;
  256. std::string strDetectorModel; //探测器类型
  257. std::string strDeviceName; //探测器名称
  258. std::string strWifiSSID;
  259. std::string strPanelSerial;
  260. std::string strFPDConfFilePath;//探测器自身配置文件路径
  261. std::string strIPAddress; //探测器IP
  262. std::string strWiredIP; //有线IP
  263. std::string strWirelessIP; //无线IP
  264. std::string strLocalIP; //本地IP
  265. std::string strCalibrationDate; //校正日期
  266. std::string strCalibrationTime; //校正时间
  267. std::string strCalibrationDue; //校正过期日
  268. std::string strSoftware;
  269. std::string strWorkDir; //SDK配置文件路径
  270. std::string strGainPath; //加载Gain文件路径
  271. std::string strDefectPath; //加载Defect文件路径
  272. int nConnectTimeout;
  273. bool bSDKSaveLog; //SDK是否保存日志
  274. std::string strSDKSaveLogPath; //SDK保存日志的路径
  275. bool bSDKSaveRaw; //SDK是否保存原始Raw图
  276. std::string strSDKSaveRawPath; //SDK保存Raw图路径
  277. DeviceIndexStruct()
  278. {
  279. nDetectorID = 0;
  280. bInitOK = false;
  281. bConnectStatus = false;
  282. bExisted = false;
  283. bReadWifi = false;
  284. bReadTemperature = false;
  285. bReadBattery = false;
  286. bCharging = false;
  287. bUpdateFirmware = false;
  288. bUploadCalibFile = false;
  289. bRecoveringImage = false;
  290. bWireless = false;
  291. bImagePending = false;
  292. bActived = true;
  293. bStatusPollEnable = false;
  294. bTemperatureEnable = false;
  295. bHumidityEnable = false;
  296. bBatteryEnable = false;
  297. bWifiEnable = false;
  298. bGainDefectEnable = false;
  299. strDetectorModel = ""; //探测器名称
  300. strDeviceName = ""; //探测器名称
  301. strWifiSSID = "NULL"; //无线探测器SSID名称
  302. nSyncMode = 0;
  303. nSaturationValue = 0;
  304. nGridSuppressed = 0;
  305. nDoseOfEXI = 0;
  306. strPanelSerial = "";
  307. strFPDConfFilePath = "";//探测器自身配置文件路径
  308. strCalibrationDate = (" ");
  309. strCalibrationTime = (" ");
  310. strCalibrationDue = (" ");
  311. fFactorEXI2UGY = 0.0f;
  312. bPreviewEnable = false;
  313. fTemperMaxLimit = 0.0f;
  314. fTemperUpLimit = 0.0f;
  315. fTemperLowLimit = 0.0f;
  316. fTemperMinLimit = 0.0f;
  317. fCalibTemperUp = 0.0f;
  318. fCalibTemperLow = 0.0f;
  319. fCalibTemperature = 0.0f;
  320. fCurrentTemperValue = 0.0f;
  321. nWorkstation = -1;
  322. nWifiWarning = 0;
  323. nWifiLimit = 0;
  324. nCurrentWifiValue = -1;
  325. nBatteryWarning = 0;
  326. nBatteryLimit = 0;
  327. nCurrentBatteryValue = 0;
  328. nGridSuppFilterType = 0;
  329. nShockTimes = -1;
  330. nWifiChannel = 0;
  331. nWifiDataRate = 0;
  332. nWifiSignalPower = 0;
  333. nWifiNoisePower = 0;
  334. nCalibDueSetting = 0;
  335. nMaxShockNumber = 0;
  336. nForceGridSuppress = 0;
  337. nGridSuppressed = 0;
  338. fGridSuppressParam1 = 0.0;
  339. fGridSuppressParam2 = 0.0;
  340. fGridSuppressParam3 = 0.0;
  341. fGridSuppressParam4 = 0.0;
  342. fGridSuppressParam5 = 0.0;
  343. fGridSuppressParam6 = 0.0;
  344. fGridSuppressParam7 = 0.0;
  345. fGridSuppressParam8 = 0.0;
  346. fGridSuppressParam9 = 0.0;
  347. nSaveRaw = 0;
  348. nSID = 0;
  349. nPixelSpace = 143;
  350. //ECM信息相关
  351. nImageBits = 0;
  352. nRawWidth = 0;
  353. nRawHeight = 0;
  354. nFullImageWidth = 0;
  355. nFullImageHeight = 0;
  356. nPreviewWidth = 0;
  357. nPreviewHeight = 0;
  358. nWidthOffset = 0;
  359. nHeightOffset = 0;
  360. nConnectTimeout = 0;
  361. nFirmwareStatus = -1;
  362. nTemperatureStatus = 0;
  363. nLastImageID = 0;
  364. strWiredIP = "";
  365. strWirelessIP = "";
  366. strLocalIP = "";
  367. strWorkDir = "";
  368. bSDKSaveLog = false;
  369. strSDKSaveLogPath = "";
  370. bSDKSaveRaw = false;
  371. strSDKSaveRawPath = "";
  372. strGainPath = "\\";
  373. strDefectPath = "\\";
  374. }
  375. };
  376. enum APP_STATUS
  377. {
  378. APP_STATUS_IDLE = 0,
  379. APP_STATUS_WORK_BEGIN, //1
  380. APP_STATUS_WORK_END, //2
  381. APP_STATUS_DETSHARE_BEGIN, //3
  382. APP_STATUS_DETSHAR_END, //4
  383. APP_STATUS_CAL_BEGIN, //5
  384. APP_STATUS_CAL_END, // 6
  385. APP_STATUS_WORK_IN_SENSITIVITY, //7
  386. };
  387. enum GRID_STATUS
  388. {
  389. GRID_STATE_ERROR = -3,
  390. GRID_STATE_PARAM_ERROR = -2,
  391. GRID_STATE_PARAM_NULL = -1,
  392. GRID_STATE_NO = 0,
  393. GRID_STATE_VERTICAL = 1,
  394. GRID_STATE_HORIZONTAL = 2,
  395. };
  396. enum TEMP_STATUS
  397. {
  398. TEMP_NORMAL = 0,
  399. TEMP_WARNING, //1
  400. TEMP_TOO_HIGH, //2
  401. TEMP_TOO_LOW, //3
  402. };
  403. //----------------------------------------SDK Function--------------------------------------------//
  404. #ifndef YUYING_API
  405. #define YUYING_API typedef __declspec(dllimport)
  406. YUYING_API int(__cdecl* Func_YI_Initialize_FPD_V4)(const char*, int, const char*, int, char*);
  407. YUYING_API int(__cdecl* Func_YI_FPD_Set_Work_Mode)(const char*, ModeType);
  408. YUYING_API int(__cdecl* Func_YI_FPD_Stop_Capture_Image)(const char*);
  409. YUYING_API int(__cdecl* Func_YI_FPD_Get_Configure_Common)(const char*, int, YIConfigInfo_Common*);
  410. YUYING_API int(__cdecl* Func_YI_FPD_Set_Configure_Common)(const char*, int, const YIConfigInfo_Common*);
  411. YUYING_API int(__cdecl* Func_YI_FPD_Get_Configure_SyncOut_Mode)(const char*, int, int, YIConfigInfo_SyncOut*);
  412. YUYING_API int(__cdecl* Func_YI_FPD_Set_Configure_SyncOut_Mode)(const char*, int, int, const YIConfigInfo_SyncOut*);
  413. YUYING_API int(__cdecl* Func_YI_FPD_Restore_Factory_Settings)(const char*);
  414. YUYING_API int(__cdecl* Func_YI_FPD_Subtract_Offset)(const char*, bool);
  415. YUYING_API int(__cdecl* Func_YI_ImageReady_Callback_Register)(const char*, ImageReadyCallbackFunc);
  416. YUYING_API int(__cdecl* Func_YI_ImageReady_Callback_Register_Ex)(const char*, ImageReadyCallbackFuncEx);
  417. YUYING_API int(__cdecl* Func_YI_SystemInfo_Callback_Register)(const char*, SystemInfoCallbackFunc);
  418. YUYING_API int(__cdecl* Func_YI_SystemInfo_Callback_Register_Ex)(const char*, SystemInfoCallbackFuncEx);
  419. YUYING_API int(__cdecl* Func_YI_Get_Callback_Image_Size)(const char*, int&, int&, int&);
  420. YUYING_API int(__cdecl* Func_YI_GetLastErrorCode)();
  421. YUYING_API int(__cdecl* Func_YI_Set_Save_Log_Flag)(bool, const char*);
  422. YUYING_API int(__cdecl* Func_YI_GetLoacalIPs_V4)(char**);
  423. YUYING_API int(__cdecl* Func_YI_Set_Image_Save_State)(const char*, bool);
  424. YUYING_API int(__cdecl* Func_YI_Set_Image_Save_Path)(const char*, const char*);
  425. YUYING_API int(__cdecl* Func_YI_FPD_Get_FPD_TYPE)(const char*, int&);
  426. YUYING_API int(__cdecl* Func_YI_FPD_Get_Invalid_Region)(const char*, int&, int&, int&, int&);
  427. YUYING_API int(__cdecl* Func_YI_FPD_Write_Configure_Common_To_File)(const char*, const YIConfigInfo_Common*);
  428. YUYING_API int(__cdecl* Func_YI_FPD_Read_Configure_Common_From_File)(const char*, YIConfigInfo_Common*);
  429. YUYING_API int(__cdecl* Func_YI_FPD_Write_Configure_SyncOut_To_File)(const char*, int, const YIConfigInfo_SyncOut*);
  430. YUYING_API int(__cdecl* Func_YI_FPD_Read_Configure_SyncOut_From_File)(const char*, int, YIConfigInfo_SyncOut*);
  431. YUYING_API int(__cdecl* Func_YI_FPD_Capture_Image)(const char*, int);
  432. YUYING_API int(__cdecl* Func_YI_FPD_Capture_Prepare)(const char*);
  433. YUYING_API int(__cdecl* Func_YI_Load_Gain_Tmp_File)(const char*, const char*);
  434. YUYING_API int(__cdecl* Func_YI_Load_Defect_Tmp_File)(const char*, const char*);
  435. YUYING_API int(__cdecl* Func_YI_Load_Offset_Tmp_File)(const char*, const char*);
  436. YUYING_API int(__cdecl* Func_YI_Load_AED_Offset_Tmp_File)(const char*, const char*);
  437. YUYING_API int(__cdecl* Func_YI_Set_Correct_Type)(const char*, int);
  438. YUYING_API int(__cdecl* Func_YI_FPD_DO_Correction)(unsigned short*, int, int, char, const char*, const char*, const char*, const char*);
  439. YUYING_API int(__cdecl* Func_YI_FPD_Wifi_Re_Connect)(const char*, const char*, int);
  440. YUYING_API int(__cdecl* Func_YI_FPD_Wifi_Set_Work_Mode)(const char*, int);
  441. YUYING_API int(__cdecl* Func_YI_FPD_Wifi_Get_Work_Mode)(const char*, int&);
  442. YUYING_API int(__cdecl* Func_YI_FPD_Wifi_Set_Name)(const char*, const char*);
  443. YUYING_API int(__cdecl* Func_YI_FPD_Wifi_Set_Power_Down)(const char*);
  444. YUYING_API int(__cdecl* Func_YI_FPD_Wifi_Set_IP_Address)(const char*, int*);
  445. YUYING_API int(__cdecl* Func_YI_FPD_Wifi_Set_Route_Info)(const char*, char*, char*);
  446. #endif
  447. //----------------------------------------SDK Function over--------------------------------------------//