|
|
|
|
|
/******************************************************************************
|
|
|
|
|
|
Copyright(C):2015~2018 hzleaper
|
|
|
|
|
|
FileName:globalCoreCtrl.h
|
|
|
|
|
|
Author:zhikun wu
|
|
|
|
|
|
Email:zk.wu@hzleaper.com
|
|
|
|
|
|
Tools:vs2010 pc on company
|
|
|
|
|
|
Created:2015/03/24
|
|
|
|
|
|
History:24:3:2015 17:30
|
|
|
|
|
|
*******************************************************************************/
|
|
|
|
|
|
#ifndef __GLOBAL_CORE_CTRL_H
|
|
|
|
|
|
#define __GLOBAL_CORE_CTRL_H
|
|
|
|
|
|
|
|
|
|
|
|
#include "baseInclude.h"
|
|
|
|
|
|
#include "icamera.h"
|
|
|
|
|
|
#include "iCoreCtrl.h"
|
|
|
|
|
|
#include "iImgProc.h"
|
|
|
|
|
|
#include "GlobalDataBase.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef _USE_SPIDER_LOG
|
|
|
|
|
|
#include "logSpider.h"
|
|
|
|
|
|
#define CORE_CTRL_INIT(a, b) SPIDER_LOG_INIT(a, b)
|
|
|
|
|
|
#define CORE_CTRL_LOG(value) SPIDER_LOG_STRING("corectrl", value)
|
|
|
|
|
|
#define CORE_CTRL_FREE() SPIDER_LOG_FREE()
|
|
|
|
|
|
#else
|
|
|
|
|
|
#define CORE_CTRL_INIT(a, b)
|
|
|
|
|
|
#define CORE_CTRL_LOG(value) tpDebugOut(value)
|
|
|
|
|
|
#define CORE_CTRL_FREE()
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
class CGlobalCoreCtrl : public ICameraCallback
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
CGlobalCoreCtrl(const CORE_CTRL_IN_PARAM* pParam){
|
|
|
|
|
|
m_pCameraPool = NULL;
|
|
|
|
|
|
m_pImageProc = NULL;
|
|
|
|
|
|
m_pGuiCallback = pParam->pGuiCb;
|
|
|
|
|
|
m_pGlobalData = pParam->pGlobalData;
|
|
|
|
|
|
// m_pCoreSetting = pParam->pCoreSetting;
|
|
|
|
|
|
readCoreCtrlCfg();
|
|
|
|
|
|
}
|
|
|
|
|
|
~CGlobalCoreCtrl() {}
|
|
|
|
|
|
void AddCameraPool(ICameraPool* pCameraPool) { m_pCameraPool = pCameraPool; }
|
|
|
|
|
|
private:
|
|
|
|
|
|
void readCoreCtrlCfg();
|
|
|
|
|
|
virtual QVariant IGetVariantById(int nId);
|
|
|
|
|
|
virtual void INewCameraImage(const QVariantMap& vmap);
|
|
|
|
|
|
public:
|
|
|
|
|
|
TP_GLOBAL_DATA* m_pGlobalData;
|
|
|
|
|
|
TP_CORE_SETTING m_coreSetting;
|
|
|
|
|
|
ICameraPool* m_pCameraPool;
|
|
|
|
|
|
IGuiCallback* m_pGuiCallback;
|
|
|
|
|
|
IImgProc* m_pImageProc;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
extern CGlobalCoreCtrl* gpData;
|
|
|
|
|
|
|
|
|
|
|
|
#define gpCoreCtrlGlobal gpData
|
|
|
|
|
|
|
|
|
|
|
|
#define gpGlobalData ((TP_GLOBAL_DATA*)(gpData->m_pGlobalData))
|
|
|
|
|
|
#define gCoreSetting gpData->m_coreSetting
|
|
|
|
|
|
#define glpCameralPool gpData->m_pCameraPool
|
|
|
|
|
|
//#define glpMainPath NULL != gpData ? gpData->tgdMainPath : ".\\"
|
|
|
|
|
|
// #define gcallCameraPool(fc) if( NULL != glpCameralPool ) glpCameralPool->##fc##()
|
|
|
|
|
|
// #define gcallCameraPoolParam(fc, ...) if( NULL != glpCameralPool) glpCameralPool->##fc##(__VA_VRGS__)
|
|
|
|
|
|
#define glpGuiCallback gpData->m_pGuiCallback
|
|
|
|
|
|
#define gfcbGuiSetImage(...) if( NULL != glpGuiCallback ) glpGuiCallback->ISetCameraImage(__VA_ARGS__)
|
|
|
|
|
|
#define gGuiCallback_FuncCall(fun, ...) if( NULL != glpGuiCallback ) glpGuiCallback->##fun##(__VA_ARGS__)
|
|
|
|
|
|
|
|
|
|
|
|
#define glpImgProc gpData->m_pImageProc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|