You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.2 KiB
C++
54 lines
1.2 KiB
C++
#ifndef MODULEPOSTDATA_H
|
|
#define MODULEPOSTDATA_H
|
|
|
|
#include <QObject>
|
|
#include <QNetworkReply>
|
|
#include <QNetworkRequest>
|
|
#include <QNetworkAccessManager>
|
|
#include <QHttpMultiPart>
|
|
#include <QUrl>
|
|
#include <QJsonObject>
|
|
#include <QJsonDocument>
|
|
#include <QEventLoop>
|
|
#include <QMessageBox>
|
|
#include <QDebug>
|
|
#include <QJsonArray>
|
|
#include <QSettings>
|
|
#include <QHttpPart>
|
|
#include <QUrlQuery>
|
|
#include <QTimer>
|
|
#include <QDir>
|
|
#include <chrono>
|
|
#include "uart1.h"
|
|
class modulePostData : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit modulePostData(QObject *parent = nullptr);
|
|
|
|
//23.8.24 断电数据上传
|
|
void powerlost();
|
|
private:
|
|
QNetworkAccessManager *m_pNetWorkManagerAna;
|
|
QNetworkAccessManager *m_pNetWorkManagerAcc;
|
|
QNetworkAccessManager *m_pNetWorkManagerDig;
|
|
QEventLoop m_loop;
|
|
QString tokenStr = "";
|
|
QString urlHead = "";
|
|
bool isPost = true; //23.8.24 判断上传是否成功
|
|
void authentication();
|
|
void postAnaData();
|
|
void postAccData();
|
|
signals:
|
|
|
|
private slots:
|
|
void on_authentication();
|
|
void on_finishedana();
|
|
void on_finishedacc();
|
|
void on_finisheddig();
|
|
void onTimerTimeOutSendData();
|
|
void onPostDigData();
|
|
};
|
|
|
|
#endif // MODULEPOSTDATA_H
|