hyperion.ng/include/utils/Stats.h
Paulchen-Panther 2a77f6f012
even more changes
Signed-off-by: Paulchen-Panther <Paulchen--Panter@gmx.net>
2018-12-28 18:28:49 +01:00

46 lines
800 B
C++

// qt includes
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QUrl>
#include <QUrlQuery>
#include <QTimer>
// hyperion includes
#include <utils/Logger.h>
#include <hyperion/Hyperion.h>
class Stats : public QObject
{
Q_OBJECT
public:
Stats();
static Stats* getInstance() { return instance; };
static Stats* instance;
void handleDataUpdate(const QJsonObject& config);
private:
friend class HyperionDaemon;
Stats(const QJsonObject& config);
~Stats();
private:
Logger* _log;
Hyperion* _hyperion;
QString _hash = "";
QByteArray _ba;
QNetworkRequest _req;
QNetworkAccessManager _mgr;
bool trigger(bool set = false);
private slots:
void initialExec();
void sendHTTP();
void sendHTTPp();
void resolveReply(QNetworkReply *reply);
};