mainwindow.h 905 B

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