1、恢复状态栏展示功能

2、修复型号添加后标定不能正常保存的问题
valve_lucas
bobpan 5 years ago
parent dea3fdef09
commit 7ad6cf57f5

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -8,7 +8,7 @@ QDetectorDesignerMgr::QDetectorDesignerMgr()
QDetectorDesignerMgr::~QDetectorDesignerMgr()
{
// Quit();
Quit();
}
bool QDetectorDesignerMgr::Initialize(IDetectorEngine* lpDE)
@ -29,7 +29,7 @@ bool QDetectorDesignerMgr::Initialize(IDetectorEngine* lpDE)
qDebug() << "lib load ok";
FnLpDesignerNewInstance pfnLpNewInstance = (FnLpDesignerNewInstance)m_lib.resolve("LpDesignerNewInstance");
if (pfnLpNewInstance)
pfnLpNewInstance(&m_pDesigner, m_pDE, this);
pfnLpNewInstance(&m_pDesigner, m_pDE, nullptr);
if (!m_pDesigner)
return false;
@ -44,13 +44,14 @@ IDetectorUI* QDetectorDesignerMgr::GetDesignerInterface() const
void QDetectorDesignerMgr::Quit()
{
if (m_lib.isLoaded())
m_lib.unload();
if (m_pDesigner)
{
delete m_pDesigner;
m_pDesigner = NULL;
}
}
if (m_lib.isLoaded())
m_lib.unload();
}
void QDetectorDesignerMgr::OnManualTrigger()

@ -5,7 +5,7 @@
#include ".\lpdesigner.h"
#include "qobject.h"
class QDetectorDesignerMgr : public QObject, public IDetectorUISink
class QDetectorDesignerMgr : public QObject
{
Q_OBJECT
public:

@ -92,6 +92,7 @@ ModelView::ModelView(QTableView *pView, IStation *pStation)
m_pView->setSelectionBehavior(QAbstractItemView::SelectRows);
//QObject::connect(pView, SIGNAL(clicked(const QModelIndex &)), this, SLOT(onSelectItem(const QModelIndex&)));
m_pModel = new ModelModel(pStation);
m_pModel->setParent(this);
m_pView->setModel(m_pModel);
}

@ -336,6 +336,8 @@ QString WfColossus::combineWithSymbol(QString s1, QString s2)
class IDetectorSolutionMgr * WfColossus::ptrSolMgr() const
{
if (!m_pDetEngine)
return nullptr;
void * p;
m_pDetEngine->GetDataInterface(SOLUTIONMGR, &p);
return (IDetectorSolutionMgr*)p;

@ -14,7 +14,7 @@ CWfCtrl::CWfCtrl(ICoreCtrl* p1, WfColossus* p3)
{
m_nOnlineMode = false;
//m_pConnectChecker = new WorkChecker;
m_pConnectChecker = new WorkChecker;
m_pCoreCtrl = p1;
m_pColossus = p3;
m_setting = new QSettings(QCoreApplication::applicationDirPath()+"\\user\\systemfile.ini", QSettings::IniFormat);
@ -67,8 +67,16 @@ CWfCtrl::~CWfCtrl()
}
m_pDCThreadList.clear();
//m_pColossus->setOnlineModel(m_nOnlineMode);
delete m_pConnectChecker;
delete m_pWfDb;
if (m_pConnectChecker)
{
delete m_pConnectChecker;
m_pConnectChecker = nullptr;
}
if (m_pWfDb) {
delete m_pWfDb;
m_pWfDb = nullptr;
}
qDeleteAll(m_pStationMap);
m_pStationMap.clear();
qDeleteAll(m_mpModels);
@ -138,6 +146,8 @@ bool CWfCtrl::initModel()
bool CWfCtrl::initStation()
{
if (!m_pCoreCtrl)
return false;
QStringList camKeys = m_pCoreCtrl->ICameraKeys();
for (QStringList::iterator it = camKeys.begin(); it != camKeys.end(); ++it) {
TP_CAMERA_OPTION camOpt;

@ -31,5 +31,11 @@ int main(int argc, char *argv[])
else {
QMessageBox::information(0, "", QObject::tr("lpMain¼ÓÔØÊ§°Ü"));
}
if (pMain) {
delete pMain;
pMain = nullptr;
}
if (lib.isLoaded())
lib.unload();
return 0;
}

@ -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;
}
//load coretrl
if (m_pDllCoreCtrl)
{
delete m_pDllCoreCtrl;
m_pDllCoreCtrl = nullptr;
}
DELETE_POINTER(m_pVersion);
// 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) {

@ -80,7 +80,6 @@ private://
private:
IDetectorUI* GetDesignerInterface() const;
QDetectorDesignerMgr m_DesignerMgr;
void saveSolution();
int lastNum(QString str);
Q_SLOT void onMainFrameClose();
@ -116,22 +115,22 @@ private:
private:
CDllCoreCtrl* m_pDllCoreCtrl{nullptr};
CDllDetectorEngine* m_pDllDetectorEngine{nullptr};
QDetectorDesignerMgr* m_pDesignerMgr{nullptr};
ICoreCtrl* m_pCoreCtrl{nullptr};
IDetectorEngine* m_pDetectorEngine{nullptr};
StationDB *m_db{nullptr};
class AutoTrigger *m_pCameraTrig;
class AutoTrigger *m_pStatusTrig;
class ModelLists *m_pModelList;
class IWfCtrl *m_pWfCtrl;
class WfColossus *m_pColossus;
class WfStatus *m_pStatus;
class CVersion *m_pVersion;
class AutoTrigger *m_pCameraTrig{nullptr};
class AutoTrigger *m_pStatusTrig{ nullptr };
class IWfCtrl *m_pWfCtrl{ nullptr };
class WfColossus *m_pColossus{ nullptr };
QTestModeWid m_testWid;
QModelMangerUI m_mangeWid;
QAboutUI m_aboutWid;
QString m_strUserName;
};
#endif

Loading…
Cancel
Save