-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewgraph.h
37 lines (31 loc) · 975 Bytes
/
newgraph.h
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
#ifndef NEWGRAPH_H
#define NEWGRAPH_H
#include <QObject>
#include <QTimer>
class newgraph : public QObject
{
Q_OBJECT
public:
explicit newgraph(QObject *parent = nullptr);
~newgraph();
int devNum;
int byteNum;
int id;
public slots:
void dataPool(int _devNum, int _byteNum, int _id, double _endValue, int pointsOnGraph, QString _drawGraphColor);//приём живых данных
void oscillatorInput();//по внешнему таймеру сдвиг массива с точками на один шаг и отправка на рисование
void repaintThis();
private:
QVector<double> pointsWithValues;
QVector<double> bufferForMidValue;
QString graphColor;
double value = 0.0;
double lastValue = 0.0;
int watchDogCount = 0;
void watchDog();
QTimer watchDogTimer;
bool watchDogFlag = false;
signals:
void graph2Painter(QVector<double> data, QString color);
};
#endif // NEWGRAPH_H