DetectorDefinition.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. #pragma once
  2. #include <string>
  3. //SDK头文件
  4. #include "SDK/include/YuYingAPI.h"
  5. extern const char * TriggerModeName[];
  6. extern const char * PanelErrorStatus[];
  7. extern const char * DetectorState[];
  8. extern const char * PrepCapMode[];
  9. extern const char * Enm_Switch[];
  10. extern const char * InnerSubFlow[];
  11. typedef struct
  12. {
  13. int nReferDose;
  14. int nAvgNum;
  15. }RefrenceCal;
  16. enum FW_STATUS
  17. {
  18. FW_NEED_UPDATE = 1,
  19. FW_MANDATORY_UPDATE,
  20. FW_NOT_SUPPORT,
  21. FW_NEW,
  22. FW_GET_ERROR
  23. };
  24. enum XIUYUAN_SYNC_MODE
  25. {
  26. TRIGGER_NONE,
  27. TRIGGER_SOFT,
  28. TRIGGER_PREP,
  29. TRIGGER_MAX
  30. };
  31. enum ENUM_EXPOSE_STATUS
  32. {
  33. DOSE_ACCEPT = 0,
  34. DOSE_TOO_HIGH = 1,
  35. DOSE_TOO_LOW = 2,
  36. DOSE_OBJECT = 3
  37. };
  38. typedef enum
  39. {
  40. EVT_LEVEL_CONFIGURATION = 0x00,
  41. EVT_LEVEL_INFORMATOION = 0x01,
  42. EVT_LEVEL_STATUS = 0x02,
  43. EVT_LEVEL_DATA = 0x03,
  44. EVT_LEVEL_WARNING = 0x04,
  45. EVT_LEVEL_ERROR = 0x05,
  46. } CcosEventLevel;
  47. typedef enum
  48. {
  49. EVT_CONF_PANEL_SERIAL = 0x00,
  50. EVT_CONF_RAW_WIDTH = 0x01,
  51. EVT_CONF_RAW_HIGHT = 0x02,
  52. EVT_CONF_RAW_BITS = 0x03,
  53. EVT_CONF_PIXELSPACE = 0x04,
  54. EVT_CONF_PREVIEW_WIDTH = 0x05,
  55. EVT_CONF_PREVIEW_HIGHT = 0x06,
  56. EVT_CONF_MODULE_TYPE = 0x07,
  57. EVT_CONF_MODULE_IP = 0x08,
  58. EVT_CONF_MODULE_SN = 0x09,
  59. EVT_CONF_FIRWARE_UPDATE = 0x0A,
  60. EVT_CONF_PART_NUMBER = 0x0B,
  61. EVT_CONF_BATTERY_SN = 0x0C,
  62. EVT_CONF_WIFI_SSID = 0x0D,
  63. EVT_CONF_IFBOARD = 0x0E,
  64. EVT_CONF_DATECODE = 0x0F,
  65. EVT_CONF_LIFETIME = 0x10,
  66. } CcosEventConfigID;
  67. typedef enum
  68. {
  69. EVT_INFO_POWER_ON = 0x00,
  70. EVT_INFO_BATTERY_CAPACITY = 0x01,
  71. EVT_INFO_BATTERY_TEMPERATURE = 0x02,
  72. EVT_INFO_BATTERY_CHARGES = 0x03,
  73. EVT_INFO_WIFI_DATARATE = 0x04,
  74. EVT_INFO_WIFI_CHANNEL = 0x05,
  75. EVT_INFO_WIFI_SIGNALPOWER = 0x06,
  76. EVT_INFO_WIFI_NOISEPOWER = 0x07,
  77. EVT_INFO_FIRMWARE = 0x08,
  78. EVT_INFO_SHOCKSENSOR_INFO = 0x09,
  79. EVT_INFO_CALIBRATIOIN_DATE = 0x0A,
  80. EVT_INFO_FPVOLTAGE = 0x0B,
  81. EVT_INFO_CALIBRATIOIN_DATEL = 0x0C, //长曝光模式
  82. EVT_INFO_CALIBRATIOIN_TIME = 0x0D,
  83. EVT_INFO_CALIBRATIOIN_TIMEL = 0x0E,
  84. } CcosEventInfoID;
  85. typedef enum
  86. {
  87. EVT_STATUS_INIT = 0x00,
  88. EVT_STATUS_MOTION = 0x01,
  89. EVT_STATUS_UPDATE_FIRMWARE = 0x02,
  90. EVT_STATUS_SELFTEST = 0x03,
  91. EVT_STATUS_DETECTORSHARE = 0x04,
  92. EVT_STATUS_SINGLEINIT = 0x05,
  93. EVT_STATUS_SELECTPANEL = 0x06,
  94. EVT_STATUS_PANEL = 0x07,
  95. EVT_STATUS_CALIBRATIOIN = 0x08,
  96. EVT_STATUS_SAVECALIB = 0x09,
  97. EVT_STATUS_SAVEDEFECT = 0x0A,
  98. EVT_STATUS_ACQUISITION = 0x0B,
  99. EVT_STATUS_SINGLEEXP = 0x0C,
  100. EVT_STATUS_IMAGEPENDING = 0x0D,
  101. EVT_STATUS_TEMPERATURE = 0x0E,
  102. EVT_STATUS_WIFI = 0x0F,
  103. EVT_STATUS_BATTERY_VALUE = 0x10,
  104. EVT_STATUS_BATTERY_CHARGING = 0x11,
  105. EVT_STATUS_SHOCK_SENSOR = 0x12,
  106. EVT_STATUS_HALL_SENSOR = 0x13,
  107. EVT_STATUS_PING = 0x14,
  108. EVT_STATUS_PMSNOTOPEN = 0x15,
  109. EVT_STATUS_RESTOREFILES = 0x16,
  110. EVT_STATUS_LASTERROR = 0x17,
  111. EVT_STATUS_RESET = 0x18,
  112. EVT_STATUS_IMAGERECOVERAUTO = 0x19,
  113. EVT_STATUS_PREPARE_EDNCALIBRATION = 0x21,
  114. } CcosEventStatusID;
  115. typedef enum
  116. {
  117. EVT_DATA_RAW_IMAGE = 0x00,
  118. EVT_DATA_PREVIEW_IMAGE = 0x01,
  119. EVT_DATA_DOSEPARAM = 0x02,
  120. } CcosEventDataID;
  121. typedef enum
  122. {
  123. EVT_ERR_COMMUNICATE = 0x00,
  124. EVT_ERR_EXP_REQUEST = 0x01,
  125. EVT_ERR_GET_IMAGE = 0x02,
  126. EVT_ERR_MAX_NUMBER = 0x03,
  127. EVT_ERR_SN_NOTINLIST = 0x04,
  128. EVT_ERR_POWER_OFF = 0x05,
  129. EVT_ERR_INIT_FAILED = 0x06,
  130. } CcosEventErrorID;
  131. struct DeviceIndexStruct
  132. {
  133. int nDetectorID;
  134. bool bInitOK;
  135. bool bConnectStatus;
  136. bool bExisted;
  137. bool bReadWifi;
  138. bool bReadTemperature;
  139. bool bReadBattery;
  140. bool bCharging;
  141. bool bUpdateFirmware;
  142. bool bUploadCalibFile;
  143. bool bRecoveringImage;
  144. bool bWireless;
  145. bool bImagePending;
  146. bool bHumidityEnable;
  147. bool bGainDefectEnable;
  148. bool bSupportDDR; //是否支持DDR采集模式
  149. int nCalibMode;
  150. int nWifiWarning;
  151. int nWifiLimit;
  152. int nCurrentWifiValue;
  153. int nBatteryWarning;
  154. int nBatteryLimit;
  155. int nCurrentBatteryValue;
  156. int nNotifyStatusTimePeriod;//通知状态信息时间间隔,从模型文件中读取
  157. int nWifiChannel;
  158. int nWifiDataRate;
  159. int nWifiSignalPower;
  160. int nWifiNoisePower;
  161. float fCalibTemperature;
  162. int nSaveRaw;
  163. int nSID;
  164. //ECM信息相关
  165. int nRawWidth;
  166. int nRawHeight;
  167. int nWidthOffset;
  168. int nHeightOffset;
  169. int nGridSuppFilterType;
  170. int nFirmwareStatus;
  171. int nTemperatureStatus;
  172. int nLastImageID;
  173. int nReconnectTimePeriod;
  174. int nExpWindowMode;
  175. int nXWindow;
  176. float fFactorEXI2UGY; //探测器EXI -> UGY 转换系数
  177. //Temperature
  178. float fTemperatureErrorMin;//最低温度值
  179. float fTemperatureErrorMax;//最高温度值
  180. float fTemperatureWarnMin;//低温警告
  181. float fTemperatureWarnMax;//高温警告
  182. float fCurrentTemperValue;//当前温度
  183. std::string strDeviceName; //探测器名称
  184. std::string strWifiSSID;
  185. std::string strPanelSerial;
  186. std::string strFPDConfFilePath;//探测器自身配置文件路径
  187. std::string strCalibrationDue; //校正过期日
  188. std::string strSoftware;
  189. std::string strWorkDir; //SDK配置文件路径
  190. std::string strSupportSyncMode;
  191. std::string strGainPath; //加载Gain文件路径
  192. std::string strDefectPath; //加载Defect文件路径
  193. bool bSDKSaveLog; //SDK是否保存日志
  194. std::string strSDKSaveLogPath; //SDK保存日志的路径
  195. bool bSDKSaveRaw; //SDK是否保存原始Raw图
  196. std::string strSDKSaveRawPath; //SDK保存Raw图路径
  197. DeviceIndexStruct()
  198. {
  199. nDetectorID = 0;
  200. bInitOK = false;
  201. bConnectStatus = false;
  202. bExisted = false;
  203. bReadWifi = false;
  204. bReadTemperature = false;
  205. bReadBattery = false;
  206. bCharging = false;
  207. bUpdateFirmware = false;
  208. bUploadCalibFile = false;
  209. bRecoveringImage = false;
  210. bWireless = false;
  211. bImagePending = false;
  212. bHumidityEnable = false;
  213. bGainDefectEnable = false;
  214. strDeviceName = ""; //探测器名称
  215. strWifiSSID = "NULL"; //无线探测器SSID名称
  216. nCalibMode = 0;
  217. strPanelSerial = "";
  218. strFPDConfFilePath = "";//探测器自身配置文件路径
  219. strCalibrationDue = (" ");
  220. fFactorEXI2UGY = 0.0f;
  221. fCalibTemperature = 0.0f;
  222. fCurrentTemperValue = 0.0f;
  223. nWifiWarning = 0;
  224. nWifiLimit = 0;
  225. nCurrentWifiValue = -1;
  226. nBatteryWarning = 0;
  227. nBatteryLimit = 0;
  228. nCurrentBatteryValue = 0;
  229. nGridSuppFilterType = 0;
  230. nWifiChannel = 0;
  231. nWifiDataRate = 0;
  232. nWifiSignalPower = 0;
  233. nWifiNoisePower = 0;
  234. nSaveRaw = 0;
  235. nSID = 0;
  236. nReconnectTimePeriod = 0;
  237. //ECM信息相关
  238. nRawWidth = 0;
  239. nRawHeight = 0;
  240. nWidthOffset = 0;
  241. nHeightOffset = 0;
  242. nFirmwareStatus = -1;
  243. nTemperatureStatus = 0;
  244. nLastImageID = 0;
  245. strWorkDir = "";
  246. bSDKSaveLog = false;
  247. strSDKSaveLogPath = "";
  248. bSDKSaveRaw = false;
  249. strSDKSaveRawPath = "";
  250. strGainPath = "\\";
  251. strDefectPath = "\\";
  252. }
  253. };
  254. enum APP_STATUS
  255. {
  256. APP_STATUS_IDLE = 0,
  257. APP_STATUS_WORK_BEGIN, //1
  258. APP_STATUS_WORK_END, //2
  259. APP_STATUS_DETSHARE_BEGIN, //3
  260. APP_STATUS_DETSHAR_END, //4
  261. APP_STATUS_CAL_BEGIN, //5
  262. APP_STATUS_CAL_END, // 6
  263. APP_STATUS_WORK_IN_SENSITIVITY, //7
  264. };
  265. enum GRID_STATUS
  266. {
  267. GRID_STATE_ERROR = -3,
  268. GRID_STATE_PARAM_ERROR = -2,
  269. GRID_STATE_PARAM_NULL = -1,
  270. GRID_STATE_NO = 0,
  271. GRID_STATE_VERTICAL = 1,
  272. GRID_STATE_HORIZONTAL = 2,
  273. };
  274. enum TEMP_STATUS
  275. {
  276. TEMP_NORMAL = 0,
  277. TEMP_WARNING, //1
  278. TEMP_TOO_HIGH, //2
  279. TEMP_TOO_LOW, //3
  280. };
  281. //探测器状态
  282. enum PanelStatus
  283. {
  284. PANEL_CLOSE,
  285. PANEL_CONNECT,
  286. PANEL_STANDBY,
  287. PANEL_READY_EXP,
  288. PANEL_XWINDOW_ON,
  289. PANEL_XWINDOW_OFF,
  290. PANEL_START_TRANSMIT,
  291. PANEL_END_TRANSMIT,
  292. PANEL_START_ACQ,
  293. PANEL_END_ACQ,
  294. PANEL_EXP_END_TIMEOUT,
  295. PANEL_OFFSET_CAL,
  296. PANEL_OFFSET_FINISH,
  297. PANEL_GAIN_CAL,
  298. PANEL_GAIN_FINISH,
  299. PANEL_DEFECT_CAL,
  300. PANEL_DEFECT_FINISH,
  301. PANEL_XRAY_ON,
  302. PANEL_XRAY_OFF,
  303. PANEL_INIT = 21,
  304. PANEL_SLEEP,
  305. PANEL_GET_IMAGE,
  306. PANEL_GAIN_PREPARE,
  307. PANEL_GAIN_READY_EXP
  308. };
  309. //探测器异步事件状态
  310. enum PanelEventState
  311. {
  312. PANEL_EVENT_END_OK = 0,
  313. PANEL_EVENT_END_ERROR = 1,
  314. PANEL_EVENT_START = 2,
  315. PANEL_EVENT_SUCCESS = 3,
  316. PANEL_EVENT_END = 4,
  317. PANEL_EVENT_BEGIN = 5,
  318. PANEL_EVENT_TIMEOUT = 6
  319. };
  320. //----------------------------------------SDK Function--------------------------------------------//
  321. #ifndef XIUYUAN_API
  322. #define XIUYUAN_API typedef __declspec(dllimport)
  323. XIUYUAN_API int(__cdecl* Func_YI_Initialize_FPD_V4)(const char*, int, char*);
  324. XIUYUAN_API int(__cdecl* Func_YI_FPD_Close)(const char*);
  325. XIUYUAN_API int(__cdecl* Func_YI_FPD_Set_Work_Mode)(const char*, FpdMode*);
  326. XIUYUAN_API int(__cdecl* Func_YI_FPD_Stop_Capture_Image)(const char*);
  327. XIUYUAN_API int(__cdecl* Func_YI_FPD_Get_Configure_Common)(const char*, YIConfigInfo_Common*);
  328. XIUYUAN_API int(__cdecl* Func_YI_FPD_Set_Configure_Common)(const char*, const YIConfigInfo_Common*);
  329. XIUYUAN_API int(__cdecl* Func_YI_FPD_Get_Configure_SyncOut_Mode)(const char*, YIConfigInfo_SyncOut*);
  330. XIUYUAN_API int(__cdecl* Func_YI_FPD_Set_Configure_SyncOut_Mode)(const char*, const YIConfigInfo_SyncOut*);
  331. XIUYUAN_API int(__cdecl* Func_YI_FPD_Restore_Factory_Settings)(const char*);
  332. XIUYUAN_API int(__cdecl* Func_YI_Subtract_Offset)(const char*, bool);
  333. XIUYUAN_API int(__cdecl* Func_YI_ImageReady_Callback_Register)(const char*, ImageReadyCallbackFunc);
  334. XIUYUAN_API int(__cdecl* Func_YI_SystemInfo_Callback_Register)(const char*, SystemInfoCallbackFunc);
  335. XIUYUAN_API int(__cdecl* Func_YI_Get_Callback_Image_Size)(const char*, int&, int&, int&);
  336. XIUYUAN_API int(__cdecl* Func_YI_GetLastErrorCode)();
  337. XIUYUAN_API int(__cdecl* Func_YI_Set_Save_Log_Flag)(bool, const char*);
  338. XIUYUAN_API int(__cdecl* Func_YI_FPD_Get_Invalid_Region)(const char*, int&, int&, int&, int&);
  339. XIUYUAN_API int(__cdecl* Func_YI_GetLoacalIPs_V4)(char**);
  340. XIUYUAN_API int(__cdecl* Func_YI_Set_Image_Save_State)(const char*, bool);
  341. XIUYUAN_API int(__cdecl* Func_YI_Set_Image_Save_Path)(const char*, const char*);
  342. XIUYUAN_API int(__cdecl* Func_YI_FPD_Get_FPD_TYPE)(const char*, int&);
  343. XIUYUAN_API int(__cdecl* Func_YI_FPD_Write_Configure_Common_To_File)(const char*, const YIConfigInfo_Common*);
  344. XIUYUAN_API int(__cdecl* Func_YI_FPD_Read_Configure_Common_From_File)(const char*, YIConfigInfo_Common*);
  345. XIUYUAN_API int(__cdecl* Func_YI_FPD_Write_Configure_SyncOut_To_File)(const char*, int, const YIConfigInfo_SyncOut*);
  346. XIUYUAN_API int(__cdecl* Func_YI_FPD_Read_Configure_SyncOut_From_File)(const char*, int, YIConfigInfo_SyncOut*);
  347. XIUYUAN_API int(__cdecl* Func_YI_FPD_Capture_Image)(const char*, int);
  348. XIUYUAN_API int(__cdecl* Func_YI_FPD_Capture_Prepare)(const char*);
  349. XIUYUAN_API int(__cdecl* Func_YI_Load_Gain_Tmp_File)(const char*, const char*);
  350. XIUYUAN_API int(__cdecl* Func_YI_Load_Defect_Tmp_File)(const char*, const char*);
  351. XIUYUAN_API int(__cdecl* Func_YI_Load_Offset_Tmp_File)(const char*, const char*);
  352. XIUYUAN_API int(__cdecl* Func_YI_Load_AED_Offset_Tmp_File)(const char*, const char*);
  353. XIUYUAN_API int(__cdecl* Func_YI_Set_Correct_Type)(const char*, int);
  354. XIUYUAN_API int(__cdecl* Func_YI_GainCalibrate)(const char*, unsigned long int, unsigned char*);
  355. XIUYUAN_API int(__cdecl* Func_YI_OffsetCalibrate)(const char*, unsigned long int, unsigned char*);
  356. XIUYUAN_API int(__cdecl* Func_YI_DefectCalibrate)(const char*, unsigned long int, unsigned char*);
  357. XIUYUAN_API int(__cdecl* Func_YI_AEDOffsetCalibrate)(const char*, unsigned long int, unsigned char*);
  358. XIUYUAN_API int(__cdecl* Func_YI_SetWorkMode)(const char*, unsigned long int, unsigned char*);
  359. XIUYUAN_API int(__cdecl* Func_YI_GetWorkMode)(const char*, unsigned long int, unsigned char*);
  360. XIUYUAN_API int(__cdecl* Func_YI_SetDosage)(const char*, unsigned long int, unsigned char*);
  361. XIUYUAN_API int(__cdecl* Func_YI_SetROIRegion)(const char*, unsigned long int, unsigned char*);
  362. XIUYUAN_API int(__cdecl* Func_YI_ThermalSensor)(const char*, unsigned long int, unsigned char*);
  363. XIUYUAN_API int(__cdecl* Func_YI_1256Parameter)(const char*, unsigned long int, unsigned char*);
  364. XIUYUAN_API int(__cdecl* Func_YI_Restart)(const char*);
  365. XIUYUAN_API int(__cdecl* Func_YI_Reset)(const char*);
  366. XIUYUAN_API int(__cdecl* Func_YI_GetStatus)(const char*);
  367. XIUYUAN_API int(__cdecl* Func_YI_GetVersion)(const char*);
  368. XIUYUAN_API int(__cdecl* Func_YI_FPD_FreeBuffer)(const char*);
  369. #endif
  370. //----------------------------------------SDK Function over--------------------------------------------//