Newer
Older
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
#pragma once
#include <vector>
#include <QtCore/QObject>
#include <QtCore/QEventLoop>
class QNetworkAccessManager;
class QNetworkReply;
class QDomDocument;
class QDomNodeList;
class gridListReader : public QObject {
private:
bool _debug = false;
bool readyToReadData = false;
const std::string gridApdListBaseUrl = "https://ep1.ruhr-uni-bochum.de/endcapProductionDB/api/grid_listapds.php";
std::string gridApdListApiUrl = "";
QNetworkAccessManager* networkManager;
QNetworkReply *replyWithFullList;
QDomDocument *documentFromNetworkReply;
QDomNodeList *nodeListApds;
QEventLoop _waitForNetwork;
void getApdListFromNetwork();
void verifyHttpResponse();
void getDataFromReply();
void verifyDataFormat();
void verifyQuerySuccess();
void getApdNodeList();
std::vector<std::string> getSerialListIfDataCanBeRead();
std::vector<std::string> getSerialListFromNodeList();
public:
gridListReader(int gridnumber, bool debug = false);
void getAndProcessData();
std::vector<std::string> getListOfSerials();
};