|
|
|
|
@ -40,11 +40,7 @@ CMainWin::CMainWin(QWidget *parent)
|
|
|
|
|
connect(m_pCameraTrig, SIGNAL(sgTrig()), this, SLOT(onTrigImage()));
|
|
|
|
|
onInitStatus();
|
|
|
|
|
|
|
|
|
|
if (!m_DesignerMgr.Initialize(m_pDetectorEngine)) {
|
|
|
|
|
qWarning() << "Initialize is false";
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
connect(&m_DesignerMgr, SIGNAL(sgCloseWindow()), this, SLOT(onMainFrameClose()));
|
|
|
|
|
connect(m_pDesignerMgr, SIGNAL(sgCloseWindow()), this, SLOT(onMainFrameClose()));
|
|
|
|
|
connect(&m_testWid, SIGNAL(sgTestMode(int)), this, SLOT(onTestMode(int)));
|
|
|
|
|
|
|
|
|
|
m_pColossus = new WfColossus(m_pDetectorEngine);
|
|
|
|
|
@ -126,11 +122,22 @@ CMainWin::CMainWin(QWidget *parent)
|
|
|
|
|
|
|
|
|
|
CMainWin::~CMainWin()
|
|
|
|
|
{
|
|
|
|
|
if (m_pStatus) {
|
|
|
|
|
DELETE_POINTER(m_pStatusTrig);
|
|
|
|
|
DELETE_POINTER(m_pStatus);
|
|
|
|
|
if (m_pDllDetectorEngine)
|
|
|
|
|
{
|
|
|
|
|
delete m_pDllDetectorEngine;
|
|
|
|
|
m_pDllDetectorEngine = nullptr;
|
|
|
|
|
}
|
|
|
|
|
DELETE_POINTER(m_pVersion);
|
|
|
|
|
//load coretrl
|
|
|
|
|
if (m_pDllCoreCtrl)
|
|
|
|
|
{
|
|
|
|
|
delete m_pDllCoreCtrl;
|
|
|
|
|
m_pDllCoreCtrl = nullptr;
|
|
|
|
|
}
|
|
|
|
|
// if (m_pDesignerMgr)
|
|
|
|
|
// {
|
|
|
|
|
// delete m_pDesignerMgr;
|
|
|
|
|
// m_pDesignerMgr = nullptr;
|
|
|
|
|
// }
|
|
|
|
|
DELETE_POINTER(m_pCameraTrig);
|
|
|
|
|
DELETE_POINTER(m_pWfCtrl);
|
|
|
|
|
DELETE_POINTER(m_pColossus);
|
|
|
|
|
@ -195,7 +202,7 @@ void CMainWin::IVariantMapToUI(emTpUiDataType dataType, const QString& camKey, c
|
|
|
|
|
QString str2 = pStation->currentRunningModel();
|
|
|
|
|
int ID = pStation->stationId();
|
|
|
|
|
QString strModelName = QString("%1_%2").arg(ID).arg(str2);
|
|
|
|
|
QString strImgPath;// = genSavePath(strModelName, image);
|
|
|
|
|
QString strImgPath = genSavePath(strModelName, image);
|
|
|
|
|
Struct2SaveData nStructData;
|
|
|
|
|
nStructData.dAngle = dAngle;
|
|
|
|
|
nStructData.errorType = errorType;
|
|
|
|
|
@ -610,14 +617,14 @@ void CMainWin::onInitStatus()
|
|
|
|
|
m_pLbConnect = new class QLabel(QObject::tr("Á¬½Ó״̬:"));
|
|
|
|
|
m_pLbConnect->setMinimumWidth(c_nWidth);
|
|
|
|
|
|
|
|
|
|
m_pLbDiskSpace = new class QLabel(QObject::tr("硬盘剩余空间:xxx.xG"));
|
|
|
|
|
m_pLbDiskSpace->setMinimumWidth(c_nWidth);
|
|
|
|
|
//m_pLbDiskSpace = new class QLabel(QObject::tr("硬盘剩余空间:xxx.xG"));
|
|
|
|
|
//m_pLbDiskSpace->setMinimumWidth(c_nWidth);
|
|
|
|
|
|
|
|
|
|
ui.statusBar->addWidget(m_pLbOnLine);
|
|
|
|
|
ui.statusBar->addWidget(m_pLbConnect);
|
|
|
|
|
ui.statusBar->addWidget(m_pLbUser);
|
|
|
|
|
ui.statusBar->addWidget(m_pLbCurrentTime);
|
|
|
|
|
ui.statusBar->addWidget(m_pLbDiskSpace);
|
|
|
|
|
//ui.statusBar->addWidget(m_pLbDiskSpace);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CMainWin::onUpdateStatus()
|
|
|
|
|
@ -628,28 +635,28 @@ void CMainWin::onUpdateStatus()
|
|
|
|
|
//m_pLbCurrentTime->setStyleSheet("font: 14px;");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// if (m_pLbOnLine && m_pCtrl) {
|
|
|
|
|
// QString strOnlineState = QString(QObject::tr("检测模式:"))
|
|
|
|
|
// + (m_pCtrl->IOnlineMode() == true ? QObject::tr("在线模式") : QObject::tr("离线模式"));
|
|
|
|
|
// m_pLbOnLine->setText(strOnlineState);
|
|
|
|
|
// // m_pLbOnLine->setStyleSheet("font: bold 14px;");
|
|
|
|
|
// }
|
|
|
|
|
if (m_pLbOnLine && m_pWfCtrl) {
|
|
|
|
|
QString strOnlineState = QString(QObject::tr("检测模式:"))
|
|
|
|
|
+ (m_pWfCtrl->IOnlineMode() == true ? QObject::tr("在线模式") : QObject::tr("离线模式"));
|
|
|
|
|
m_pLbOnLine->setText(strOnlineState);
|
|
|
|
|
// m_pLbOnLine->setStyleSheet("font: bold 14px;");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_pLbConnect) {
|
|
|
|
|
if (m_pLbConnect && m_pWfCtrl) {
|
|
|
|
|
QString strOnlineState = QString(QObject::tr("Á¬½Ó״̬£º"))
|
|
|
|
|
+ (true == true ? QObject::tr("连接正常") : QObject::tr("连接异常"));
|
|
|
|
|
+ (m_pWfCtrl->IConnectStatus() == true ? QObject::tr("连接正常") : QObject::tr("连接异常"));
|
|
|
|
|
m_pLbConnect->setText(strOnlineState);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_pLbUser) {
|
|
|
|
|
QString strUser;
|
|
|
|
|
m_pLbUser->setText(QObject::tr("用户: ") + strUser);
|
|
|
|
|
}
|
|
|
|
|
if (m_pLbDiskSpace)
|
|
|
|
|
{
|
|
|
|
|
QString strDiskSpace = QString(QObject::tr("硬盘剩余空间:%1G")).arg(100 / 1024.0);
|
|
|
|
|
m_pLbDiskSpace->setText(strDiskSpace);
|
|
|
|
|
|
|
|
|
|
m_pLbUser->setText(QObject::tr("用户: ") + m_strUserName.isEmpty()==true?QObject::tr("未登录"):m_strUserName);
|
|
|
|
|
}
|
|
|
|
|
// if (m_pLbDiskSpace)
|
|
|
|
|
// {
|
|
|
|
|
// QString strDiskSpace = QString(QObject::tr("硬盘剩余空间:%1G")).arg(100 / 1024.0);
|
|
|
|
|
// m_pLbDiskSpace->setText(strDiskSpace);
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CMainWin::onInitCoreCtrl()
|
|
|
|
|
@ -676,6 +683,13 @@ bool CMainWin::onInitCoreCtrl()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_pDllDetectorEngine->Initialize(m_pCoreCtrl);
|
|
|
|
|
if (NULL == m_pDesignerMgr)
|
|
|
|
|
{
|
|
|
|
|
m_pDesignerMgr = new QDetectorDesignerMgr();
|
|
|
|
|
if (!m_pDesignerMgr->Initialize(m_pDetectorEngine)) {
|
|
|
|
|
qWarning() << "Initialize is false";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -788,7 +802,9 @@ void CMainWin::writeConfig()
|
|
|
|
|
|
|
|
|
|
IDetectorUI* CMainWin::GetDesignerInterface() const
|
|
|
|
|
{
|
|
|
|
|
return m_DesignerMgr.GetDesignerInterface();
|
|
|
|
|
if (m_pDesignerMgr)
|
|
|
|
|
return m_pDesignerMgr->GetDesignerInterface();
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CMainWin::saveSolution()
|
|
|
|
|
@ -867,6 +883,7 @@ Q_SLOT void CMainWin::onLogInOut(QString strName, int level, int state)
|
|
|
|
|
if (m_pWfCtrl) {
|
|
|
|
|
m_pWfCtrl->ISetUserInfo(strName, level);
|
|
|
|
|
onChangeUI(strName, level);
|
|
|
|
|
m_strUserName = strName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (state == 0) {
|
|
|
|
|
|