|
|
|
|
|
#ifndef __I_CORE_CTRL_H
|
|
|
|
|
|
#define __I_CORE_CTRL_H
|
|
|
|
|
|
|
|
|
|
|
|
#include "baseStruct.h"
|
|
|
|
|
|
#include <QtCore/QString>
|
|
|
|
|
|
#include <QtGui/QImage>
|
|
|
|
|
|
|
|
|
|
|
|
//the parameter for the CoreCtrl module
|
|
|
|
|
|
typedef struct tagCORE_CTRL_IN_PARAM
|
|
|
|
|
|
{
|
|
|
|
|
|
class IGuiCallback* pGuiCb;
|
|
|
|
|
|
TP_GLOBAL_DATA* pGlobalData;
|
|
|
|
|
|
TP_CORE_SETTING* pCoreSetting;
|
|
|
|
|
|
}CORE_CTRL_IN_PARAM;
|
|
|
|
|
|
|
|
|
|
|
|
/**/
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
//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 IManualTrigger(emTpTriggerDirection direct) = 0;
|
|
|
|
|
|
virtual void ISnapImage(const QStringList& camKeys) = 0;
|
|
|
|
|
|
virtual void ISendSoftTrigger(const QStringList& 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;
|
|
|
|
|
|
|
|
|
|
|
|
//更新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_VarMap 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;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//callback interface from gui
|
|
|
|
|
|
class IGuiCallback
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
IGuiCallback() {}
|
|
|
|
|
|
virtual ~IGuiCallback() {}
|
|
|
|
|
|
virtual void INewCameraImage(const QVariantMap& vMap) = 0;
|
|
|
|
|
|
virtual void IVariantMapToUI(const QString& camKey, const QVariantMap& vMap) = 0;
|
|
|
|
|
|
virtual QVariant IGetVariantById(int id) = 0;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|