|
|
|
|
|
#ifndef _H_CMAINWIN_H_
|
|
|
|
|
|
#define _H_CMAINWIN_H_
|
|
|
|
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
|
|
#include "ui_CMainWin.h"
|
|
|
|
|
|
#include "QUserBase.h"
|
|
|
|
|
|
#include "BaseSerialport.h"
|
|
|
|
|
|
#include <QTimer>
|
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
|
#include "CDllCoreCtrl.h"
|
|
|
|
|
|
#include "CDllDetectorEngine.h"
|
|
|
|
|
|
#include "stationdb.h"
|
|
|
|
|
|
#include "IWfCtrl.h"
|
|
|
|
|
|
#include "WfColossus.h"
|
|
|
|
|
|
#include "AutoTrigger.h"
|
|
|
|
|
|
#include "QTestModeWid.h"
|
|
|
|
|
|
#include "iCoreCtrl.h"
|
|
|
|
|
|
#include "QModelMangerUI.h"
|
|
|
|
|
|
#include "QAboutUI.h"
|
|
|
|
|
|
#include "QDeviceMgrUI.h"
|
|
|
|
|
|
#include "QCamSetDlg.h"
|
|
|
|
|
|
#include "QCameraMgrUI.h"
|
|
|
|
|
|
#include "lpdesigner.h"
|
|
|
|
|
|
#include "CDllDesigner.h"
|
|
|
|
|
|
|
|
|
|
|
|
struct StationInfo
|
|
|
|
|
|
{
|
|
|
|
|
|
int m_PLCID{ 0 };
|
|
|
|
|
|
bool m_bRunEnable{ false };
|
|
|
|
|
|
QString strModelName;
|
|
|
|
|
|
};
|
|
|
|
|
|
class CMainWin : public QMainWindow
|
|
|
|
|
|
{
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
CMainWin(QWidget *parent = Q_NULLPTR);
|
|
|
|
|
|
~CMainWin();
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
void INewCameraImage(const QString& camKey, QImage img);
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>㷨<EFBFBD><E3B7A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
void IVariantMapToUI(const QString& camKey, const QVariantMap& vMap);
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>㷨<EFBFBD><E3B7A8><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
QVariant IGetVariantById(int id);
|
|
|
|
|
|
public:
|
|
|
|
|
|
Q_SLOT void onAppanalysis(SComFrame frame);
|
|
|
|
|
|
void onHeartComm(SComFrame &frame);
|
|
|
|
|
|
Q_SLOT void onHeardBit();
|
|
|
|
|
|
Q_SLOT void onShowLog(int nID, QString strMsg);
|
|
|
|
|
|
Q_SLOT void onPopMenu(const QPoint& pt);
|
|
|
|
|
|
Q_SLOT void onActionClicked();
|
|
|
|
|
|
QString genSavePath(QString modelName, QImage &img);
|
|
|
|
|
|
QString genSaveSrcImgPath(QString modelName, QImage &img);
|
|
|
|
|
|
protected:
|
|
|
|
|
|
virtual void timerEvent(QTimerEvent *event);
|
|
|
|
|
|
virtual void closeEvent(QCloseEvent *event);
|
|
|
|
|
|
//virtual void changeEvent(QEvent *event);
|
|
|
|
|
|
protected:
|
|
|
|
|
|
void onInitStatus();
|
|
|
|
|
|
void onUpdateStatus();
|
|
|
|
|
|
|
|
|
|
|
|
bool onInitCoreCtrl();
|
|
|
|
|
|
bool onInitDevice();
|
|
|
|
|
|
signals:
|
|
|
|
|
|
void sgSelModel(int, QString);
|
|
|
|
|
|
void sgSendChangeUI(QString, QString);
|
|
|
|
|
|
void sgShowLog(int, QString);
|
|
|
|
|
|
void sgShowImg(int, QImage);
|
|
|
|
|
|
void sgShowSrcImg(QString strkey, QImage);
|
|
|
|
|
|
private://<2F><>Ӣ<EFBFBD><D3A2><EFBFBD><EFBFBD>
|
|
|
|
|
|
void SearchQmFile(const QString & strDir);
|
|
|
|
|
|
void SetTranslator(const QString strPath);
|
|
|
|
|
|
void SetLanguage(QString strLangage);
|
|
|
|
|
|
void rmTranslator();
|
|
|
|
|
|
void readConfig();
|
|
|
|
|
|
void writeConfig();
|
|
|
|
|
|
private:
|
|
|
|
|
|
void saveSolution();
|
|
|
|
|
|
int lastNum(QString str);
|
|
|
|
|
|
Q_SLOT void onMainFrameClose();
|
|
|
|
|
|
|
|
|
|
|
|
Q_SLOT void onSnapImage(int nCamera = -1);
|
|
|
|
|
|
Q_SLOT void onTrigImage();
|
|
|
|
|
|
Q_SLOT void onSelModel(int, QString);
|
|
|
|
|
|
Q_SLOT void onChangeUI(QString strUsr, int nLevel);
|
|
|
|
|
|
Q_SLOT void onLogInOut(QString strName, int level, int state);
|
|
|
|
|
|
Q_SLOT void onTestMode(int);
|
|
|
|
|
|
Q_SLOT void onShowImage(int ID, QImage img);
|
|
|
|
|
|
Q_SLOT void onShowName(int ID, QString strName);
|
|
|
|
|
|
|
|
|
|
|
|
Q_SLOT void onLanguageChange(QString strLanguage);//<2F><>Ӣ<EFBFBD><D3A2><EFBFBD>л<EFBFBD><D0BB><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
private:
|
|
|
|
|
|
Ui::CMainWin ui;
|
|
|
|
|
|
|
|
|
|
|
|
IUserCtrl *m_pUserCtrl{ nullptr };
|
|
|
|
|
|
ISerialPortTool *m_pSerialPort{ nullptr };
|
|
|
|
|
|
QTimer m_HeartBit;
|
|
|
|
|
|
|
|
|
|
|
|
QVector<QTranslator* > m_VecTranPtr;
|
|
|
|
|
|
QString m_strCurLanguage{ "Chinese" };
|
|
|
|
|
|
|
|
|
|
|
|
StationInfo m_StationInfo_1;
|
|
|
|
|
|
StationInfo m_StationInfo_2;
|
|
|
|
|
|
|
|
|
|
|
|
//status ״̬<D7B4><CCAC>
|
|
|
|
|
|
int m_TimerID_Status{ 0 };
|
|
|
|
|
|
class QLabel *m_pLbCurrentTime;
|
|
|
|
|
|
class QLabel *m_pLbOnLine;
|
|
|
|
|
|
class QLabel *m_pLbConnect;
|
|
|
|
|
|
class QLabel *m_pLbUser;
|
|
|
|
|
|
class QLabel *m_pLbDiskSpace;
|
|
|
|
|
|
private:
|
|
|
|
|
|
CDllCoreCtrl* m_pDllCoreCtrl{nullptr};
|
|
|
|
|
|
CDllDetectorEngine* m_pDllDetectorEngine{nullptr};
|
|
|
|
|
|
CDllDesigner* m_pDllDesigner{ nullptr };
|
|
|
|
|
|
IDetectorUI* m_pDesigner{ nullptr };
|
|
|
|
|
|
|
|
|
|
|
|
ICoreCtrl* m_pCoreCtrl{nullptr};
|
|
|
|
|
|
IDetectorEngine* m_pDetectorEngine{nullptr};
|
|
|
|
|
|
|
|
|
|
|
|
StationDB *m_db{nullptr};
|
|
|
|
|
|
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;
|
|
|
|
|
|
QDeviceMgrUI m_devMgrWid;
|
|
|
|
|
|
QCamSetDlg m_camSetWid;
|
|
|
|
|
|
|
|
|
|
|
|
QString m_strUserName;
|
|
|
|
|
|
QString m_strComName;
|
|
|
|
|
|
|
|
|
|
|
|
QCameraMgrUI m_CamMgrUI;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|