#ifndef __I_CORE_CTRL_H #define __I_CORE_CTRL_H #include "baseStruct.h" #include #include class IAlgorithmResult { public: IAlgorithmResult(){} virtual ~IAlgorithmResult(){} virtual QVariantMap ToVariantMap() = 0; }; typedef std::function FuncCallBack_VarInt; typedef std::function FuncCallBack_VarMap; typedef std::function FuncCallBack_StrMap; typedef std::function FuncCallBack_StrImg; //interface for gui class ICoreCtrl { public: ICoreCtrl() {} virtual ~ICoreCtrl() {} virtual QList ICameraKeys() = 0; virtual QList ICameraKeysOrderByIds() = 0; virtual bool ICameraOption(const QString& strSerial, TP_CAMERA_OPTION& camOpt) = 0; virtual bool ICameraOptionByKey(const QString& strSerial, TP_CAMERA_OPTION& camOpt) = 0; virtual QList IEnumAvailableCameras(emTpDeviceType camType) = 0; virtual void ISetTriggerMode(emTpDeviceTriggerMode triggerMode, long nFrameRate) = 0; virtual emTpDeviceTriggerMode IGetTriggerMode() = 0; virtual void IManualTrigger(emTpTriggerDirection direct) = 0; virtual void ISnapImage(const QStringList& camKeys) = 0; virtual void ISendSoftTrigger(const QStringList& camKeys) = 0; virtual QMap IGetCamShowNames() = 0; virtual bool ISetCameraOption(const QString& strSerial, const TP_CAMERA_OPTION& camOpt) = 0; virtual bool IReopenCameraes() = 0; virtual void ISetCameraProperty(const QString& camera, TP_CAMERA_PROPERTY& property) = 0; //operate camera virtual bool ICreateCamera(const QString& strSerial, int nType) = 0; virtual bool IOpenCamera(const QString& strSerial) = 0; virtual bool ICloseCamera(const QString& strSerial) = 0; virtual bool IStartCamera(const QString& strSerial) = 0; virtual bool IStopCamera(const QString& strSerial) = 0; virtual bool IDeleteCamera(const QString& strSerial) = 0; virtual bool IAddCamera(const QString& strName, const TP_CAMERA_OPTION& camOpt, bool bNew, bool bAutoRun = false) = 0; virtual bool IRunAlg(const QString& strSerial, bool bRun) = 0; //更新json配置文件 virtual bool updateCamJson(const QString& sJsonPath) = 0; virtual bool ICamsStartPush() = 0; virtual bool ICamsPausePush() = 0; virtual bool IRegisterGetVariant(FuncCallBack_VarInt callback) = 0; //向算法传递检测参数回调接口 virtual bool IRegisterImageCallBack(FuncCallBack_StrImg callback) = 0; //获取相机图像回调接口 virtual bool IRegisterResultCallBack(FuncCallBack_StrMap callback) = 0; //获取算法结果回调接口 public://private: //use private when the old main is discarded; virtual int IInitCore(class IDetectorEngine* pDE = NULL) = 0; virtual void IFreeCore() = 0; virtual void IStartImageProcess() = 0; virtual void IEndImageProcess() = 0; }; #ifdef TPCORECTRL_EXPORTS #define TPCORECTRL_API extern "C" __declspec(dllexport) #else #define TPCORECTRL_API extern "C" #endif extern "C" TPCORECTRL_API ICoreCtrl* Lib_CoreCtrl_Init(void); extern "C" TPCORECTRL_API void Lib_CoreCtrl_Free(ICoreCtrl* ptr); #endif