mainwindow.h 1019 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. void 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. public slots:
  29. void onUpdateScreen(const QJsonObject &obj);
  30. void onPageSwitdh(int state);
  31. void onConfigureUpdate(const QString &filename);
  32. void onReloadCanvas();
  33. private slots:
  34. void onReport();
  35. };
  36. #endif // MAINWINDOW_H