123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415 |
- #pragma once
- #include <string>
- //SDK头文件
- #include "SDK/include/YuYingAPI.h"
- extern const char * TriggerModeName[];
- extern const char * PanelErrorStatus[];
- extern const char * DetectorState[];
- extern const char * PrepCapMode[];
- extern const char * Enm_Switch[];
- extern const char * InnerSubFlow[];
- typedef struct
- {
- int nReferDose;
- int nAvgNum;
- }RefrenceCal;
- enum FW_STATUS
- {
- FW_NEED_UPDATE = 1,
- FW_MANDATORY_UPDATE,
- FW_NOT_SUPPORT,
- FW_NEW,
- FW_GET_ERROR
- };
- enum XIUYUAN_SYNC_MODE
- {
- TRIGGER_NONE,
- TRIGGER_SOFT,
- TRIGGER_PREP,
- TRIGGER_MAX
- };
- enum ENUM_EXPOSE_STATUS
- {
- DOSE_ACCEPT = 0,
- DOSE_TOO_HIGH = 1,
- DOSE_TOO_LOW = 2,
- DOSE_OBJECT = 3
- };
- typedef enum
- {
- EVT_LEVEL_CONFIGURATION = 0x00,
- EVT_LEVEL_INFORMATOION = 0x01,
- EVT_LEVEL_STATUS = 0x02,
- EVT_LEVEL_DATA = 0x03,
- EVT_LEVEL_WARNING = 0x04,
- EVT_LEVEL_ERROR = 0x05,
- } CcosEventLevel;
- typedef enum
- {
- EVT_CONF_PANEL_SERIAL = 0x00,
- EVT_CONF_RAW_WIDTH = 0x01,
- EVT_CONF_RAW_HIGHT = 0x02,
- EVT_CONF_RAW_BITS = 0x03,
- EVT_CONF_PIXELSPACE = 0x04,
- EVT_CONF_PREVIEW_WIDTH = 0x05,
- EVT_CONF_PREVIEW_HIGHT = 0x06,
- EVT_CONF_MODULE_TYPE = 0x07,
- EVT_CONF_MODULE_IP = 0x08,
- EVT_CONF_MODULE_SN = 0x09,
- EVT_CONF_FIRWARE_UPDATE = 0x0A,
- EVT_CONF_PART_NUMBER = 0x0B,
- EVT_CONF_BATTERY_SN = 0x0C,
- EVT_CONF_WIFI_SSID = 0x0D,
- EVT_CONF_IFBOARD = 0x0E,
- EVT_CONF_DATECODE = 0x0F,
- EVT_CONF_LIFETIME = 0x10,
- } CcosEventConfigID;
- typedef enum
- {
- EVT_INFO_POWER_ON = 0x00,
- EVT_INFO_BATTERY_CAPACITY = 0x01,
- EVT_INFO_BATTERY_TEMPERATURE = 0x02,
- EVT_INFO_BATTERY_CHARGES = 0x03,
- EVT_INFO_WIFI_DATARATE = 0x04,
- EVT_INFO_WIFI_CHANNEL = 0x05,
- EVT_INFO_WIFI_SIGNALPOWER = 0x06,
- EVT_INFO_WIFI_NOISEPOWER = 0x07,
- EVT_INFO_FIRMWARE = 0x08,
- EVT_INFO_SHOCKSENSOR_INFO = 0x09,
- EVT_INFO_CALIBRATIOIN_DATE = 0x0A,
- EVT_INFO_FPVOLTAGE = 0x0B,
- EVT_INFO_CALIBRATIOIN_DATEL = 0x0C, //长曝光模式
- EVT_INFO_CALIBRATIOIN_TIME = 0x0D,
- EVT_INFO_CALIBRATIOIN_TIMEL = 0x0E,
- } CcosEventInfoID;
- typedef enum
- {
- EVT_STATUS_INIT = 0x00,
- EVT_STATUS_MOTION = 0x01,
- EVT_STATUS_UPDATE_FIRMWARE = 0x02,
- EVT_STATUS_SELFTEST = 0x03,
- EVT_STATUS_DETECTORSHARE = 0x04,
- EVT_STATUS_SINGLEINIT = 0x05,
- EVT_STATUS_SELECTPANEL = 0x06,
- EVT_STATUS_PANEL = 0x07,
- EVT_STATUS_CALIBRATIOIN = 0x08,
- EVT_STATUS_SAVECALIB = 0x09,
- EVT_STATUS_SAVEDEFECT = 0x0A,
- EVT_STATUS_ACQUISITION = 0x0B,
- EVT_STATUS_SINGLEEXP = 0x0C,
- EVT_STATUS_IMAGEPENDING = 0x0D,
- EVT_STATUS_TEMPERATURE = 0x0E,
- EVT_STATUS_WIFI = 0x0F,
- EVT_STATUS_BATTERY_VALUE = 0x10,
- EVT_STATUS_BATTERY_CHARGING = 0x11,
- EVT_STATUS_SHOCK_SENSOR = 0x12,
- EVT_STATUS_HALL_SENSOR = 0x13,
- EVT_STATUS_PING = 0x14,
- EVT_STATUS_PMSNOTOPEN = 0x15,
- EVT_STATUS_RESTOREFILES = 0x16,
- EVT_STATUS_LASTERROR = 0x17,
- EVT_STATUS_RESET = 0x18,
- EVT_STATUS_IMAGERECOVERAUTO = 0x19,
- EVT_STATUS_PREPARE_EDNCALIBRATION = 0x21,
- } CcosEventStatusID;
- typedef enum
- {
- EVT_DATA_RAW_IMAGE = 0x00,
- EVT_DATA_PREVIEW_IMAGE = 0x01,
- EVT_DATA_DOSEPARAM = 0x02,
- } CcosEventDataID;
- typedef enum
- {
- EVT_ERR_COMMUNICATE = 0x00,
- EVT_ERR_EXP_REQUEST = 0x01,
- EVT_ERR_GET_IMAGE = 0x02,
- EVT_ERR_MAX_NUMBER = 0x03,
- EVT_ERR_SN_NOTINLIST = 0x04,
- EVT_ERR_POWER_OFF = 0x05,
- EVT_ERR_INIT_FAILED = 0x06,
- } CcosEventErrorID;
- struct DeviceIndexStruct
- {
- int nDetectorID;
- bool bInitOK;
- bool bConnectStatus;
- bool bExisted;
- bool bReadWifi;
- bool bReadTemperature;
- bool bReadBattery;
- bool bCharging;
- bool bUpdateFirmware;
- bool bUploadCalibFile;
- bool bRecoveringImage;
- bool bWireless;
- bool bImagePending;
- bool bHumidityEnable;
- bool bGainDefectEnable;
- bool bSupportDDR; //是否支持DDR采集模式
- int nCalibMode;
- int nWifiWarning;
- int nWifiLimit;
- int nCurrentWifiValue;
- int nBatteryWarning;
- int nBatteryLimit;
- int nCurrentBatteryValue;
- int nNotifyStatusTimePeriod;//通知状态信息时间间隔,从模型文件中读取
- int nWifiChannel;
- int nWifiDataRate;
- int nWifiSignalPower;
- int nWifiNoisePower;
- float fCalibTemperature;
- int nSaveRaw;
- int nSID;
- //ECM信息相关
- int nRawWidth;
- int nRawHeight;
- int nWidthOffset;
- int nHeightOffset;
- int nGridSuppFilterType;
- int nFirmwareStatus;
- int nTemperatureStatus;
- int nLastImageID;
- int nReconnectTimePeriod;
- int nExpWindowMode;
- int nXWindow;
- float fFactorEXI2UGY; //探测器EXI -> UGY 转换系数
- //Temperature
- float fTemperatureErrorMin;//最低温度值
- float fTemperatureErrorMax;//最高温度值
- float fTemperatureWarnMin;//低温警告
- float fTemperatureWarnMax;//高温警告
- float fCurrentTemperValue;//当前温度
- std::string strDeviceName; //探测器名称
- std::string strWifiSSID;
- std::string strPanelSerial;
- std::string strFPDConfFilePath;//探测器自身配置文件路径
- std::string strCalibrationDue; //校正过期日
- std::string strSoftware;
- std::string strWorkDir; //SDK配置文件路径
- std::string strSupportSyncMode;
- std::string strGainPath; //加载Gain文件路径
- std::string strDefectPath; //加载Defect文件路径
- bool bSDKSaveLog; //SDK是否保存日志
- std::string strSDKSaveLogPath; //SDK保存日志的路径
- bool bSDKSaveRaw; //SDK是否保存原始Raw图
- std::string strSDKSaveRawPath; //SDK保存Raw图路径
- DeviceIndexStruct()
- {
- nDetectorID = 0;
- bInitOK = false;
- bConnectStatus = false;
- bExisted = false;
- bReadWifi = false;
- bReadTemperature = false;
- bReadBattery = false;
- bCharging = false;
- bUpdateFirmware = false;
- bUploadCalibFile = false;
- bRecoveringImage = false;
- bWireless = false;
- bImagePending = false;
- bHumidityEnable = false;
- bGainDefectEnable = false;
- strDeviceName = ""; //探测器名称
- strWifiSSID = "NULL"; //无线探测器SSID名称
- nCalibMode = 0;
- strPanelSerial = "";
- strFPDConfFilePath = "";//探测器自身配置文件路径
- strCalibrationDue = (" ");
- fFactorEXI2UGY = 0.0f;
- fCalibTemperature = 0.0f;
- fCurrentTemperValue = 0.0f;
- nWifiWarning = 0;
- nWifiLimit = 0;
- nCurrentWifiValue = -1;
- nBatteryWarning = 0;
- nBatteryLimit = 0;
- nCurrentBatteryValue = 0;
- nGridSuppFilterType = 0;
- nWifiChannel = 0;
- nWifiDataRate = 0;
- nWifiSignalPower = 0;
- nWifiNoisePower = 0;
- nSaveRaw = 0;
- nSID = 0;
- nReconnectTimePeriod = 0;
- //ECM信息相关
- nRawWidth = 0;
- nRawHeight = 0;
- nWidthOffset = 0;
- nHeightOffset = 0;
- nFirmwareStatus = -1;
- nTemperatureStatus = 0;
- nLastImageID = 0;
- strWorkDir = "";
- bSDKSaveLog = false;
- strSDKSaveLogPath = "";
- bSDKSaveRaw = false;
- strSDKSaveRawPath = "";
- strGainPath = "\\";
- strDefectPath = "\\";
- }
- };
- enum APP_STATUS
- {
- APP_STATUS_IDLE = 0,
- APP_STATUS_WORK_BEGIN, //1
- APP_STATUS_WORK_END, //2
- APP_STATUS_DETSHARE_BEGIN, //3
- APP_STATUS_DETSHAR_END, //4
- APP_STATUS_CAL_BEGIN, //5
- APP_STATUS_CAL_END, // 6
- APP_STATUS_WORK_IN_SENSITIVITY, //7
- };
- enum GRID_STATUS
- {
- GRID_STATE_ERROR = -3,
- GRID_STATE_PARAM_ERROR = -2,
- GRID_STATE_PARAM_NULL = -1,
- GRID_STATE_NO = 0,
- GRID_STATE_VERTICAL = 1,
- GRID_STATE_HORIZONTAL = 2,
- };
- enum TEMP_STATUS
- {
- TEMP_NORMAL = 0,
- TEMP_WARNING, //1
- TEMP_TOO_HIGH, //2
- TEMP_TOO_LOW, //3
- };
- //探测器状态
- enum PanelStatus
- {
- PANEL_CLOSE,
- PANEL_CONNECT,
- PANEL_STANDBY,
- PANEL_READY_EXP,
- PANEL_XWINDOW_ON,
- PANEL_XWINDOW_OFF,
- PANEL_START_TRANSMIT,
- PANEL_END_TRANSMIT,
- PANEL_START_ACQ,
- PANEL_END_ACQ,
- PANEL_EXP_END_TIMEOUT,
- PANEL_OFFSET_CAL,
- PANEL_OFFSET_FINISH,
- PANEL_GAIN_CAL,
- PANEL_GAIN_FINISH,
- PANEL_DEFECT_CAL,
- PANEL_DEFECT_FINISH,
- PANEL_XRAY_ON,
- PANEL_XRAY_OFF,
- PANEL_INIT = 21,
- PANEL_SLEEP,
- PANEL_GET_IMAGE,
- PANEL_GAIN_PREPARE,
- PANEL_GAIN_READY_EXP
- };
- //探测器异步事件状态
- enum PanelEventState
- {
- PANEL_EVENT_END_OK = 0,
- PANEL_EVENT_END_ERROR = 1,
- PANEL_EVENT_START = 2,
- PANEL_EVENT_SUCCESS = 3,
- PANEL_EVENT_END = 4,
- PANEL_EVENT_BEGIN = 5,
- PANEL_EVENT_TIMEOUT = 6
- };
- //----------------------------------------SDK Function--------------------------------------------//
- #ifndef XIUYUAN_API
- #define XIUYUAN_API typedef __declspec(dllimport)
- XIUYUAN_API int(__cdecl* Func_YI_Initialize_FPD_V4)(const char*, int, char*);
- XIUYUAN_API int(__cdecl* Func_YI_FPD_Close)(const char*);
- XIUYUAN_API int(__cdecl* Func_YI_FPD_Set_Work_Mode)(const char*, FpdMode*);
- XIUYUAN_API int(__cdecl* Func_YI_FPD_Stop_Capture_Image)(const char*);
- XIUYUAN_API int(__cdecl* Func_YI_FPD_Get_Configure_Common)(const char*, YIConfigInfo_Common*);
- XIUYUAN_API int(__cdecl* Func_YI_FPD_Set_Configure_Common)(const char*, const YIConfigInfo_Common*);
- XIUYUAN_API int(__cdecl* Func_YI_FPD_Get_Configure_SyncOut_Mode)(const char*, YIConfigInfo_SyncOut*);
- XIUYUAN_API int(__cdecl* Func_YI_FPD_Set_Configure_SyncOut_Mode)(const char*, const YIConfigInfo_SyncOut*);
- XIUYUAN_API int(__cdecl* Func_YI_FPD_Restore_Factory_Settings)(const char*);
- XIUYUAN_API int(__cdecl* Func_YI_Subtract_Offset)(const char*, bool);
- XIUYUAN_API int(__cdecl* Func_YI_ImageReady_Callback_Register)(const char*, ImageReadyCallbackFunc);
- XIUYUAN_API int(__cdecl* Func_YI_SystemInfo_Callback_Register)(const char*, SystemInfoCallbackFunc);
- XIUYUAN_API int(__cdecl* Func_YI_Get_Callback_Image_Size)(const char*, int&, int&, int&);
- XIUYUAN_API int(__cdecl* Func_YI_GetLastErrorCode)();
- XIUYUAN_API int(__cdecl* Func_YI_Set_Save_Log_Flag)(bool, const char*);
- XIUYUAN_API int(__cdecl* Func_YI_FPD_Get_Invalid_Region)(const char*, int&, int&, int&, int&);
- XIUYUAN_API int(__cdecl* Func_YI_GetLoacalIPs_V4)(char**);
- XIUYUAN_API int(__cdecl* Func_YI_Set_Image_Save_State)(const char*, bool);
- XIUYUAN_API int(__cdecl* Func_YI_Set_Image_Save_Path)(const char*, const char*);
- XIUYUAN_API int(__cdecl* Func_YI_FPD_Get_FPD_TYPE)(const char*, int&);
- XIUYUAN_API int(__cdecl* Func_YI_FPD_Write_Configure_Common_To_File)(const char*, const YIConfigInfo_Common*);
- XIUYUAN_API int(__cdecl* Func_YI_FPD_Read_Configure_Common_From_File)(const char*, YIConfigInfo_Common*);
- XIUYUAN_API int(__cdecl* Func_YI_FPD_Write_Configure_SyncOut_To_File)(const char*, int, const YIConfigInfo_SyncOut*);
- XIUYUAN_API int(__cdecl* Func_YI_FPD_Read_Configure_SyncOut_From_File)(const char*, int, YIConfigInfo_SyncOut*);
- XIUYUAN_API int(__cdecl* Func_YI_FPD_Capture_Image)(const char*, int);
- XIUYUAN_API int(__cdecl* Func_YI_FPD_Capture_Prepare)(const char*);
- XIUYUAN_API int(__cdecl* Func_YI_Load_Gain_Tmp_File)(const char*, const char*);
- XIUYUAN_API int(__cdecl* Func_YI_Load_Defect_Tmp_File)(const char*, const char*);
- XIUYUAN_API int(__cdecl* Func_YI_Load_Offset_Tmp_File)(const char*, const char*);
- XIUYUAN_API int(__cdecl* Func_YI_Load_AED_Offset_Tmp_File)(const char*, const char*);
- XIUYUAN_API int(__cdecl* Func_YI_Set_Correct_Type)(const char*, int);
- XIUYUAN_API int(__cdecl* Func_YI_GainCalibrate)(const char*, unsigned long int, unsigned char*);
- XIUYUAN_API int(__cdecl* Func_YI_OffsetCalibrate)(const char*, unsigned long int, unsigned char*);
- XIUYUAN_API int(__cdecl* Func_YI_DefectCalibrate)(const char*, unsigned long int, unsigned char*);
- XIUYUAN_API int(__cdecl* Func_YI_AEDOffsetCalibrate)(const char*, unsigned long int, unsigned char*);
- XIUYUAN_API int(__cdecl* Func_YI_SetWorkMode)(const char*, unsigned long int, unsigned char*);
- XIUYUAN_API int(__cdecl* Func_YI_GetWorkMode)(const char*, unsigned long int, unsigned char*);
- XIUYUAN_API int(__cdecl* Func_YI_SetDosage)(const char*, unsigned long int, unsigned char*);
- XIUYUAN_API int(__cdecl* Func_YI_SetROIRegion)(const char*, unsigned long int, unsigned char*);
- XIUYUAN_API int(__cdecl* Func_YI_ThermalSensor)(const char*, unsigned long int, unsigned char*);
- XIUYUAN_API int(__cdecl* Func_YI_1256Parameter)(const char*, unsigned long int, unsigned char*);
- XIUYUAN_API int(__cdecl* Func_YI_Restart)(const char*);
- XIUYUAN_API int(__cdecl* Func_YI_Reset)(const char*);
- XIUYUAN_API int(__cdecl* Func_YI_GetStatus)(const char*);
- XIUYUAN_API int(__cdecl* Func_YI_GetVersion)(const char*);
- XIUYUAN_API int(__cdecl* Func_YI_FPD_FreeBuffer)(const char*);
- #endif
- //----------------------------------------SDK Function over--------------------------------------------//
|