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.

76 lines
1.4 KiB
C

2 years ago
#ifndef CLIENT_H
#define CLIENT_H
#define CPPHTTPLIB_OPENSSL_SUPPORT
2 years ago
#include <httplib.h>
#include <json.hpp>
2 years ago
#include <codecvt>
#include <string>
#include <iostream>
2 years ago
#include <httplib.h>
#include <QString>
using namespace std;
class FanClass // 风机类
{
public:
int errorCode;
int fanId;
double angle; // 角度
double distance; // 相对距离
QString errorInfo;
QString fanCode;
QString flangeState;
QString headroomState;
QString gyroState;
};
class FanManage // 所有风机管理类
{
public:
std::map<QString, FanClass> allFans; // 所有风机
std::vector<QString> interruptedFans; // 通讯中断
std::vector<QString> standbyFans; // 待机等风
std::vector<QString> normalFans; // 正常运行
std::vector<QString> hutdownFans; // 停机维护
std::vector<QString> failureFans; // 故障停机
std::vector<QString> runFans; // 启动
};
2 years ago
class HTTPClient
{
private:
2 years ago
httplib::Headers header;
string loginIndex;
string fanListIndex;
string headroomDetailIndex;
string gyroDetailIndex;
string featureHistoryIndex;
2 years ago
2 years ago
public:
httplib::Client client;
HTTPClient();
FanManage getFanList();
QString getFlangeList(int fanId);
QString getHeadroomList(int fanId);
QString getGyroList(int fanId);
QString getHistoryList(int fanId);
2 years ago
};
2 years ago
extern HTTPClient httpClient;
2 years ago
#endif // CLIENT_H