2 changed files with 58 additions and 50 deletions
@ -1,54 +1,52 @@ |
|||||
#ifndef WIDGETPLOT2D_H |
#ifndef WIDGETPLOT2D_H |
||||
#define WIDGETPLOT2D_H |
#define WIDGETPLOT2D_H |
||||
|
|
||||
#include <QWidget> |
|
||||
#include <QCheckBox> |
#include <QCheckBox> |
||||
#include <QLabel> |
#include <QLabel> |
||||
#include <QPushButton> |
#include <QPushButton> |
||||
|
#include <QWidget> |
||||
|
|
||||
#include "qcustomplot.h" |
#include "qcustomplot.h" |
||||
|
|
||||
namespace Ui { |
namespace Ui { |
||||
class WidgetPlot2D; |
class WidgetPlot2D; |
||||
} |
} |
||||
|
|
||||
class WidgetPlot2D : public QWidget |
|
||||
{ |
|
||||
Q_OBJECT |
|
||||
|
|
||||
public: |
|
||||
explicit WidgetPlot2D(QWidget *parent = 0); |
|
||||
~WidgetPlot2D(); |
|
||||
|
class WidgetPlot2D : public QWidget { |
||||
|
Q_OBJECT |
||||
|
|
||||
void initGraphName(QStringList name); |
|
||||
|
public: |
||||
|
explicit WidgetPlot2D(QWidget *parent = 0); |
||||
|
~WidgetPlot2D(); |
||||
|
|
||||
private: |
|
||||
Ui::WidgetPlot2D *ui; |
|
||||
|
void initGraphName(QStringList name); |
||||
|
|
||||
QVector<QCheckBox*> isShowCheckBoxVector; // 是否显示勾选框 |
|
||||
QVector<QLabel*> valueLabelVector; // label数值显示 |
|
||||
QVector<QPushButton*> GraphColorPushButtonVector; // 曲线颜色选择按钮 |
|
||||
QMap<QString, int> nameToGraphMap; // 曲线名称对应曲线序号 |
|
||||
QVector<double> valueVector; // 存储曲线的当前值 |
|
||||
QTime time; |
|
||||
|
private: |
||||
|
Ui::WidgetPlot2D *ui; |
||||
|
|
||||
int pointNum = 0; |
|
||||
|
QVector<QCheckBox *> isShowCheckBoxVector; // 是否显示勾选框 |
||||
|
QVector<QLabel *> valueLabelVector; // label数值显示 |
||||
|
QVector<QPushButton *> GraphColorPushButtonVector; // 曲线颜色选择按钮 |
||||
|
QMap<QString, int> nameToGraphMap; // 曲线名称对应曲线序号 |
||||
|
QVector<double> valueVector; // 存储曲线的当前值 |
||||
|
|
||||
void initQCP(); |
|
||||
void initWidget(); |
|
||||
void setTheme(QColor axis, QColor background); |
|
||||
bool isDirExist(QString fullPath); |
|
||||
void savePlotPng(); |
|
||||
|
int pointCnt[100] = {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(); |
|
||||
|
private slots: |
||||
|
void changeGraphVisible(); |
||||
|
void changeGraphColor(); |
||||
|
void plotOperation(); |
||||
|
void horzScrollBarChanged(int value); |
||||
|
void changePlotTheme(); |
||||
|
|
||||
public slots: |
|
||||
void addData(QString name, double value,int offms); |
|
||||
|
public slots: |
||||
|
void addData(QString name, double value, int offms); |
||||
}; |
}; |
||||
|
|
||||
#endif // WIDGETPLOT2D_H |
|
||||
|
#endif // WIDGETPLOT2D_H |
Write
Preview
Loading…
Cancel
Save
Reference in new issue