You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
3.9 KiB
C++
90 lines
3.9 KiB
C++
#ifndef __I_CORE_CTRL_H
|
|
#define __I_CORE_CTRL_H
|
|
|
|
#include "baseStruct.h"
|
|
#include <QtCore/QString>
|
|
#include <QtGui/QImage>
|
|
|
|
class IAlgorithmResult
|
|
{
|
|
public:
|
|
IAlgorithmResult(){}
|
|
virtual ~IAlgorithmResult(){}
|
|
virtual QVariantMap ToVariantMap() = 0;
|
|
};
|
|
|
|
typedef std::function<QVariant(int)> FuncCallBack_VarInt;
|
|
typedef std::function<void(const QVariantMap&)> FuncCallBack_VarMap;
|
|
typedef std::function<void(const QString&, const QVariantMap&)> FuncCallBack_StrMap;
|
|
typedef std::function<void(const QString&, QImage)> FuncCallBack_StrImg;
|
|
|
|
//interface for gui
|
|
class ICoreCtrl
|
|
{
|
|
public:
|
|
ICoreCtrl() {}
|
|
virtual ~ICoreCtrl() {}
|
|
virtual QList<QString> ICameraKeys() = 0;
|
|
virtual QList<QString> 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<QString> IEnumAvailableCameras(emTpDeviceType camType) = 0;
|
|
virtual void ISetTriggerMode(emTpDeviceTriggerMode triggerMode, long nFrameRate) = 0;
|
|
virtual emTpDeviceTriggerMode IGetTriggerMode() = 0;
|
|
virtual void ISnapImage(const QStringList& camKeys) = 0;
|
|
//virtual void ISnapImage(const QString camKeys) = 0;
|
|
virtual QMap<QString, QString> 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;
|
|
virtual bool IGetWidth(const QString& strSerial, int& width) = 0;
|
|
virtual bool ISetWidth(const QString& strSerial, int& width) = 0;
|
|
virtual bool IGetHeight(const QString& strSerial, int& height) = 0;
|
|
virtual bool ISetHeight(const QString& strSerial, int& height) = 0;
|
|
virtual bool IGetGain(const QString& strSerial, int& height) = 0;
|
|
virtual bool ISetGain(const QString& strSerial, int& height) = 0;
|
|
virtual bool IGetExposureTime(const QString& strSerial, int& height)=0;
|
|
virtual bool ISetExposureTime(const QString& strSerial, int& height)=0;
|
|
// virtual bool IGetPixelFormat(const QString& strSerial) {};
|
|
// virtual bool ISetPixelFormat(const QString& strSerial) {};
|
|
// virtual bool IGetAcquisitionMode(const QString& strSerial) {};
|
|
// virtual bool ISetAcquisitionMode(const QString& strSerial) {};
|
|
// virtual bool IGetTriggerMode(const QString& strSerial) {};
|
|
// virtual bool ISetTriggerMode(const QString& strSerial) {};
|
|
|
|
//更新json配置文件
|
|
virtual void loadConfig() = 0;
|
|
virtual void saveConfig() = 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 |