You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.3 KiB

  1. #ifndef WIDGETPLOT2D_H
  2. #define WIDGETPLOT2D_H
  3. #include <QWidget>
  4. #include <QCheckBox>
  5. #include <QLabel>
  6. #include <QPushButton>
  7. #include "qcustomplot.h"
  8. namespace Ui {
  9. class WidgetPlot2D;
  10. }
  11. class WidgetPlot2D : public QWidget
  12. {
  13. Q_OBJECT
  14. public:
  15. explicit WidgetPlot2D(QWidget *parent = 0);
  16. ~WidgetPlot2D();
  17. void initGraphName(QStringList name);
  18. private:
  19. Ui::WidgetPlot2D *ui;
  20. QVector<QCheckBox*> isShowCheckBoxVector; // 是否显示勾选框
  21. QVector<QLabel*> valueLabelVector; // label数值显示
  22. QVector<QPushButton*> GraphColorPushButtonVector; // 曲线颜色选择按钮
  23. QMap<QString, int> nameToGraphMap; // 曲线名称对应曲线序号
  24. QVector<double> valueVector; // 存储曲线的当前值
  25. QTime time;
  26. int pointNum = 0;
  27. void initQCP();
  28. void initWidget();
  29. void setTheme(QColor axis, QColor background);
  30. bool isDirExist(QString fullPath);
  31. void savePlotPng();
  32. private slots:
  33. void changeGraphVisible();
  34. void changeGraphColor();
  35. void plotOperation();
  36. void horzScrollBarChanged(int value);
  37. void changePlotTheme();
  38. public slots:
  39. void addData(QString name, double value,int offms);
  40. };
  41. #endif // WIDGETPLOT2D_H