mainwindow.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef __MAINWINDOW_H__
  2. #define __MAINWINDOW_H__
  3. #include <QMainWindow>
  4. #include <QStackedWidget>
  5. #include <QTimer>
  6. #include <QLabel>
  7. #include "broadcast.h"
  8. #define MAX_CANVAS_COUNT 12
  9. class MainWindow : public QMainWindow
  10. {
  11. Q_OBJECT
  12. public:
  13. explicit MainWindow(const int &frequency, QWidget *parent = nullptr);
  14. ~MainWindow();
  15. protected:
  16. void init_ui();
  17. bool reload();
  18. void clear();
  19. void setCurrentCanvas(bool isNewComfigure = false);
  20. private:
  21. QStackedWidget *m_pStackedWidget;
  22. QTimer m_timer; // 数据中断检测定时器
  23. QTimer m_updateScreenTimer; // 更新画面显示定时器
  24. int m_frequency; // 更新频率
  25. QLabel *m_pErrStrLabel;
  26. Broadcast m_broadcast;
  27. QTimer m_reportTimer;
  28. QString m_packageCount;
  29. public slots:
  30. void onUpdateScreen(const QJsonObject &obj);
  31. void onPageSwitdh(int state);
  32. void onConfigureUpdate(const QString &filename);
  33. void onReloadCanvas();
  34. private slots:
  35. void onReport();
  36. };
  37. #endif // MAINWINDOW_H