code_production/app/HGProductionTool/analysisjson.h

39 lines
811 B
C
Raw Normal View History

2022-12-14 06:39:22 +00:00
#ifndef ANALYSISJSON_H
#define ANALYSISJSON_H
#include <QString>
#include <QJsonDocument>
#include <vector>
class AnalysisJson
{
public:
struct json_node{
QString title;
QString name;
bool is_man;
std::int32_t err_level;
2022-12-14 12:28:25 +00:00
QString desc;
2022-12-14 06:39:22 +00:00
};
struct json_global{
std::int32_t vid_org;
std::int32_t pid_org;
std::int32_t vid_to;
std::int32_t pid_to;
std::int32_t speed_mode;
std::int32_t sleep_time;
2022-12-14 06:39:22 +00:00
};
AnalysisJson() = delete ;
AnalysisJson(QString path);
std::vector<json_node> GetNode();
json_global GetGlobal();
bool savejson(QString path,std::vector<json_node> json);
bool savejson(QString path, QJsonDocument doc);
private:
QJsonDocument m_json;
};
#endif // ANALYSISJSON_H