-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgrabapi.h
More file actions
54 lines (38 loc) · 1.05 KB
/
Copy pathgrabapi.h
File metadata and controls
54 lines (38 loc) · 1.05 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
#ifndef GRABAPI_H
#define GRABAPI_H
#include <QObject>
#include <QElapsedTimer>
#include <QDebug>
#include <sstream>
#include <iostream>
#include <string>
#include <vector>
#include <curl/curl.h>
class GrabApi : public QObject {
Q_OBJECT
public:
static QStringList acceptedInputs;
static QStringList acceptedOutputs;
GrabApi(std::string url, int delay = 500, bool rolling = false, int numPoints=15);
~GrabApi();
static size_t curlWriteCallback(void* contents, size_t size, size_t nmemb, std::string* s);
static std::string request(std::string url);
static std::vector<std::vector<double>> parseList(std::string data);
signals:
void setPoints(std::vector<std::vector<double>> points);
void addPoint(qreal, qreal);
void appendPoints(std::vector<std::vector<double>> points);
public slots:
void start();
void stop();
void Delete();
private:
void timerEvent(QTimerEvent *event);
std::string url;
int delay;
int size;
bool rolling;
int numPoints;
int timerId;
};
#endif // GRABAPI_H