12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- #ifndef CHART_FILE_H
- #define CHART_FILE_H
- #include <QWidget>
- #include <QChart>
- #include <QLineSeries>
- #include <QVector>
- #include <QTimer>
- #include <QStandardItemModel>
- #include <QCheckBox>
- #include <QValueAxis>
- #include <QChartView>
- #include "code/tree/tree_model_set.h"
- namespace Ui {
- class chart_file;
- }
- class chart_file : public QWidget
- {
- Q_OBJECT
- public:
- explicit chart_file(QWidget *parent = nullptr);
- ~chart_file();
- void setTreeModel(tree_model_set *model);
- void setPointsNum(int num);
- void addChartData(float time, float *pointsDis);
- signals:
- void treeItemClicked(const QModelIndex &index);
- private:
- Ui::chart_file *ui;
- void wheelEvent(QWheelEvent *event);
- tree_model_set *treeModel;
- void initUI();
- void initChart();
- void initSlot();
- void initTable(int pointsNumber);
- void initFontColor();
- void handleTreeItemClicked(const QModelIndex &index);
- void initReadData();
- void addData();
- QChartView *chartView;
- QChart *chart;
- QLineSeries *series[8];
- int pointsSize;
- float *time;
- float *point1;
- float *point2;
- int pointsNum;
- float **tempDis;
- QTimer *timer;
- quint16 count;
- private slots:
- void timerSlot();
- void selectAll();
- void invertSelect();
- void checkboxChanged();
- private:
- QVector<QCheckBox *> checkBoxVector;
- QString strColor[9];
- QVector<QColor> colorTable;
- QStandardItemModel *model;
- QValueAxis *axisX;
- QValueAxis *axisY;
- void addTableData(float **pointsDis);
- };
- #endif
|