-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdynchart.h
More file actions
60 lines (42 loc) · 1.07 KB
/
Copy pathdynchart.h
File metadata and controls
60 lines (42 loc) · 1.07 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef DYNCHART_H
#define DYNCHART_H
#include <QObject>
#include <QElapsedTimer>
#include <QDebug>
#include <QtCharts>
#include "grabapi.h"
class DynChart : public QObject {
Q_OBJECT
public:
DynChart(QChartView *view, QString title, std::string url, int numPoints = 60, int delay = 500, int numBlocks = 1);
~DynChart();
QString getTitle();
std::string getURL();
int getNumPoints();
int getDelay();
int getNumBlocks();
public slots:
void setPoints(std::vector<std::vector<double>> points);
void removeFirst(qreal numPoints);
void appendPoints(std::vector<std::vector<double>> points);
signals:
void startAPI();
void stopAPI();
void deleteAPI();
private:
void updateAxis();
void removeDuplicatePoints(std::vector<std::vector<double>> *points);
QThread thread;
GrabApi *api;
QChartView *view;
QLineSeries *series;
QChart *chart;
QString title;
std::string url;
int maxBlocks;
std::vector<int> blockSizes;
int numPoints;
int delay;
int numBlocks;
};
#endif // DYNCHART_H