|
|
#ifndef _VALUEMAINUI_H_
|
|
|
#define _VALUEMAINUI_H_
|
|
|
|
|
|
#include <QtWidgets/QMainWindow>
|
|
|
#include "ui_valueMainUI.h"
|
|
|
#include <QThread>
|
|
|
#include "RoiImgViewer.h"
|
|
|
#include "lpConfigUI.h"
|
|
|
#include "lpDebugUI.h"
|
|
|
#include <QSystemTrayIcon>
|
|
|
#include <QMenu>
|
|
|
#include <QAction>
|
|
|
#include "libTcpClient.h"
|
|
|
#include "../QPLCDevice.h"
|
|
|
#include "QTCPDebugUI.h"
|
|
|
|
|
|
#include <QTranslator>
|
|
|
#include <QTimer>
|
|
|
|
|
|
class valueMainUI : public QMainWindow
|
|
|
{
|
|
|
Q_OBJECT
|
|
|
|
|
|
public:
|
|
|
valueMainUI(QWidget *parent = Q_NULLPTR);
|
|
|
~valueMainUI();
|
|
|
QString SecondTimeString(quint64 value);
|
|
|
|
|
|
Q_SLOT void onRecvDataStr_A(const QJsonObject& json);
|
|
|
Q_SLOT void onRecvDataStr_B(const QJsonObject& json);
|
|
|
|
|
|
void onConnectA();
|
|
|
void onConnectB();
|
|
|
|
|
|
Q_SLOT void onButtonClicked();
|
|
|
QJsonObject byte2Json(QByteArray data);
|
|
|
QByteArray Json2byte(QJsonObject obj);
|
|
|
Q_SLOT void onDebugClicked(int nID);
|
|
|
Q_SLOT void onConnected_A(bool bFalg);
|
|
|
Q_SLOT void onConnected_B(bool bFalg);
|
|
|
void check();
|
|
|
void onRunApp(QString strPath);
|
|
|
Q_SLOT void onStartProcess();
|
|
|
Q_SLOT void onStopProcess();
|
|
|
|
|
|
private://trayIcon
|
|
|
void setupTrayIcon();
|
|
|
Q_SLOT void onActivated(QSystemTrayIcon::ActivationReason reason);
|
|
|
void setMainWindowVisibility(bool state);
|
|
|
Q_SLOT void onQuitApplication();
|
|
|
Q_SLOT void onImageScale(qreal real);
|
|
|
Q_SLOT void onShowUI(bool bDouble);
|
|
|
Q_SLOT void onUpdateConfig();
|
|
|
//A
|
|
|
Q_SLOT void on_message_receive_A(QSharedPointer<TP_PROTOCOL_MESSAGE> msg_ptr);
|
|
|
Q_SLOT void on_data_send_completed_A(QSharedPointer<TP_PROTOCOL_MESSAGE>);
|
|
|
Q_SLOT void on_data_recv_completed_A(QSharedPointer<TP_PROTOCOL_MESSAGE> msg_ptr, QSharedPointer<QByteArray> pData);
|
|
|
Q_SLOT void on_connected_A();
|
|
|
Q_SLOT void on_disconnected_A();
|
|
|
//B
|
|
|
Q_SLOT void on_message_receive_B(QSharedPointer<TP_PROTOCOL_MESSAGE> msg_ptr);
|
|
|
Q_SLOT void on_data_send_completed_B(QSharedPointer<TP_PROTOCOL_MESSAGE>);
|
|
|
Q_SLOT void on_data_recv_completed_B(QSharedPointer<TP_PROTOCOL_MESSAGE> msg_ptr, QSharedPointer<QByteArray> pData);
|
|
|
Q_SLOT void on_connected_B();
|
|
|
Q_SLOT void on_disconnected_B();
|
|
|
void onShowMainWindow();
|
|
|
Q_SLOT void onPLCTrigerCam(int camID);
|
|
|
|
|
|
Q_SLOT void onShowRecvTcpData(QByteArray data);
|
|
|
Q_SLOT void onShowSendTcpData(QByteArray data);
|
|
|
//language
|
|
|
void SetLanguage(QString strLangage);
|
|
|
void SearchQmFile(const QString & strDir);
|
|
|
void SetTranslator(const QString strPath);
|
|
|
Q_SLOT void onLanguageChange(QString strLanguage);
|
|
|
Q_SLOT void onSendAlgResult(int camID);
|
|
|
Q_SLOT void onReacvHeartBit();
|
|
|
protected:
|
|
|
virtual void timerEvent(QTimerEvent *event);
|
|
|
virtual void closeEvent(QCloseEvent *event);
|
|
|
virtual void changeEvent(QEvent *event);
|
|
|
private:
|
|
|
Ui::valueMainUIClass ui;
|
|
|
|
|
|
RoiImgViewer *m_ImgViewer_A{ nullptr };//չʾ<D5B9><CABE><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
|
|
RoiImgViewer *m_ImgViewer_B{ nullptr };//չʾ<D5B9><CABE><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
|
|
|
|
|
QLabel* m_pLabelA{ nullptr };
|
|
|
QLabel* m_pLabelB{ nullptr };
|
|
|
QLabel* m_pLabelPLC{ nullptr };
|
|
|
QLabel* m_pLabelSystem{ nullptr };
|
|
|
private:
|
|
|
int m_timerA{ 0 };
|
|
|
int m_timerB{ 0 };
|
|
|
int m_timerStartID{ 0 };
|
|
|
|
|
|
lpConfigUI *m_pConfigUI{ nullptr };
|
|
|
lpDebugUI *m_pDebugUI{ nullptr };
|
|
|
QTCPDebugUI *m_pTcpDebugUI{ nullptr };
|
|
|
|
|
|
int m_CoutA{ 0 };
|
|
|
int m_CoutB{ 0 };
|
|
|
bool m_bServerA{ false };
|
|
|
bool m_bServerB{ false };
|
|
|
bool m_bRunStateA{ false };
|
|
|
bool m_bRunStateB{ false };
|
|
|
int m_SysTimerID{ 0 };
|
|
|
quint64 m_tickCount{ 0 };
|
|
|
int m_heartTimeout{ 0 };
|
|
|
QStringList m_appNames;//<2F>ӻ<EFBFBD>app<70><70>
|
|
|
|
|
|
lpTcpClient* tcp_client_ptr_A{ nullptr };
|
|
|
lpTcpClient* tcp_client_ptr_B{ nullptr };
|
|
|
private:
|
|
|
QSystemTrayIcon* m_trayIcon{ nullptr };
|
|
|
QMenu* m_trayIconMenu{ nullptr };
|
|
|
QAction* m_restoreAction{ nullptr };
|
|
|
QAction* m_quitAction{ nullptr };
|
|
|
bool m_bExit{ false };
|
|
|
|
|
|
QPLCDevice* m_pPlcDevice{ nullptr };
|
|
|
|
|
|
QVector<QTranslator* > m_VecTranPtr;//<2F><><EFBFBD>ʻ<EFBFBD><CABB><EFBFBD><EFBFBD><EFBFBD><D4B0><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
QTimer m_timerFilterA;
|
|
|
QTimer m_timerFilterB;
|
|
|
};
|
|
|
#endif
|
|
|
|