DetectorDefinition.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  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_XRAY_ON,
  166. PANEL_XRAY_OFF,
  167. PANEL_INIT = 21,
  168. PANEL_SLEEP = 22,
  169. PANEL_GET_IMAGE = 23,
  170. PANEL_GAIN_PREPARE = 24,
  171. PANEL_GAIN_READY_EXP = 25,
  172. PANEL_OFFSET_FAILED = 26,
  173. };
  174. struct DeviceIndexStruct
  175. {
  176. int nDetectorID;
  177. bool bInitOK;
  178. bool bConnectStatus;
  179. bool bActived;
  180. bool bExisted;
  181. bool bReadWifi;
  182. bool bReadTemperature;
  183. bool bReadBattery;
  184. bool bCharging;
  185. bool bUpdateFirmware;
  186. bool bUploadCalibFile;
  187. bool bRecoveringImage;
  188. bool bWireless;
  189. bool bImagePending;
  190. bool bPreviewEnable;
  191. bool bTemperatureEnable;
  192. bool bHumidityEnable;
  193. bool bBatteryEnable;
  194. bool bWifiEnable;
  195. bool bGainDefectEnable;
  196. bool bSupportDDR; //是否支持DDR采集模式
  197. int nSyncMode;
  198. int nDoseOfEXI;
  199. int nWorkstation;
  200. int nWifiWarning;
  201. int nWifiLimit;
  202. int nCurrentWifiValue;
  203. int nBatteryWarning;
  204. int nBatteryLimit;
  205. int nCurrentBatteryValue;
  206. int nWifiChannel;
  207. int nWifiDataRate;
  208. int nWifiSignalPower;
  209. int nWifiNoisePower;
  210. int nCalibDueSetting;
  211. int nShockTimes;
  212. int nMaxShockNumber;
  213. float fCalibTemperature;
  214. int nSaveRaw;
  215. int nSID;
  216. //ECM信息相关
  217. int nImageBits;
  218. int nRawWidth;
  219. int nRawHeight;
  220. int nFullImageWidth;
  221. int nFullImageHeight;
  222. int nPreviewWidth;
  223. int nPreviewHeight;
  224. int nWidthOffset;
  225. int nHeightOffset;
  226. int nImageLeftOffset;
  227. int nImageTopOffset;
  228. int nImageRightOffset;
  229. int nImageBottomOffset;
  230. int nGridSuppFilterType;
  231. int nFirmwareStatus;
  232. int nTemperatureStatus;
  233. int nLastImageID;
  234. int nPixelSpace; //像素大小
  235. int nExpWindowMode;
  236. int nXWindow;
  237. float fFactorEXI2UGY; //探测器EXI -> UGY 转换系数
  238. //Temperature
  239. float fTemperMaxLimit;
  240. float fTemperUpLimit;
  241. float fTemperLowLimit;
  242. float fTemperMinLimit;
  243. float fCalibTemperUp;
  244. float fCalibTemperLow;
  245. float fTemperatureErrorMin;//最低温度值
  246. float fTemperatureErrorMax;//最高温度值
  247. float fTemperatureWarnMin;//低温警告
  248. float fTemperatureWarnMax;//高温警告
  249. float fCurrentTemperValue;//当前温度
  250. std::string strDeviceName; //探测器名称
  251. std::string strWifiSSID;
  252. std::string strPanelSerial;
  253. std::string strFPDConfFilePath;//探测器自身配置文件路径
  254. std::string strWiredIP; //有线IP
  255. std::string strWirelessIP; //无线IP
  256. std::string strLocalIP; //本地IP
  257. std::string strCalibrationDate; //校正日期
  258. std::string strCalibrationTime; //校正时间
  259. std::string strCalibrationDue; //校正过期日
  260. std::string strSoftware;
  261. std::string strWorkDir; //SDK配置文件路径
  262. std::string strSupportSyncMode;
  263. std::string strGainPath; //加载Gain文件路径
  264. std::string strDefectPath; //加载Defect文件路径
  265. bool bSDKSaveLog; //SDK是否保存日志
  266. std::string strSDKSaveLogPath; //SDK保存日志的路径
  267. bool bSDKSaveRaw; //SDK是否保存原始Raw图
  268. std::string strSDKSaveRawPath; //SDK保存Raw图路径
  269. DeviceIndexStruct()
  270. {
  271. nDetectorID = 0;
  272. bInitOK = false;
  273. bConnectStatus = false;
  274. bExisted = false;
  275. bReadWifi = false;
  276. bReadTemperature = false;
  277. bReadBattery = false;
  278. bCharging = false;
  279. bUpdateFirmware = false;
  280. bUploadCalibFile = false;
  281. bRecoveringImage = false;
  282. bWireless = false;
  283. bImagePending = false;
  284. bActived = true;
  285. bTemperatureEnable = false;
  286. bHumidityEnable = false;
  287. bBatteryEnable = false;
  288. bWifiEnable = false;
  289. bGainDefectEnable = false;
  290. strDeviceName = ""; //探测器名称
  291. strWifiSSID = "NULL"; //无线探测器SSID名称
  292. nSyncMode = 0;
  293. nDoseOfEXI = 0;
  294. strPanelSerial = "";
  295. strFPDConfFilePath = "";//探测器自身配置文件路径
  296. strCalibrationDate = (" ");
  297. strCalibrationTime = (" ");
  298. strCalibrationDue = (" ");
  299. fFactorEXI2UGY = 0.0f;
  300. bPreviewEnable = false;
  301. fTemperMaxLimit = 0.0f;
  302. fTemperUpLimit = 0.0f;
  303. fTemperLowLimit = 0.0f;
  304. fTemperMinLimit = 0.0f;
  305. fCalibTemperUp = 0.0f;
  306. fCalibTemperLow = 0.0f;
  307. fCalibTemperature = 0.0f;
  308. fCurrentTemperValue = 0.0f;
  309. nWorkstation = -1;
  310. nWifiWarning = 0;
  311. nWifiLimit = 0;
  312. nCurrentWifiValue = -1;
  313. nBatteryWarning = 0;
  314. nBatteryLimit = 0;
  315. nCurrentBatteryValue = 0;
  316. nGridSuppFilterType = 0;
  317. nShockTimes = -1;
  318. nWifiChannel = 0;
  319. nWifiDataRate = 0;
  320. nWifiSignalPower = 0;
  321. nWifiNoisePower = 0;
  322. nCalibDueSetting = 0;
  323. nMaxShockNumber = 0;
  324. nSaveRaw = 0;
  325. nSID = 0;
  326. nPixelSpace = 143;
  327. //ECM信息相关
  328. nImageBits = 0;
  329. nRawWidth = 0;
  330. nRawHeight = 0;
  331. nFullImageWidth = 0;
  332. nFullImageHeight = 0;
  333. nPreviewWidth = 0;
  334. nPreviewHeight = 0;
  335. nWidthOffset = 0;
  336. nHeightOffset = 0;
  337. nFirmwareStatus = -1;
  338. nTemperatureStatus = 0;
  339. nLastImageID = 0;
  340. strWiredIP = "";
  341. strWirelessIP = "";
  342. strLocalIP = "";
  343. strWorkDir = "";
  344. bSDKSaveLog = false;
  345. strSDKSaveLogPath = "";
  346. bSDKSaveRaw = false;
  347. strSDKSaveRawPath = "";
  348. strGainPath = "\\";
  349. strDefectPath = "\\";
  350. }
  351. };
  352. enum APP_STATUS
  353. {
  354. APP_STATUS_IDLE = 0,
  355. APP_STATUS_WORK_BEGIN, //1
  356. APP_STATUS_WORK_END, //2
  357. APP_STATUS_DETSHARE_BEGIN, //3
  358. APP_STATUS_DETSHAR_END, //4
  359. APP_STATUS_CAL_BEGIN, //5
  360. APP_STATUS_CAL_END, // 6
  361. APP_STATUS_WORK_IN_SENSITIVITY, //7
  362. };
  363. enum GRID_STATUS
  364. {
  365. GRID_STATE_ERROR = -3,
  366. GRID_STATE_PARAM_ERROR = -2,
  367. GRID_STATE_PARAM_NULL = -1,
  368. GRID_STATE_NO = 0,
  369. GRID_STATE_VERTICAL = 1,
  370. GRID_STATE_HORIZONTAL = 2,
  371. };
  372. enum TEMP_STATUS
  373. {
  374. TEMP_NORMAL = 0,
  375. TEMP_WARNING, //1
  376. TEMP_TOO_HIGH, //2
  377. TEMP_TOO_LOW, //3
  378. };
  379. //----------------------------------------SDK Function--------------------------------------------//
  380. #ifndef YUYING_API
  381. #define YUYING_API typedef __declspec(dllimport)
  382. YUYING_API int(__cdecl* Func_YI_Initialize_FPD_V4)(const char*, int, const char*, int, char*);
  383. YUYING_API int(__cdecl* Func_YI_FPD_Set_Work_Mode)(const char*, ModeType);
  384. YUYING_API int(__cdecl* Func_YI_FPD_Stop_Capture_Image)(const char*);
  385. YUYING_API int(__cdecl* Func_YI_FPD_Get_Configure_Common)(const char*, int, YIConfigInfo_Common*);
  386. YUYING_API int(__cdecl* Func_YI_FPD_Set_Configure_Common)(const char*, int, const YIConfigInfo_Common*);
  387. YUYING_API int(__cdecl* Func_YI_FPD_Get_Configure_SyncOut_Mode)(const char*, int, int, YIConfigInfo_SyncOut*);
  388. YUYING_API int(__cdecl* Func_YI_FPD_Set_Configure_SyncOut_Mode)(const char*, int, int, const YIConfigInfo_SyncOut*);
  389. YUYING_API int(__cdecl* Func_YI_FPD_Restore_Factory_Settings)(const char*);
  390. YUYING_API int(__cdecl* Func_YI_FPD_Subtract_Offset)(const char*, bool);
  391. YUYING_API int(__cdecl* Func_YI_ImageReady_Callback_Register)(const char*, ImageReadyCallbackFunc);
  392. YUYING_API int(__cdecl* Func_YI_ImageReady_Callback_Register_Ex)(const char*, ImageReadyCallbackFuncEx);
  393. YUYING_API int(__cdecl* Func_YI_SystemInfo_Callback_Register)(const char*, SystemInfoCallbackFunc);
  394. YUYING_API int(__cdecl* Func_YI_SystemInfo_Callback_Register_Ex)(const char*, SystemInfoCallbackFuncEx);
  395. YUYING_API int(__cdecl* Func_YI_Get_Callback_Image_Size)(const char*, int&, int&, int&);
  396. YUYING_API int(__cdecl* Func_YI_GetLastErrorCode)();
  397. YUYING_API int(__cdecl* Func_YI_Set_Save_Log_Flag)(bool, const char*);
  398. YUYING_API int(__cdecl* Func_YI_GetLoacalIPs_V4)(char**);
  399. YUYING_API int(__cdecl* Func_YI_Set_Image_Save_State)(const char*, bool);
  400. YUYING_API int(__cdecl* Func_YI_Set_Image_Save_Path)(const char*, const char*);
  401. YUYING_API int(__cdecl* Func_YI_FPD_Get_FPD_TYPE)(const char*, int&);
  402. YUYING_API int(__cdecl* Func_YI_FPD_Get_Invalid_Region)(const char*, int&, int&, int&, int&);
  403. YUYING_API int(__cdecl* Func_YI_FPD_Write_Configure_Common_To_File)(const char*, const YIConfigInfo_Common*);
  404. YUYING_API int(__cdecl* Func_YI_FPD_Read_Configure_Common_From_File)(const char*, YIConfigInfo_Common*);
  405. YUYING_API int(__cdecl* Func_YI_FPD_Write_Configure_SyncOut_To_File)(const char*, int, const YIConfigInfo_SyncOut*);
  406. YUYING_API int(__cdecl* Func_YI_FPD_Read_Configure_SyncOut_From_File)(const char*, int, YIConfigInfo_SyncOut*);
  407. YUYING_API int(__cdecl* Func_YI_FPD_Capture_Image)(const char*, int);
  408. YUYING_API int(__cdecl* Func_YI_FPD_Capture_Prepare)(const char*);
  409. YUYING_API int(__cdecl* Func_YI_Load_Gain_Tmp_File)(const char*, const char*);
  410. YUYING_API int(__cdecl* Func_YI_Load_Defect_Tmp_File)(const char*, const char*);
  411. YUYING_API int(__cdecl* Func_YI_Load_Offset_Tmp_File)(const char*, const char*);
  412. YUYING_API int(__cdecl* Func_YI_Load_AED_Offset_Tmp_File)(const char*, const char*);
  413. YUYING_API int(__cdecl* Func_YI_Set_Correct_Type)(const char*, int);
  414. YUYING_API int(__cdecl* Func_YI_FPD_DO_Correction)(unsigned short*, int, int, char, const char*, const char*, const char*, const char*);
  415. YUYING_API int(__cdecl* Func_YI_FPD_Wifi_Re_Connect)(const char*, const char*, int);
  416. YUYING_API int(__cdecl* Func_YI_FPD_Wifi_Set_Work_Mode)(const char*, int);
  417. YUYING_API int(__cdecl* Func_YI_FPD_Wifi_Get_Work_Mode)(const char*, int&);
  418. YUYING_API int(__cdecl* Func_YI_FPD_Wifi_Set_Name)(const char*, const char*);
  419. YUYING_API int(__cdecl* Func_YI_FPD_Wifi_Set_Power_Down)(const char*);
  420. YUYING_API int(__cdecl* Func_YI_FPD_Wifi_Set_IP_Address)(const char*, int*);
  421. YUYING_API int(__cdecl* Func_YI_FPD_Wifi_Set_Route_Info)(const char*, char*, char*);
  422. #endif
  423. //----------------------------------------SDK Function over--------------------------------------------//