代码拉取完成,页面将自动刷新
#ifndef JSONANALYSIS_H
#define JSONANALYSIS_H
#include <QByteArray>
#include <QList>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include "datadictionary.h"
typedef enum {
BB_CLOUD_CMD = 0,
}JsonProType_t;
typedef enum{
STRING_TYPE = 0,
FLOAT_TYPE,
INT_TYPE,
}DataType_t;
typedef struct {
JsonProType_t Type;
QByteArray Data;
QByteArray Result;
}DataSt_t;
class SpecialRead {
public:
SpecialRead()
{
m_DataDictionary = DataDictionary::GetInstance();
m_Next = nullptr;
m_Cmd1 = "";
}
void AddNextExec(SpecialRead *_Next){m_Next = _Next;}
bool CmdExec(QString Cmd,QString &Data,QString &err)
{
if(isExec(Cmd)){
return Exec(Cmd,Data,err);
}else if(m_Next){
return m_Next->CmdExec(Cmd,Data,err);
}else {
err = "data " + Cmd + " Unsupported ;";
return false;
}
return false;
}
void Reset()
{
_Reset();
if(m_Next)
m_Next->Reset();
}
protected:
virtual bool Exec(QString Cmd,QString &Data,QString &err) = 0;
virtual void _Reset() = 0;
QString m_Cmd1;
DataDictionary *m_DataDictionary;
private:
bool isExec(QString Cmd)
{
return (Cmd == m_Cmd1);
}
SpecialRead *m_Next;
};
class GosdtyRead : public SpecialRead
{
public:
GosdtyRead(){m_Cmd1 = "v1osdty";}
protected:
bool Exec(QString Cmd,QString &Data,QString &err)
{
int _data = m_DataDictionary->GetSystemData(SYS_OSD_DEVICE).toInt();
if(_data == HK_DEVICE || _data == WWA_DEVICE || _data == OTHER_DEVICE){
Data.setNum(2);
}else if(_data == LOCAL_DEVICE){
Data.setNum(1);
}else if(_data == OSD_CLOSE){
Data.setNum(3);
}else {
err = Cmd + " data abnormal;";
}
return true;
}
void _Reset(){}
};
class GosdtpRead : public SpecialRead
{
public:
GosdtpRead(){m_Cmd1 = "v1osdtp";}
protected:
bool Exec(QString Cmd,QString &Data,QString &err)
{
int _data = m_DataDictionary->GetSystemData(SYS_OSD_DEVICE).toInt();
if(_data == HK_DEVICE ){
Data.setNum(1);
}else if( _data == WWA_DEVICE){
Data.setNum(2);
}else {
Data.setNum(3);
}
return true;
}
void _Reset(){}
};
class SpecialExec {
public:
SpecialExec()
{
m_DataDictionary = DataDictionary::GetInstance();
m_Next = nullptr;
m_Cmd1 = "";
m_Cmd2 = "";
m_Cmd3 = "";
}
void AddNextExec(SpecialExec *_Next){m_Next = _Next;}
bool CmdExec(QString Cmd,QString Data,QString &err)
{
if(isExec(Cmd)){
return Exec(Cmd,Data,err);
}else if(m_Next){
return m_Next->CmdExec(Cmd,Data,err);
}else {
err = "data " + Cmd + " Unsupported ;";
return false;
}
return false;
}
void Reset()
{
_Reset();
if(m_Next)
m_Next->Reset();
}
protected:
virtual bool Exec(QString Cmd,QString Data,QString &err) = 0;
virtual void _Reset() = 0;
QString m_Cmd1;
QString m_Cmd2;
QString m_Cmd3;
DataDictionary *m_DataDictionary;
private:
bool isExec(QString Cmd)
{
return (Cmd == m_Cmd1) | \
(Cmd == m_Cmd2) | \
(Cmd == m_Cmd3);
}
SpecialExec *m_Next;
};
class MsgCleanCmd : public SpecialExec
{
public:
MsgCleanCmd(){m_Cmd1 = "msgclean";}
protected:
bool Exec(QString Cmd,QString Data,QString &err)
{
int _data = Data.toInt();
if(_data == 1){
m_DataDictionary->SetMisData(MIS_CUSTOM_ALM_MSG,QString(""));
m_DataDictionary->SetMisData(MIS_CUSTOM_ALM_TIMER,0);
}else {
err = Cmd + " cmd data is not 1 ;";
return false;
}
return true;
}
void _Reset(){}
};
class GksdwCmd : public SpecialExec
{
public:
GksdwCmd()
{
m_Cmd1 = "gksdw";
m_Cmd2 = "gspjd";
m_Cmd3 = "gdwcz";
_Reset();
}
protected:
bool Exec(QString Cmd,QString Data,QString &err)
{
if(Cmd == m_Cmd1){
return Cmd1Exec(Data,err);
}else if (Cmd == m_Cmd2) {
return Cmd2Exec(Data,err);
}else if (Cmd == m_Cmd3){
return Cmd3Exec(Data,err);
}
return true;
}
void _Reset()
{
Cmd1ExecEnd = false;
Cmd2ExecEnd = false;
Cmd3ExecEnd = false;
Cmd1Data = 0.0;
Cmd2Data = 0.0;
Cmd3Data = 0.0;
}
private:
bool Cmd1Exec(QString Data,QString &err)
{
bool exec = false;
Cmd1ExecEnd = true;
if(Data.toInt() != 1){
err = m_Cmd1 + " cmd data is not 1 ;";
return false;
}
if(Cmd2ExecEnd){
exec = true;
m_DataDictionary->SetCameraCtlData(CAM_REQ_H_ANGLE,Cmd2Data);
}
if(Cmd3ExecEnd){
exec = true;
m_DataDictionary->SetCameraCtlData(CAM_REQ_V_ANGLE,Cmd3Data);
}
if(exec == false){
err = m_Cmd1 + " err spjd or czjd have not setted ;";
return false;
}
return true;
}
bool Cmd2Exec(QString Data,QString &err)
{
if(Cmd1ExecEnd){
err = m_Cmd2 + " err ksdw is execed ;";
return false;
}
Cmd2Data = Data.toDouble();
Cmd2ExecEnd = true;
return true;
}
bool Cmd3Exec(QString Data,QString &err)
{
if(Cmd1ExecEnd){
err = m_Cmd3 + " err ksdw is execed ;";
return false;
}
Cmd3Data = Data.toDouble();
Cmd3ExecEnd = true;
return true;
}
private:
bool Cmd1ExecEnd;
bool Cmd2ExecEnd;
bool Cmd3ExecEnd;
double Cmd1Data;
double Cmd2Data;
double Cmd3Data;
};
class GsxCmd : public SpecialExec
{
public:
GsxCmd(){
m_Cmd1 = "gs";
m_Cmd2 = "gx";
_Reset();
}
protected:
bool Exec(QString Cmd,QString Data,QString &err)
{
if(Cmd == m_Cmd1){
return Cmd1Exec(Data,err);
}else if(Cmd == m_Cmd2) {
return Cmd2Exec(Data,err);
}
return true;
}
void _Reset()
{
Cmd1ExecEnd = false;
Cmd2ExecEnd = false;
}
private:
bool Cmd1Exec(QString Data,QString &err)
{
if(Cmd2ExecEnd){
err = m_Cmd1 + " err because gx is executed ;";
return false;
}
double CurV = m_DataDictionary->GetCameraCtlData(CAM_CUR_V_VALUE).toDouble();
double Step = m_DataDictionary->GetMisData(MIS_CAMERA_STEP_CAL).toDouble();
m_DataDictionary->SetCameraCtlData(CAM_REQ_V_VALUE,CurV+Step);
Cmd1ExecEnd = true;
return true;
}
bool Cmd2Exec(QString Data,QString &err)
{
if(Cmd1ExecEnd){
err = m_Cmd2 + " err because gs is executed ;";
return false;
}
double CurV = m_DataDictionary->GetCameraCtlData(CAM_CUR_V_VALUE).toDouble();
double Step = m_DataDictionary->GetMisData(MIS_CAMERA_STEP_CAL).toDouble();
m_DataDictionary->SetCameraCtlData(CAM_REQ_V_VALUE,CurV-Step);
Cmd2ExecEnd = true;
return true;
}
private:
bool Cmd1ExecEnd;
bool Cmd2ExecEnd;
};
class GzyCmd : public SpecialExec
{
public:
GzyCmd(){
m_Cmd1 = "gz";
m_Cmd2 = "gy";
_Reset();
}
protected:
bool Exec(QString Cmd,QString Data,QString &err)
{
if(Cmd == m_Cmd1){
return Cmd1Exec(Data,err);
}else if(Cmd == m_Cmd2) {
return Cmd2Exec(Data,err);
}
return true;
}
void _Reset()
{
Cmd1ExecEnd = false;
Cmd2ExecEnd = false;
}
private:
bool Cmd1Exec(QString Data,QString &err)
{
if(Cmd2ExecEnd){
err = m_Cmd1 + " err because gy is executed ;";
return false;
}
double CurV = m_DataDictionary->GetCameraCtlData(CAM_CUR_H_VALUE).toDouble();
double Step = m_DataDictionary->GetMisData(MIS_CAMERA_STEP_CAL).toDouble();
m_DataDictionary->SetCameraCtlData(CAM_REQ_H_VALUE,CurV-Step);
Cmd1ExecEnd = true;
return true;
}
bool Cmd2Exec(QString Data,QString &err)
{
if(Cmd1ExecEnd){
err = m_Cmd2 + " err because gz is executed ;";
return false;
}
double CurV = m_DataDictionary->GetCameraCtlData(CAM_CUR_H_VALUE).toDouble();
double Step = m_DataDictionary->GetMisData(MIS_CAMERA_STEP_CAL).toDouble();
m_DataDictionary->SetCameraCtlData(CAM_REQ_H_VALUE,CurV+Step);
Cmd2ExecEnd = true;
return true;
}
private:
bool Cmd1ExecEnd;
bool Cmd2ExecEnd;
};
class GfdsxCmd : public SpecialExec
{
public:
GfdsxCmd(){
m_Cmd1 = "gfd";
m_Cmd2 = "gsx";
_Reset();
}
protected:
bool Exec(QString Cmd,QString Data,QString &err)
{
if(Cmd == m_Cmd1){
return Cmd1Exec(Data,err);
}else if(Cmd == m_Cmd2) {
return Cmd2Exec(Data,err);
}
return true;
}
void _Reset()
{
Cmd1ExecEnd = false;
Cmd2ExecEnd = false;
}
private:
bool Cmd1Exec(QString Data,QString &err)
{
if(Cmd2ExecEnd){
err = m_Cmd1 + " err because gsx is executed ;";
return false;
}
double CurV = m_DataDictionary->GetCameraCtlData(CAM_CUR_ZOOM_VALUE).toDouble();
double Step = m_DataDictionary->GetMisData(MIS_CAMERA_STEP_CAL).toDouble();
m_DataDictionary->SetCameraCtlData(CAM_REQ_ZOOM_VALUE,CurV+Step);
Cmd1ExecEnd = true;
return true;
}
bool Cmd2Exec(QString Data,QString &err)
{
if(Cmd1ExecEnd){
err = m_Cmd2 + " err because gfd is executed ;";
return false;
}
double CurV = m_DataDictionary->GetCameraCtlData(CAM_CUR_ZOOM_VALUE).toDouble();
double Step = m_DataDictionary->GetMisData(MIS_CAMERA_STEP_CAL).toDouble();
m_DataDictionary->SetCameraCtlData(CAM_REQ_ZOOM_VALUE,CurV-Step);
Cmd2ExecEnd = true;
return true;
}
private:
bool Cmd1ExecEnd;
bool Cmd2ExecEnd;
};
class GosdCmd : public SpecialExec
{
public:
GosdCmd(){
m_Cmd1 = "v1osdty";
m_Cmd2 = "v1osdtp";
_Reset();
}
protected:
bool Exec(QString Cmd,QString Data,QString &err)
{
if(Cmd == m_Cmd1){
return Cmd1Exec(Data,err);
}else if(Cmd == m_Cmd2) {
return Cmd2Exec(Data,err);
}
return true;
}
void _Reset()
{
Cmd1ExecEnd = false;
Cmd2ExecEnd = false;
Cmd1V = 0;
Cmd2V = 0;
}
private:
bool Cmd1Exec(QString Data,QString &err)
{
Cmd1V = Data.toInt();
if(Cmd1V == 1) //本地叠加
{
m_DataDictionary->SetSystemData(SYS_OSD_DEVICE,LOCAL_DEVICE);
}
else if(Cmd1V == 3)//不显示
{
m_DataDictionary->SetSystemData(SYS_OSD_DEVICE,OSD_CLOSE);
}
else if(Cmd1V == 2)//远程叠加
{
if(Cmd2ExecEnd)
{
if(Cmd2V == 1)
{
m_DataDictionary->SetSystemData(SYS_OSD_DEVICE,HK_DEVICE);
}
else if(Cmd2V == 2)
{
m_DataDictionary->SetSystemData(SYS_OSD_DEVICE,WWA_DEVICE);
}
else if(Cmd2V == 3)
{
m_DataDictionary->SetSystemData(SYS_OSD_DEVICE,OTHER_DEVICE);
}
else
{
err = m_Cmd2 + " data : " + QString().number(Cmd2V) + " Unsupported;";
}
}
}
else
{
err = m_Cmd1 + " data : " + Data + " Unsupported;";
return false;
}
Cmd1ExecEnd = true;
return true;
}
bool Cmd2Exec(QString Data,QString &err)
{
Cmd2V = Data.toInt();
if(Cmd1ExecEnd && Cmd1V == 2)
{
if(Cmd2V == 1)
{
m_DataDictionary->SetSystemData(SYS_OSD_DEVICE,HK_DEVICE);
}
else if(Cmd2V == 2)
{
m_DataDictionary->SetSystemData(SYS_OSD_DEVICE,WWA_DEVICE);
}
else if(Cmd2V == 3)
{
m_DataDictionary->SetSystemData(SYS_OSD_DEVICE,OTHER_DEVICE);
}
else
{
err = m_Cmd2 + " data : " + QString().number(Cmd2V) + " Unsupported;";
return false;
}
}
Cmd2ExecEnd = true;
return true;
}
private:
bool Cmd1ExecEnd;
bool Cmd2ExecEnd;
int Cmd1V;
int Cmd2V;
};
class SysRebootCmd : public SpecialExec
{
public:
SysRebootCmd(){
m_Cmd1 = "sysreboot";
_Reset();
}
protected:
bool Exec(QString Cmd,QString Data,QString &err)
{
if(Data.toInt() == 1){
m_DataDictionary->SetMisData(MIS_SYSREBOOT,1);
}else {
err = m_Cmd1 + " err data is not 1 ;";
return false;
}
return true;
}
void _Reset()
{
}
private:
};
class JsonKeyToSys {
public:
JsonKeyToSys(){
m_DataDictionary = DataDictionary::GetInstance();
m_SpecialCmdExec = new MsgCleanCmd;
SpecialExec *Ksdw = new GksdwCmd;
SpecialExec *Sx = new GsxCmd;
SpecialExec *Zy = new GzyCmd;
SpecialExec *Fdsx = new GfdsxCmd;
SpecialExec *SysReboot = new SysRebootCmd;
SpecialExec *osd = new GosdCmd;
m_SpecialCmdExec->AddNextExec(Ksdw);
Ksdw->AddNextExec(Sx);
Sx->AddNextExec(Zy);
Zy->AddNextExec(Fdsx);
Fdsx->AddNextExec(SysReboot);
SysReboot->AddNextExec(osd);
m_SpecialRead = new GosdtyRead;
SpecialRead *osdtp = new GosdtpRead;
m_SpecialRead->AddNextExec(osdtp);
}
private:
enum Access {
RO = 0x1,
WO = 0x2,
RW = RO | WO,
};
#define READ_ACCESS(x) (x & RO)
#define WRITE_ACCESS(x) (x & WO)
typedef struct {
QString Key;
int Index;
enum Access Access;
DataType_t Type;
}KeyToSys_t;
KeyToSys_t m_Tbl[62] = {
{"ei" ,MIS_NET_DEV,RW,STRING_TYPE},
{"eitype" ,MIS_NET_TYPE,RW,INT_TYPE},
{"eip" ,MIS_NET_IP,RW,STRING_TYPE},
{"eipmask" ,MIS_NET_MASK,RW,STRING_TYPE},
{"egate" ,MIS_NET_GATEWAY,RW,STRING_TYPE},
{"edns" ,MIS_NET_DNS,RW,STRING_TYPE},
{"yaddr" ,SYS_SYNC_FACEID_HOST ,RW,STRING_TYPE},
{"yport" ,SYS_SYNC_FACEID_POST ,RW,INT_TYPE},
{"fen" ,SYS_FACEID_ENABLE ,RW,INT_TYPE},
{"fjp" ,SYS_FACEID_JUMP ,RW,INT_TYPE},
{"ft" ,MIS_FACEID_TIMEOUT ,RW,INT_TYPE},
{"v1ip" ,SYS_CAMERA_IP1 ,RW,STRING_TYPE},
{"v1port" ,SYS_CAMERA_PORT1 ,RW,INT_TYPE},
{"v1usr" ,SYS_CAMERA_USERNAME1 ,RW,STRING_TYPE},
{"v1pd" ,SYS_CAMERA_PASSWORD1 ,RW,STRING_TYPE},
{"v1rtsp" ,SYS_CAMERA_URL1 ,RW,STRING_TYPE},
{"v1rtpt" ,SYS_PTZ_PORT ,RW,INT_TYPE},
{"v1osdpt" ,SYS_OSD_PORT ,RW,INT_TYPE},
{"v1osdty" ,1 ,RW,INT_TYPE},
{"v1osdtp" ,1 ,RW,INT_TYPE},
{"v1x" ,SYS_OSD_X_POS ,RW,INT_TYPE},
{"v1y" ,SYS_OSD_Y_POS ,RW,INT_TYPE},
{"v1st" ,MIS_CAMERA_STA1 ,RO,INT_TYPE},
{"v1jmp" ,MIS_DISPLAY_INTERVAL1 ,RW,INT_TYPE},
{"v2ip" ,SYS_CAMERA_IP2 ,RW,STRING_TYPE},
{"v2port" ,SYS_CAMERA_PORT2 ,RW,INT_TYPE},
{"v2usr" ,SYS_CAMERA_USERNAME2 ,RW,STRING_TYPE},
{"v2pd" ,SYS_CAMERA_PASSWORD2 ,RW,STRING_TYPE},
{"v2rtsp" ,SYS_CAMERA_URL2 ,RW,STRING_TYPE},
{"v2st" ,MIS_CAMERA_STA2 ,RO,INT_TYPE},
{"v2jmp" ,MIS_DISPLAY_INTERVAL2 ,RW,INT_TYPE},
{"v3ip" ,SYS_CAMERA_IP3 ,RW,STRING_TYPE},
{"v3port" ,SYS_CAMERA_PORT3 ,RW,INT_TYPE},
{"v3usr" ,SYS_CAMERA_USERNAME3 ,RW,STRING_TYPE},
{"v3pd" ,SYS_CAMERA_PASSWORD3 ,RW,STRING_TYPE},
{"v3rtsp" ,SYS_CAMERA_URL3 ,RW,STRING_TYPE},
{"v3st" ,MIS_CAMERA_STA3 ,RO,INT_TYPE},
{"v3jmp" ,MIS_DISPLAY_INTERVAL3 ,RW,INT_TYPE},
{"gen" ,MIS_ALIGN_STA ,RW,INT_TYPE},
{"gqj" ,MIS_CAMERA_GUN_STA ,RW,INT_TYPE},
{"gbc" ,MIS_CAMERA_STEP ,RW,INT_TYPE},
{"gbs" ,MIS_CAMERA_MAX_ZOOM ,RW,INT_TYPE},
{"gjl" ,MIS_CAMERA_MAX_DISTANCE,RW,INT_TYPE},
{"gsp" ,MIS_H_ANGLE_INIT ,RW,FLOAT_TYPE},
{"gczjd" ,MIS_ALIGN_V_ANGLE ,RW,FLOAT_TYPE},
{"gczjl" ,MIS_ALIGN_V_HEIGHT ,RW,FLOAT_TYPE},
{"ggdxs" ,MIS_ALIGN_V_HEIGHT_RATIO,RW,FLOAT_TYPE},
{"gjx" ,MIS_CAMERA_IMAGE ,RW,INT_TYPE},
{"gpl" ,MIS_FOLLOW_HOOK_FRQ ,RW,INT_TYPE},
{"gs" ,1 ,WO,INT_TYPE},
{"gx" ,1 ,WO,INT_TYPE},
{"gz" ,1 ,WO,INT_TYPE},
{"gy" ,1 ,WO,INT_TYPE},
{"gfd" ,1 ,WO,INT_TYPE},
{"gsx" ,1 ,WO,INT_TYPE},
{"gspjd" ,CAM_CUR_H_ANGLE ,RO,FLOAT_TYPE},
{"gdwcz" ,CAM_CUR_V_ANGLE ,RO,FLOAT_TYPE},
{"gksdw" ,1 ,WO,INT_TYPE},
{"msg" ,MIS_CUSTOM_ALM_MSG ,RW,STRING_TYPE},
{"msgtime" ,MIS_CUSTOM_ALM_TIMER ,RW,INT_TYPE},
{"msgclean" ,1 ,WO,INT_TYPE},
{"sysreboot" ,1 ,WO,INT_TYPE},
};
DataDictionary *m_DataDictionary;
SpecialExec *m_SpecialCmdExec;
SpecialRead *m_SpecialRead;
private:
bool ReadSysData(int Index,QString &Data)
{
bool Result = true;
switch(Index & DATA_INDEX_MASK){
case SYS_INDEX_BASE:
Data = m_DataDictionary->GetSystemData((SystemDataIndex_t)Index);
break;
case MIS_INDEX_BASE:
Data = m_DataDictionary->GetMisData((MisDataIndex_t)Index);
break;
case CAMERA_CTL_INDEX_BASE:
Data = m_DataDictionary->GetMisData((MisDataIndex_t)Index);
break;
default:
Result = false;
break;
}
return Result;
}
bool WriteSysData(int Index,QString Data)
{
bool Result = true;
switch(Index & DATA_INDEX_MASK){
case SYS_INDEX_BASE:
m_DataDictionary->SetSystemData((SystemDataIndex_t)Index,Data);
break;
case MIS_INDEX_BASE:
m_DataDictionary->SetMisData((MisDataIndex_t)Index,Data);
break;
case CAMERA_CTL_INDEX_BASE:
m_DataDictionary->SetMisData((MisDataIndex_t)Index,Data);
break;
default:
Result = false;
break;
}
return Result;
}
public:
bool Read(QJsonObject &Ob,QString &err)
{
bool Result = false;
if(!Ob.contains("k"))
{
err = "data format err ;";
return Result;
}
QString k = Ob["k"].toString();
for(int i = 0;i < sizeof (m_Tbl)/sizeof (KeyToSys_t);i++)
{
if(m_Tbl[i].Key == k && READ_ACCESS(m_Tbl[i].Access))
{
Ob.remove("v");
QString data ;
err = "";
Result = ReadSysData(m_Tbl[i].Index,data);
if(Result == false)
{
Result = m_SpecialRead->CmdExec(k,data,err);
}
if(Result && err.isEmpty()){
if(m_Tbl[i].Type == STRING_TYPE){
Ob.insert("v",data);
}else if(m_Tbl[i].Type == INT_TYPE){
Ob.insert("v",data.toInt());
}else if(m_Tbl[i].Type == FLOAT_TYPE){
Ob.insert("v",data.toDouble());
}
}
break;
}
}
if(!Result)
{
err = "data " + k + " Unsupported or No access";
}
return Result;
}
bool Write(QJsonObject &Ob,QString &err)
{
bool Result = false;
if(!Ob.contains("k") || !Ob.contains("v"))
{
err = "frm format err , have no \"k\" or \"v\";";
return Result;
}
QString k = Ob["k"].toString();
QString data = "";
for(int i = 0;i < sizeof (m_Tbl)/sizeof (KeyToSys_t);i++)
{
if(m_Tbl[i].Key == k )
{
if(m_Tbl[i].Type == STRING_TYPE && Ob.value("v").isString()){
data = Ob.value("v").toString();
}else if(m_Tbl[i].Type == INT_TYPE && Ob.value("v").isDouble()){
data.setNum(Ob.value("v").toInt());
}else if(m_Tbl[i].Type == FLOAT_TYPE && Ob.value("v").isDouble()){
data.setNum(Ob.value("v").toDouble());
}else{
err = "data format err ,type is error;";
break;
}
if(WRITE_ACCESS(m_Tbl[i].Access))
Result = WriteSysData(m_Tbl[i].Index,data);
break;
}
}
if(!Result)
{
Result = m_SpecialCmdExec->CmdExec(k,data,err);
if(Result && err.isEmpty()){
err = "data " + k + " Unsupported or No access";
}
}
return Result;
}
void WriteReset(){ m_SpecialCmdExec->Reset(); }
};
class JsonAnalysis
{
public:
JsonAnalysis();
QByteArray Analysis(JsonProType_t T,QByteArray Data);
private:
QByteArray BBCloudCmdAnalysis(QByteArray Data);
int BBCloudCmdRead(QJsonArray &Data,QString &errMsg);
int BBCloudCmdWrite(QJsonArray Data,QString &errMsg);
void BBCloudResult(QJsonObject &Ob, int cmd, int code = 0, QString Msg = QString(""));
void BBCloudAddDataResult(QJsonObject &Ob,QJsonArray Arr);
int GetCmd(QJsonObject Ob);
bool GetData(QJsonObject Ob,QJsonArray &Arr,QString &err);
JsonKeyToSys m_JsonKeyToSys;
};
#endif // JSONANALYSIS_H
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。