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.
66 lines
1.1 KiB
C++
66 lines
1.1 KiB
C++
#include "QDetectorDesignerMgr.h"
|
|
|
|
QDetectorDesignerMgr::QDetectorDesignerMgr()
|
|
{
|
|
m_pDesigner = NULL;
|
|
m_pDE = NULL;
|
|
}
|
|
|
|
QDetectorDesignerMgr::~QDetectorDesignerMgr()
|
|
{
|
|
Quit();
|
|
}
|
|
|
|
bool QDetectorDesignerMgr::Initialize(IDetectorEngine* lpDE)
|
|
{
|
|
if (!lpDE)
|
|
return false;
|
|
m_pDE = lpDE;
|
|
|
|
#ifdef _DEBUG
|
|
m_lib.setFileName("lpdesignerd.dll");
|
|
#else
|
|
m_lib.setFileName("lpdesigner.dll");
|
|
#endif
|
|
if (!m_lib.load()) {
|
|
qDebug() << "lpdesigner lib load failed";
|
|
return false;
|
|
}
|
|
qDebug() << "lib load ok";
|
|
FnLpDesignerNewInstance pfnLpNewInstance = (FnLpDesignerNewInstance)m_lib.resolve("LpDesignerNewInstance");
|
|
if (pfnLpNewInstance)
|
|
pfnLpNewInstance(&m_pDesigner, m_pDE, nullptr);
|
|
|
|
if (!m_pDesigner)
|
|
return false;
|
|
|
|
return true;
|
|
}
|
|
|
|
IDetectorUI* QDetectorDesignerMgr::GetDesignerInterface() const
|
|
{
|
|
return m_pDesigner;
|
|
}
|
|
|
|
void QDetectorDesignerMgr::Quit()
|
|
{
|
|
|
|
if (m_pDesigner)
|
|
{
|
|
delete m_pDesigner;
|
|
m_pDesigner = NULL;
|
|
}
|
|
if (m_lib.isLoaded())
|
|
m_lib.unload();
|
|
}
|
|
|
|
void QDetectorDesignerMgr::OnManualTrigger()
|
|
{
|
|
emit sgCloseWindow();
|
|
}
|
|
|
|
void QDetectorDesignerMgr::OnSetParam(IDetectorTask* pTask)
|
|
{
|
|
//return m_pApp->SetParam(pTask);
|
|
}
|