#pragma once #include "YuYingDefinition.h" #ifdef YUYINGAPI_EXPORTS #define EXPORT_API_DLL _declspec(dllexport) #else #define EXPORT_API_DLL _declspec(dllimport) #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /*------------ 1、工作流相关函数--------------*/ /** * \brief 初始化函数,必须第一个调用 * \return 返回值为程序的句柄,代表一个设备,每次调用此函数都会返回一个新的句柄, * 用户保存此句柄,在不用时用户通过调用YI_FPD_Close主动释放 */ EXPORT_API_DLL int _stdcall YI_Initialize_FPD_V4( const char* ipAddressRemote, int iPortRemote, char outDeviceID[100]); /** * \brief 释放某一个设备 * \param handle */ EXPORT_API_DLL void _stdcall YI_FPD_Close(const char* sDeviceID); /** * \brief 设置平板探测器工作模式 */ EXPORT_API_DLL int _stdcall YI_FPD_Set_Work_Mode(const char* sDeviceID, FpdMode* pFpdMode); /** * \brief 停止采集 * \静态平板探测器:software模式下,且在采集数量大于1时可用。 * \动态平板探测器:freerun模式下可用。 */ EXPORT_API_DLL int _stdcall YI_FPD_Stop_Capture_Image(const char* sDeviceID); /*------------ 2、读写平板探测器配置相关的函数--------------*/ EXPORT_API_DLL int _stdcall YI_FPD_Get_Configure_Common(const char* sDeviceID, YIConfigInfo_Common* configInfo); EXPORT_API_DLL int _stdcall YI_FPD_Set_Configure_Common(const char* sDeviceID, const YIConfigInfo_Common* configInfo); EXPORT_API_DLL int _stdcall YI_FPD_Get_Configure_SyncOut_Mode(const char* sDeviceID, YIConfigInfo_SyncOut* configInfo); EXPORT_API_DLL int _stdcall YI_FPD_Set_Configure_SyncOut_Mode(const char* sDeviceID, const YIConfigInfo_SyncOut* configInfo); /** * \brief 重置平板探测器参数,恢复默认值 */ EXPORT_API_DLL int _stdcall YI_FPD_Restore_Factory_Settings(const char* sDeviceID); /*------------ 3、图像校正相关函数--------------*/ /** * \brief 设置平板探测器对图像做offset */ EXPORT_API_DLL int _stdcall YI_Subtract_Offset(const char* sDeviceID, bool bValue); /*------------ 4、回调函数注册函数--------------*/ /** * \brief * \param sDeviceID:设备标识 * callBackFunc: 回调函数 * \return */ EXPORT_API_DLL int _stdcall YI_ImageReady_Callback_Register(const char* sDeviceID, ImageReadyCallbackFunc callBackFunc); /** * \brief * \param sDeviceID:设备标识 * callBackFunc: 回调函数 * \return */ EXPORT_API_DLL int _stdcall YI_SystemInfo_Callback_Register(const char* sDeviceID, SystemInfoCallbackFunc callBackFunc); /*------------ 5、帮助函数--------------*/ /** * \brief 获取当前返回图像数据的大小,客户可以根据此数值设置图像缓存大小 * \param [out] 图像数据的大小,单位(字节) */ EXPORT_API_DLL int _stdcall YI_Get_Callback_Image_Size(const char* sDeviceID, int& iWidth, int& iHeight, int& iBytesOfPerPixel); /** * \brief 当其他函数返回值为0时,调用此函数获取错误信息 */ EXPORT_API_DLL SystemErrorCode _stdcall YI_GetLastErrorCode(); /** * \brief 设置是否写log文件 * \param [in] 保存log文件的文件夹路径 */ EXPORT_API_DLL int _stdcall YI_Set_Save_Log_Flag(bool bSave, const char* sFloderPath); /** * \brief 获取玻璃无效的边缘区域 */ EXPORT_API_DLL int _stdcall YI_FPD_Get_Invalid_Region(const char* sDeviceID, int& iLeft, int& iTop, int& iRight, int& iBottom); /** * \brief 获取本机所有的v4 ip地址 * \param iPs 使用时定义char *p=nullptr,以&p作为输入参数。 * 不需要用户释放。 * \ p中包含的IPV4地址用分号(;)分隔 * \return ResultType::Succeed 获取地址成功 * ResultType::Failed 获取地址失败 */ EXPORT_API_DLL int _stdcall YI_GetLoacalIPs_V4(char** iPs); /** * \brief 设置是否需要保存获取到的图像 * \param bValue true 保存, false 不保存 */ EXPORT_API_DLL int _stdcall YI_Set_Image_Save_State(const char* sDeviceID, bool bValue); /** * \brief 设置保存图像的路径,如果需要保存图像但是没有设置路径,那么会默认保存到当前目录下 */ EXPORT_API_DLL int _stdcall YI_Set_Image_Save_Path(const char* sDeviceID, const char* savePath); /** * \brief 获取当前平板探测器类型 * \param iType -1 未知, 0 静态, 1 千兆动态 */ EXPORT_API_DLL int _stdcall YI_FPD_Get_FPD_TYPE(const char* sDeviceID, int& iType); /** * \brief 将配置信息保存到ini文件,以及从ini文件读取配置信息 * \param sSavePath用户需要确认路径及文件存在 */ EXPORT_API_DLL int _stdcall YI_FPD_Write_Configure_Common_To_File(const char* sSavePath, const YIConfigInfo_Common* configInfo); EXPORT_API_DLL int _stdcall YI_FPD_Read_Configure_Common_From_File(const char* sSavePath, YIConfigInfo_Common* configInfo); EXPORT_API_DLL int _stdcall YI_FPD_Write_Configure_SyncOut_To_File(const char* sSavePath, int iSpeedMode, const YIConfigInfo_SyncOut* configInfo); EXPORT_API_DLL int _stdcall YI_FPD_Read_Configure_SyncOut_From_File(const char* sSavePath, int iSpeedMode, YIConfigInfo_SyncOut* configInfo); /******************************************************************************************************************** **********************************************静 态 探 测 器 特 有 接 口******************************************************* **********************************************************************************************************************/ /*------------ 1、工作流相关函数--------------*/ EXPORT_API_DLL int _stdcall YI_FPD_Capture_Image(const char* sDeviceID, int iNumber = 1); /*------------ 2、图像校正相关的函数--------------*/ EXPORT_API_DLL int _stdcall YI_Load_Gain_Tmp_File(const char* sDeviceID, const char* sPath); EXPORT_API_DLL int _stdcall YI_Load_Defect_Tmp_File(const char* sDeviceID, const char* sPath); EXPORT_API_DLL int _stdcall YI_Load_Offset_Tmp_File(const char* sDeviceID, const char* sPath); EXPORT_API_DLL int _stdcall YI_Load_AED_Offset_Tmp_File(const char* sDeviceID, const char* sPath); EXPORT_API_DLL int _stdcall YI_Set_Correct_Type(const char* sDeviceID, int iType); /******************************************************************************************************************** **********************************************动 态 探 测 器 特 有 接 口******************************************************* **********************************************************************************************************************/ /*------------ 1、工作流相关函数--------------*/ /** * \brief freerun模式下,启动和停止连续采集 */ EXPORT_API_DLL int _stdcall YI_FPD_Continual_Capture_Image(const char* sDeviceID); EXPORT_API_DLL int _stdcall YI_FPD_Stop_Capture_Image(const char* sDeviceID); /** * \brief sync in模式下使用 */ EXPORT_API_DLL int _stdcall YI_FPD_Sync_In_Start(const char* sDeviceID); EXPORT_API_DLL int _stdcall YI_FPD_Sync_In_Stop(const char* sDeviceID); /** * \brief 从PC上传校正模板到平板探测器 * \param [in] iMemoryType 当前只支持输入0 * \param [in] pFolderPath 校正模板所在文件夹路径,会将文件夹内的校正模板逐个上传 * \param [in] callBackFunc 回调函数,用于显示上传进度 */ EXPORT_API_DLL int _stdcall YI_Upload_Correct_Files(const char* sDeviceID, int iMemoryType, const char* pFolderPath, ProgressCallbackFunc callBackFunc); //////////////NEW APIs//////////////////// EXPORT_API_DLL int _stdcall YI_GainCalibrate(const char* sDeviceID, unsigned long int len, unsigned char* data); EXPORT_API_DLL int _stdcall YI_OffsetCalibrate(const char* sDeviceID, unsigned long int len, unsigned char* data); EXPORT_API_DLL int _stdcall YI_DefectCalibrate(const char* sDeviceID, unsigned long int len, unsigned char* data); EXPORT_API_DLL int _stdcall YI_AEDOffsetCalibrate(const char* sDeviceID, unsigned long int len, unsigned char* data); EXPORT_API_DLL int _stdcall YI_SetWorkMode(const char* sDeviceID, unsigned long int len, unsigned char* data); EXPORT_API_DLL int _stdcall YI_GetWorkMode(const char* sDeviceID, unsigned long int len, unsigned char* data); EXPORT_API_DLL int _stdcall YI_SetDosage(const char* sDeviceID, unsigned long int len, unsigned char* data); EXPORT_API_DLL int _stdcall YI_SetROIRegion(const char* sDeviceID, unsigned long int len, unsigned char* data); EXPORT_API_DLL int _stdcall YI_ThermalSensor(const char* sDeviceID, unsigned long int len, unsigned char* data); EXPORT_API_DLL int _stdcall YI_1256Parameter(const char* sDeviceID, unsigned long int len, unsigned char* data); EXPORT_API_DLL int _stdcall YI_Restart(const char* sDeviceID); EXPORT_API_DLL int _stdcall YI_Reset(const char* sDeviceID); EXPORT_API_DLL int _stdcall YI_GetStatus(const char* sDeviceID); EXPORT_API_DLL int _stdcall YI_FPD_FreeBuffer(const char* sDeviceID); EXPORT_API_DLL int _stdcall YI_GetVersion(const char* sDeviceID); EXPORT_API_DLL int _stdcall YI_RegRead(const char* sDeviceID, unsigned int addr,unsigned int *data); EXPORT_API_DLL int _stdcall YI_RegWrite(const char* sDeviceID, unsigned int addr, unsigned int data); #ifdef __cplusplus } #endif /* __cplusplus */