|
|
/******************************************************************************
|
|
|
Copyright(C):2015~2018 hzleaper
|
|
|
FileName:TpICamera.h
|
|
|
Author:zhikun wu
|
|
|
Email:zk.wu@hzleaper.com
|
|
|
Tools:vs2010 pc on company
|
|
|
Created:2015/03/20
|
|
|
History:20:3:2015 17:12
|
|
|
*******************************************************************************/
|
|
|
#ifndef __TP_I_CAMERA_H
|
|
|
#define __TP_I_CAMERA_H
|
|
|
|
|
|
#include "baseInclude.h"
|
|
|
#include "ZkCameraImage.h"
|
|
|
|
|
|
typedef struct tagCAMERA_IN_PARAM {
|
|
|
class ICameraCallback* pCallback;
|
|
|
TP_GLOBAL_DATA* pGlobalData;
|
|
|
}CAMERA_IN_PARAM;
|
|
|
|
|
|
|
|
|
class ICameraPool
|
|
|
{
|
|
|
public:
|
|
|
ICameraPool() {}
|
|
|
virtual ~ICameraPool() {}
|
|
|
public:
|
|
|
// operation for camera.json
|
|
|
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 bool ISetCameraOption(const QString& strSerial, const TP_CAMERA_OPTION& camOpt) = 0;
|
|
|
|
|
|
// try to get available (connected to the computer) by camera type(manufacturer)
|
|
|
virtual QList<QString> IEnumAvailableCameras(emTpDeviceType camType) = 0;
|
|
|
|
|
|
virtual int ICreateCameraes() = 0;
|
|
|
virtual void IDeleteDameraes() = 0;
|
|
|
virtual bool ICreateCamera(const QString&, int nType) = 0;
|
|
|
virtual bool IOpenCamera(const QString& strSerial, bool bReopen = true) = 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 int IOpenDevices(bool bReopenAll = true) = 0;
|
|
|
virtual int IOpenDevicesEx(bool bReopenAll = true) = 0; //如果camera.json里面配置了auto_open 值为false,则调用该函数不会打开对应相机
|
|
|
virtual void ICloseDevices() = 0;
|
|
|
|
|
|
virtual void IStartDevices() = 0;
|
|
|
virtual void IStopDevices(const QString& sDef = NULL) = 0;
|
|
|
virtual void ISetTriggerMode(emTpDeviceTriggerMode mode, emTpTriggerDirection nDirection = TRIGGER_DIRECT_FOREWARD, long nFrameRate = 0) = 0;
|
|
|
virtual emTpDeviceTriggerMode IGetTriggerMode() = 0;
|
|
|
virtual void IManualTrigger( emTpTriggerDirection nDirection = TRIGGER_DIRECT_FOREWARD) = 0;
|
|
|
virtual void ISnapImage(const QStringList& camKeys) = 0;
|
|
|
virtual void ISendSoftTrigger(const QStringList& camKeys) = 0;
|
|
|
virtual CZkCameraImage* IPopCameraImage() = 0;
|
|
|
virtual void IFreeCameraImage(CZkCameraImage *pCamImg) = 0;
|
|
|
//@camera: NULL means setting every camera
|
|
|
virtual void ISetCameraProperty(const QString& camera, emTpCameraProperty property, long nValue) = 0;
|
|
|
virtual void ISetCameraProperty(const QString& camera, TP_CAMERA_PROPERTY& property) = 0;
|
|
|
virtual QList<TP_CAMERA_WIN*> ICameraWins() = 0;
|
|
|
virtual QMap<QString, QString> IGetCamShowNames() = 0;
|
|
|
virtual void ISetCameraEncode(INT64 code, INT64 rate) = 0;
|
|
|
virtual void ISetVirtualImages(const QString& camera, const QStringList& szImages) = 0;
|
|
|
|
|
|
//operate camera window
|
|
|
virtual QList<QString> ICamWinKeys() = 0;
|
|
|
virtual bool ICamWinOptionByKey(const QString& strKey, TP_CAMERA_WIN& camwinOpt) = 0;
|
|
|
virtual bool IAddCamWin(const QString& strKey, const TP_CAMERA_WIN& camwinOpt, bool bNew) = 0;
|
|
|
virtual bool IDelCamWin(const QString& strKey) = 0;
|
|
|
|
|
|
virtual bool ICamsStartPush() = 0;
|
|
|
virtual bool ICamsPausePush() = 0;
|
|
|
};
|
|
|
|
|
|
class ICameraCallback
|
|
|
{
|
|
|
public:
|
|
|
ICameraCallback() {}
|
|
|
virtual ~ICameraCallback() {}
|
|
|
virtual QVariant IGetVariantById(int nId) = 0;
|
|
|
virtual void INewCameraImage(const QVariantMap& vmap) = 0;
|
|
|
};
|
|
|
|
|
|
#endif |