| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
#ifndef GRAPHDIALOG_H |
| 33 |
#define GRAPHDIALOG_H |
| 34 |
|
| 35 |
#include <QDialog> |
| 36 |
#include <QtCharts/QChartView> |
| 37 |
#include <QtCharts/QBarSet> |
| 38 |
#include <QtCharts/QLineSeries> |
| 39 |
#include <QtCharts/QValueAxis> |
| 40 |
using namespace QtCharts; |
| 41 |
|
| 42 |
|
| 43 |
#include "ophstat.h" |
| 44 |
#include "list.h" |
| 45 |
#include "ui_graphdialog.h" |
| 46 |
|
| 47 |
class GraphDialog : public QDialog, public Ui::GraphDialog { |
| 48 |
Q_OBJECT |
| 49 |
|
| 50 |
public: |
| 51 |
GraphDialog(QWidget *parent = 0); |
| 52 |
|
| 53 |
void plot(ophstat_t *stats, int crack_time); |
| 54 |
|
| 55 |
private: |
| 56 |
void initBarGraph(const int numValues, QChart* chart, QBarSet *set, QValueAxis *axisX, QValueAxis *axisY, QString title, const QColor color); |
| 57 |
void plotHistoLength(uint32_t *val, QChartView *view); |
| 58 |
void plotHistoCategory(uint32_t *val, QChartView *view); |
| 59 |
void plotCurve(list_t *list, int crack_time, QChartView *view); |
| 60 |
|
| 61 |
private: |
| 62 |
|
| 63 |
QBarSet *lengthSet; |
| 64 |
QChart *lengthHistogram; |
| 65 |
QValueAxis *lengthAxisX; |
| 66 |
QValueAxis *lengthAxisY; |
| 67 |
|
| 68 |
QBarSet *categorySet; |
| 69 |
QChart *categoryHistogram; |
| 70 |
QValueAxis *categoryAxisX; |
| 71 |
QValueAxis *categoryAxisY; |
| 72 |
|
| 73 |
QLineSeries *timeSeries; |
| 74 |
QVector<QPointF> *timeVector; |
| 75 |
QChart *timeCurve; |
| 76 |
QValueAxis *timeAxisX; |
| 77 |
QValueAxis *timeAxisY; |
| 78 |
|
| 79 |
}; |
| 80 |
|
| 81 |
#endif |