-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmrplotter.h
More file actions
106 lines (72 loc) · 2.76 KB
/
mrplotter.h
File metadata and controls
106 lines (72 loc) · 2.76 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#ifndef MRPLOTTER_H
#define MRPLOTTER_H
#include "plotarea.h"
#include <cstdint>
#include <QHash>
#include <QObject>
#define PLOT_DATA_UPDATE_INTERVAL 10000
class PlotArea;
class MrPlotter : public QObject
{
Q_OBJECT
Q_PROPERTY(TimeAxisArea* timeaxisarea READ timeAxisArea WRITE setTimeAxisArea)
Q_PROPERTY(QList<qreal> timeDomain READ getTimeDomain WRITE setTimeDomain)
Q_PROPERTY(QList<qreal> scrollableDomain READ getScrollableDomain WRITE setScrollableDomain)
Q_PROPERTY(QString timeZone READ getTimeZoneName WRITE setTimeZone)
Q_PROPERTY(bool timeTickPromotion READ getTimeTickPromotion WRITE setTimeTickPromotion)
Q_PROPERTY(QList<QVariant> plotList READ getPlotList WRITE setPlotList)
public:
MrPlotter();
~MrPlotter();
const QString& name() const;
void setName(QString& newname);
Q_INVOKABLE QList<QVariant> getPlotList() const;
Q_INVOKABLE void setPlotList(QList<QVariant> newplotlist);
PlotArea* mainPlot() const;
void setMainPlot(PlotArea* newmainplot);
PlotArea* dataDensityPlot() const;
void setDataDensityPlot(PlotArea* newddplot);
TimeAxisArea* timeAxisArea() const;
void setTimeAxisArea(TimeAxisArea* newtimeaxisarea);
Q_INVOKABLE Stream* newStream(QString uuid, DataSource* dataSource);
Q_INVOKABLE void delStream(Stream* s);
Q_INVOKABLE bool setTimeDomain(QList<qreal> domain);
Q_INVOKABLE QList<qreal> getTimeDomain();
Q_INVOKABLE void autozoom(QVariantList streams);
Q_INVOKABLE bool setScrollableDomain(QList<qreal> domain);
Q_INVOKABLE QList<qreal> getScrollableDomain();
Q_INVOKABLE YAxis* newYAxis();
Q_INVOKABLE YAxis* newYAxis(float domainLo, float domainHi);
Q_INVOKABLE void delYAxis(YAxis* ya);
bool setTimeZone(QByteArray timezone);
QByteArray getTimeZone();
Q_INVOKABLE bool setTimeZone(QString timezone);
Q_INVOKABLE QString getTimeZoneName();
Q_INVOKABLE void setTimeTickPromotion(bool enable);
Q_INVOKABLE bool getTimeTickPromotion();
Q_INVOKABLE void updateDataAsync();
Q_INVOKABLE void updateView();
// Q_INVOKABLE bool hardcodeLocalData(QUuid uuid, QVariantList data);
// Q_INVOKABLE bool dropHardcodedLocalData(QUuid uuid);
TimeAxis timeaxis;
int64_t scrollable_min;
int64_t scrollable_max;
static Cache cache;
signals:
public slots:
void updateDataAsyncThrottled();
private:
TimeAxisArea* timeaxisarea;
QTimer* updateTimer;
QList<PlotArea*> plots;
uint64_t id;
/* For throttling full updates. READY indicates whether a call can be
* made, and PENDING indicates whether there is a call waiting to be
* made.
*/
bool ready;
bool pending;
static uint64_t nextID;
static QHash<uint64_t, MrPlotter*> instances;
};
#endif // MRPLOTTER_H