#ifndef WIDGETPLOT2D_H #define WIDGETPLOT2D_H #include #include #include #include #include "qcustomplot.h" namespace Ui { class WidgetPlot2D; } class WidgetPlot2D : public QWidget { Q_OBJECT public: explicit WidgetPlot2D(QWidget *parent = 0); ~WidgetPlot2D(); void initGraphName(QStringList name); private: Ui::WidgetPlot2D *ui; QVector isShowCheckBoxVector; // 是否显示勾选框 QVector valueLabelVector; // label数值显示 QVector GraphColorPushButtonVector; // 曲线颜色选择按钮 QMap nameToGraphMap; // 曲线名称对应曲线序号 QVector valueVector; // 存储曲线的当前值 QTime time; int pointNum = 0; void initQCP(); void initWidget(); void setTheme(QColor axis, QColor background); bool isDirExist(QString fullPath); void savePlotPng(); private slots: void changeGraphVisible(); void changeGraphColor(); void plotOperation(); void horzScrollBarChanged(int value); void changePlotTheme(); public slots: void addData(QString name, double value,int offms); }; #endif // WIDGETPLOT2D_H