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.
177 lines
4.9 KiB
C++
177 lines
4.9 KiB
C++
#ifndef _H_LPMAINWIN_H_
|
|
#define _H_LPMAINWIN_H_
|
|
|
|
#include <QMainWindow>
|
|
#include "ui_lpMainWin.h"
|
|
#include "iCoreCtrl.h"
|
|
#include "CoreCtrl/CDllCoreCtrl.h"
|
|
#include "QUserBase.h"
|
|
#include "QTranslator"
|
|
#include "QTimer"
|
|
#include "qmythread.h"
|
|
#include "DetectState.h"
|
|
#include "WheelNet.h"
|
|
#include "ModelTableView.h"
|
|
#include "QModelMgrDlg.h"
|
|
#include "Result2Ui.h"
|
|
#include "QDebugDlg.h"
|
|
#include "QTimeMgrDlg.h"
|
|
#include "RoiImgViewer.h"
|
|
#include "InfoFile.h"
|
|
#include "qpixmapbar.h"
|
|
|
|
class lpMainWin : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
lpMainWin(QWidget *parent = Q_NULLPTR);
|
|
~lpMainWin();
|
|
|
|
//接收图像回调函数
|
|
void INewCameraImage(const QString& camKey, QImage img);
|
|
//接收算法检测结果回调函数
|
|
void IVariantMapToUI(const QString& camKey, const QVariantMap& vMap);
|
|
//传输算法参数回调函数
|
|
QVariant IGetVariantById(int id);
|
|
signals:
|
|
void sgTaskSendModels(int nIndex, QString strModel, double dDiameter, double dHeight);
|
|
void sgTskSendDetectState(int nIndex, QString strModel, int IsDetect);
|
|
void sgShowMsg(QString, bool); //show2ui
|
|
void sgCheckEnd();
|
|
void sgTskSendCheck(int, int, QString);
|
|
void sgModelStateChanged(QString);
|
|
void sgModelLibSendInitDone();
|
|
void sgStartDetect();
|
|
|
|
void sgSendClearDislib();
|
|
void sgSendDisLib(int nIndex, QString strModel);
|
|
void sgSendDisLibDone();
|
|
void sgSendReadOnlineLib();
|
|
|
|
void sgShowChannelRes(QString);
|
|
void sgShowImgState(QString);
|
|
void sgGetImg();
|
|
void sgShowMsgdlg(QString);
|
|
|
|
void sgTickTsk();
|
|
void sgFinish();
|
|
|
|
void operate();
|
|
void sgNetData(int, QVariantMap);
|
|
|
|
private:
|
|
Q_SLOT void onLogInOut(QString strName, int level, int state);
|
|
Q_SLOT void onActionClicked();
|
|
Q_SLOT void onButtonClicked();
|
|
protected:
|
|
bool onInitCoreCtrl();
|
|
|
|
void loadUserModel();//加载用户管理模块
|
|
|
|
//国际化
|
|
void SearchQmFile(const QString & strDir);
|
|
void SetTranslator(const QString strPath);
|
|
void SetLanguage(QString strLangage);
|
|
|
|
void SendModelKuTskFun();
|
|
void SendTickTskFun();
|
|
void onSetModel();
|
|
|
|
Q_SLOT void onUpdateDefect();//勾选 更新界面显示窗口
|
|
//net slot
|
|
Q_SLOT void onTcpConnet(QString str, bool bConnect);
|
|
Q_SLOT void onClientConnect(QString addr, bool bConnect);
|
|
Q_SLOT void onThickness(double dValue);
|
|
Q_SLOT void onDetectStateRecv(int nIndex, int value);
|
|
Q_SLOT void onClearLibRev(bool state);
|
|
Q_SLOT void onPulseRev();
|
|
Q_SLOT void onRecvTrigPara();
|
|
Q_SLOT void onReadDetectState(int nIndex, QString strModel);
|
|
Q_SLOT void onReadDetectStateASK();
|
|
Q_SLOT void onTrigRecv(int m_value);
|
|
Q_SLOT void onServerState(QString Addr, int port, bool m_state);
|
|
Q_SLOT void onShutDownComputer();
|
|
//timer slot
|
|
Q_SLOT void onPulseTimer();
|
|
Q_SLOT void onTaskSendModels(int nIndex, QString strModel, double dDiameter, double dHeight);
|
|
Q_SLOT void onTaskSendDetectState(int nIndex, QString strModel, int IsState);
|
|
Q_SLOT void onTaskCheck(int nIndex, int IsState, QString strModel);
|
|
Q_SLOT void onShowImgState(QString str);
|
|
Q_SLOT void onGetImg();
|
|
Q_SLOT void onShowMsg(QString str);
|
|
Q_SLOT void onSendDisLib(int nIndex, QString strModel);
|
|
Q_SLOT void onSendDisLibDone();
|
|
Q_SLOT void onShowChannel(QString str);
|
|
|
|
Q_SLOT void onTriggerCam();
|
|
|
|
void onInitAbout();
|
|
private:
|
|
void onShowResult(Result2Ui* pRlt);//展示识别结果
|
|
|
|
void SendResultBee(emTypeBee m_Type, int num);
|
|
void SendResultStr2PLC(Result2Ui* m_Res);
|
|
void SendResultChannel2PLC(Result2Ui* m_Res);
|
|
void SendResultChannelCOM(Result2Ui* m_Res);
|
|
// template<typename _Widget>
|
|
// _Widget* replaceWidget(QWidget* pSrcWidget);
|
|
|
|
protected:
|
|
virtual void timerEvent(QTimerEvent *event);
|
|
virtual void closeEvent(QCloseEvent *event);
|
|
|
|
private:
|
|
Ui::lpMainWin ui;
|
|
|
|
class QLabel* main_lb_res_Channle{ nullptr };
|
|
class QLabel* main_lb_res_Channle_Show{ nullptr };
|
|
class QLabel* main_label_state{ nullptr };
|
|
class QLabel* main_showWorkLabel{ nullptr };
|
|
|
|
class ModelsView *m_pTableCheck{ nullptr };
|
|
|
|
RoiImgViewer *m_ImgViewer{ nullptr };
|
|
private:
|
|
CDllCoreCtrl* m_pDllCoreCtrl{ nullptr };
|
|
ICoreCtrl* m_pCoreCtrl{ nullptr };
|
|
|
|
private:
|
|
class IWheelCtrl *m_pCtrl{ nullptr };
|
|
class CWheelNet *m_pNet{ nullptr };
|
|
class QWorkMgrUI *m_pworkUI{ nullptr };
|
|
class QWorkMgrCtlr *pWorkCtrl{ nullptr };
|
|
class DetectState *m_pState{ nullptr };
|
|
|
|
QTimer m_PulseTimer, m_ThicknessTimer;
|
|
QTimer m_wfPulseTimer;
|
|
QTimer m_timer;
|
|
QTimer m_ReadLibTimer;
|
|
QTimer m_timerDetect;
|
|
|
|
QMyThread *SendModelLibTask{ nullptr };
|
|
QMyThread *SendTiskTsk{ nullptr };
|
|
QThread *pTickThread{ nullptr };
|
|
|
|
int m_nWfThress{ 0 };
|
|
int m_TimerID{ 0 };//心跳包定时器 用于记录超时
|
|
int m_TimerOutCount{ 0 };
|
|
int m_RestartServerCount{ 0 };
|
|
|
|
QStringList forDefectList;
|
|
int m_nDiffTrigNum{ 0 };//触发次数 用于判断相机是否正常打开
|
|
|
|
//模板管理页面
|
|
QModelMgrDlg *m_pModelMgrDlg{ nullptr };
|
|
QDebugDlg* m_pDebugDlg{ nullptr };
|
|
QWidget m_aboutDlg;//关于
|
|
QTimeMgrDlg* m_pTimerMgrDlg{ nullptr };
|
|
QPixmapListBar* m_pixMapList{ nullptr };//展示历史检测结果
|
|
private:
|
|
IUserCtrl *m_pUserCtrl{ nullptr };//用户管理模块
|
|
|
|
QVector<QTranslator* > m_VecTranPtr;//国际化语言包管理
|
|
};
|
|
|
|
#endif
|