#ifndef _VALUEMAINUI_H_ #define _VALUEMAINUI_H_ #include #include "ui_valueMainUI.h" #include #include "RoiImgViewer.h" #include "lpConfigUI.h" #include "lpDebugUI.h" #include #include #include #include "libTcpClient.h" #include "../QPLCDevice.h" #include "QTCPDebugUI.h" #include 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 msg_ptr); Q_SLOT void on_data_send_completed_A(QSharedPointer); Q_SLOT void on_data_recv_completed_A(QSharedPointer msg_ptr, QSharedPointer pData); Q_SLOT void on_connected_A(); Q_SLOT void on_disconnected_A(); //B Q_SLOT void on_message_receive_B(QSharedPointer msg_ptr); Q_SLOT void on_data_send_completed_B(QSharedPointer); Q_SLOT void on_data_recv_completed_B(QSharedPointer msg_ptr, QSharedPointer 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); 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 };//展示检测图像 RoiImgViewer *m_ImgViewer_B{ nullptr };//展示检测图像 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 }; QStringList m_appNames;//从机app名 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 m_VecTranPtr;//国际化语言包管理 }; #endif