ChartsAndCamerasWnd.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #ifndef CHARTSANDCAMERASWND_H
  2. #define CHARTSANDCAMERASWND_H
  3. #include <QMainWindow>
  4. #include <QSlider>
  5. #include <QLineEdit>
  6. #include <QSettings>
  7. #include "chartline.h"
  8. namespace Ui {
  9. class ChartsAndCamerasWnd;
  10. }
  11. // struct SeriesInfo {
  12. // QString seriesName;
  13. // QColor lineColor;
  14. // QPixmap markerIcon;
  15. // QList<QPointF> data;
  16. // };
  17. class ChartsAndCamerasWnd : public QMainWindow
  18. {
  19. Q_OBJECT
  20. public:
  21. explicit ChartsAndCamerasWnd(QWidget *parent = nullptr);
  22. ~ChartsAndCamerasWnd();
  23. void initFrom();
  24. void connectSliderAndLineEdit(QSlider* slider, QLineEdit* lineEdit);
  25. void initLineEdits();
  26. void initSliders();
  27. protected:
  28. void wheelEvent(QWheelEvent *event);
  29. void loadSettings();
  30. void checkSettings();
  31. void loadGroupSettings(int Id, int Index);
  32. void showEvent(QShowEvent *event) override;
  33. void hideEvent(QHideEvent *event) override;
  34. private slots:
  35. void on_ZoomUpButton_clicked();
  36. QPixmap getCurrentPixmap() const {
  37. return currentPixmap;
  38. }
  39. // 通用槽函数
  40. void on_CheckBox_clicked();
  41. void on_ZoomOutButton_clicked();
  42. // void on_GreenDiamondcheckBox_clicked();
  43. // void on_YellowDiamondcheckBox_clicked();
  44. // void on_BlackDiamondcheckBox_clicked();
  45. // void on_BlueDiamondcheckBox_clicked();
  46. // void on_BlueHorizontalLinecheckBox_clicked();
  47. // void on_BlueVerticalBarcheckBox_clicked();
  48. // void on_GreenVerticalBarcheckBox_clicked();
  49. // void on_PurpleVerticalBarcheckBox_clicked();
  50. // void on_RedDiamondcheckBox_clicked();
  51. // void on_RedHorizontalLinecheckBox_clicked();
  52. // void on_WhiteVerticalBarcheckBox_clicked();
  53. private:
  54. Ui::ChartsAndCamerasWnd *ui;
  55. // // 三个 ChartLine 实例
  56. // ChartLine *chartLine;
  57. // ChartLine *chartLine1;
  58. // ChartLine *chartLine2;
  59. // ChartLine 实例
  60. ChartLine *chartLine;
  61. ChartLine *chartLine1;
  62. ChartLine *chartLine2;
  63. // 存储所有系列信息
  64. QMap<QString, DataSeries> m_seriesMap;
  65. // 初始化系列信息
  66. void initializeSeriesInfo();
  67. QPixmap currentPixmap;
  68. qreal scaleFactor;
  69. int lastGroupId = -1;
  70. int lastIndex = -1;
  71. };
  72. #endif // CHARTSANDCAMERASWND_H