2024-08-26 16:07:11 +08:00

1895 lines
72 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "XParser.h"
#include "HFactory.h"
XParser::XParser()
{
}
XParser::~XParser()
{
}
bool XParser::parseInitExam(const std::string& data, TInitInfo* info)
{
HELP_COST_TIME("");
Json::Value root;
if(!Tools::fromJson(data, root))
{
logerror("error parseInitExam:%s", data.c_str());
return false;
}
Json::Value& object = root;
CHECK_GET_PARAM(object, "kskm", info->kskm);
CHECK_GET_PARAM(object, "kchp", info->kchp);
CHECK_GET_PARAM(object, "kchm", info->kchm);
CHECK_GET_PARAM(object, "kscx", info->kscx);
CHECK_GET_PARAM(object, "cxcode", info->cxcode);
CHECK_GET_PARAM(object, "name", info->name);
CHECK_GET_PARAM(object, "carmodel", info->carmodel);
//CHECK_GET_PARAM(object, "allitems", info->allitems);
//CHECK_GET_PARAM(object, "iteminfo", info->iteminfo);
CHECK_GET_PARAM(object, "mark", info->mark);
CHECK_GET_PARAM(object, "sysset", info->sysset);
if(ExamSubject2 == info->kskm)
{
CHECK_GET_PARAM(object, "allitems", info->allitems);
CHECK_GET_PARAM(object, "iteminfo", info->iteminfo);
}
else if(ExamSubject3 == info->kskm)
{
CHECK_GET_PARAM(object, "systemparm", info->systemparm);
CHECK_GET_PARAM(object, "carinfo", info->carinfo);
CHECK_GET_PARAM(object, "map_point", info->map_point);
CHECK_GET_PARAM(object, "map_point_item", info->map_point_item);
CHECK_GET_PARAM(object, "roads", info->roads);
CHECK_GET_PARAM(object, "sharps", info->sharps);
}
return true;
}
bool XParser::parseBeginExam(const std::string& data, TStuInfo& info)
{
HELP_COST_TIME("");
Json::Value root;
if(!Tools::fromJson(data, root))
{
logerror("error parseBeginExam:%s", data.c_str());
return false;
}
Json::Value& object = root;
CHECK_GET_PARAM(object, "kgid", info.kgid);
CHECK_GET_PARAM(object, "kgxm", info.kgxm);
CHECK_GET_PARAM(object, "exam", info.exam);
CHECK_GET_PARAM(object, "replay", info.replay);
CHECK_GET_PARAM(object, "track", info.track);
CHECK_GET_PARAM(object, "passing", info.passing);
CHECK_GET_PARAM(object, "xm", info.xm);
CHECK_GET_PARAM(object, "sex", info.sex);
CHECK_GET_PARAM(object, "kslsh", info.kslsh);
CHECK_GET_PARAM(object, "sfzmhm", info.sfzmhm);
CHECK_GET_PARAM(object, "ksyy", info.ksyy);
CHECK_GET_PARAM(object, "kkcs", info.kkcs);
CHECK_GET_PARAM(object, "sfyk", info.sfyk);
CHECK_GET_PARAM(object, "ykkkcs", info.ykkkcs);
//CHECK_GET_PARAM(object, "wayno", info.wayno);
CHECK_GET_PARAM(object, "czlx", info.czlx);
CHECK_GET_PARAM(object, "kskssj", info.kskssj);
//CHECK_GET_PARAM(object, "ksxm", info.ksxm);
CHECK_GET_PARAM(object, "ddxk", info.ddxk);
CHECK_GET_PARAM(object, "ddkssj", info.ddkssj);
CHECK_GET_PARAM(object, "ykxm", info.ykxm);
CHECK_GET_PARAM(object, "kfxm", info.kfxm);
CHECK_GET_PARAM(object, "yklc", info.yklc);
//CHECK_GET_PARAM(object, "sczb", info.sczb);
//CHECK_GET_PARAM(object, "sczbkf", info.sczbkf);
//CHECK_GET_PARAM(object, "dmndg", info.dmndg);
//CHECK_GET_PARAM(object, "nitem1", info.nitem1);
//CHECK_GET_PARAM(object, "nitem41", info.nitem41);
//CHECK_GET_PARAM(object, "mfxx", info.mfxx);
//CHECK_GET_PARAM(object, "mfxxn", info.mfxxn);
/*
* 如果是测试什么的可能还没调用初始化,可能拿不到 yhy 2024-05-09
*/
const TInitInfo* infos = FactoryExamService->getInitInfo(); //FactoryExamService->getExamCar()->examSubject();
if(infos && ExamSubject2 == infos->kskm)
{
CHECK_GET_PARAM(object, "ksxm", info.ksxm);
}
else if(infos && ExamSubject3 == infos->kskm)
{
CHECK_GET_PARAM(object, "wayno", info.wayno);
CHECK_GET_PARAM(object, "sczb", info.sczb);
CHECK_GET_PARAM(object, "sczbkf", info.sczbkf);
CHECK_GET_PARAM(object, "dmndg", info.dmndg);
CHECK_GET_PARAM(object, "nitem1", info.nitem1);
CHECK_GET_PARAM(object, "nitem41", info.nitem41);
CHECK_GET_PARAM(object, "mfxx", info.mfxx);
CHECK_GET_PARAM(object, "mfxxn", info.mfxxn);
}
else
{
CHECK_GET_PARAM(object, "ksxm", info.ksxm);
CHECK_GET_PARAM(object, "wayno", info.wayno);
CHECK_GET_PARAM(object, "sczb", info.sczb);
CHECK_GET_PARAM(object, "sczbkf", info.sczbkf);
CHECK_GET_PARAM(object, "dmndg", info.dmndg);
CHECK_GET_PARAM(object, "nitem1", info.nitem1);
CHECK_GET_PARAM(object, "nitem41", info.nitem41);
CHECK_GET_PARAM(object, "mfxx", info.mfxx);
CHECK_GET_PARAM(object, "mfxxn", info.mfxxn);
}
return true;
}
bool XParser::parseRealExam(const std::string& data, TRealExam& info)
{
HELP_COST_TIME("");
Json::Value root;
if(!Tools::fromJson(data, root))
{
logerror("error parseRealExam:%s", data.c_str());
return false;
}
if(!root.isMember("sensor") ||
!root.isMember("gps") ||
!root.isMember("gps2") ||
!root.isMember("vision") ||
!root.isMember("radar") ||
!root.isMember("extend") )
{
return false;
}
//Json::Value& jsonSensor = root["sensor"];
//Json::Value& jsonGps = root["gps"];
//Json::Value& jsonGps2 = root["gps2"];
Json::Value& jsonVision = root["vision"];
Json::Value& jsonRadar = root["radar"];
//Json::Value& jsonExtend = root["extend"];
//TSensorInfo* sensor = &info.sensor;
//TGpsInfo* gps = &info.gps;
//TGpsInfo* gps2 = &info.gps2;
TVisionInfo* vision = &info.vision;
TRadarInfo* radar = &info.radar;
//TExtendInfo* extend = &info.extend;
CHECK_GET_PARAM(root, "sensor", info.sensor);
CHECK_GET_PARAM(root, "gps", info.gps);
const TInitInfo* infos = FactoryExamService->getInitInfo();
if(infos)
{
ExamCarType cartype = name2ExamCarType(infos->kscx.c_str());
if(IS_A2(cartype) || IS_C6(cartype))
{
CHECK_GET_PARAM(root, "gps2", info.gps2);
}
}
else
{
CHECK_GET_PARAM(root, "gps2", info.gps2);
}
CHECK_GET_PARAM(jsonVision, "sj", vision->sj);
CHECK_GET_PARAM(jsonVision, "score", vision->score);
CHECK_GET_PARAM(jsonVision, "zyjd", vision->zyjd);
CHECK_GET_PARAM(jsonVision, "sxjd", vision->sxjd);
CHECK_GET_PARAM(jsonVision, "ytjd", vision->ytjd);
CHECK_GET_PARAM(jsonVision, "fxp", vision->fxp);
CHECK_GET_PARAM(jsonVision, "ch", vision->ch);
CHECK_GET_PARAM(jsonVision, "hld", vision->hld);
CHECK_GET_PARAM(jsonRadar, "sj", radar->sj);
CHECK_GET_PARAM(jsonRadar, "zxh", radar->zxh);
CHECK_GET_PARAM(jsonRadar, "qfsj", radar->qfsj);
CHECK_GET_PARAM(jsonRadar, "hfsj", radar->hfsj);
CHECK_GET_PARAM(jsonRadar, "zqsj", radar->zqsj);
CHECK_GET_PARAM(jsonRadar, "zhsj", radar->zhsj);
CHECK_GET_PARAM(jsonRadar, "zcsj", radar->zcsj);
CHECK_GET_PARAM(jsonRadar, "yqsj", radar->yqsj);
CHECK_GET_PARAM(jsonRadar, "yhsj", radar->yhsj);
CHECK_GET_PARAM(jsonRadar, "ycsj", radar->ycsj);
CHECK_GET_PARAM(jsonRadar, "fqsj", radar->fqsj);
CHECK_GET_PARAM(jsonRadar, "qfwt", radar->qfwt);
CHECK_GET_PARAM(jsonRadar, "rcyz", radar->rcyz);
CHECK_GET_PARAM(jsonRadar, "show", radar->show);
//get(jsonExtend, "extend", extend);
return true;
}
bool XParser::parseJudgeData(const std::string& data, TJudgeData& info)
{
HELP_COST_TIME("");
Json::Value root;
if(!Tools::fromJson(data, root))
{
logerror("error parseJudgeData:%s", data.c_str());
return false;
}
Json::Value& object = root;
CHECK_GET_PARAM(object, "event", info.event);
CHECK_GET_PARAM(object, "sj", info.sj);
CHECK_GET_PARAM(object, "carzt", info.carzt);
CHECK_GET_PARAM(object, "xmks", info.xmks);
CHECK_GET_PARAM(object, "xmjs", info.xmjs);
CHECK_GET_PARAM(object, "kf", info.kf);
CHECK_GET_PARAM(object, "ksjs", info.ksjs);
CHECK_GET_PARAM(object, "xmqx", info.xmqx);
CHECK_GET_PARAM(object, "sound", info.sound);
CHECK_GET_PARAM(object, "mndg", info.mndg);
CHECK_GET_PARAM(object, "lane", info.lane);
//CHECK_GET_PARAM(object, "kszt", info.kszt);
//CHECK_GET_PARAM(object, "dqxm", info.dqxm);
//CHECK_GET_PARAM(object, "scxmks", info.scxmks);
//CHECK_GET_PARAM(object, "bbyy", info.bbyy);
//CHECK_GET_PARAM(object, "ldxx", info.ldxx);
//CHECK_GET_PARAM(object, "lxxx", info.lxxx);
return true;
}
bool XParser::parsePerform(const std::string& data, TPerformData& info)
{
HELP_COST_TIME("");
Json::Value root;
if(!Tools::fromJson(data, root))
{
logerror("error parsePerform:%s", data.c_str());
return false;
}
Json::Value& object = root;
CHECK_GET_PARAM(object, "time", info.time);
CHECK_GET_PARAM(object, "carzt", info.carzt);
CHECK_GET_PARAM(object, "grade", info.grade);
CHECK_GET_PARAM(object, "qjjl", info.qjjl);
CHECK_GET_PARAM(object, "dcjl", info.dcjl);
CHECK_GET_PARAM(object, "dxjl", info.dxjl);
CHECK_GET_PARAM(object, "bxjl", info.bxjl);
CHECK_GET_PARAM(object, "hint", info.hint);
const TInitInfo* infos = FactoryExamService->getInitInfo();
if(infos && ExamSubject2 == infos->kskm)
{
}
else if(infos && ExamSubject3 == infos->kskm)
{
Json::Value& lane = object["lane"];
CHECK_GET_PARAM(lane, "MapRoad_Code_No", info.lane.MapRoad_Code_No); //路段组号
CHECK_GET_PARAM(lane, "MapRoad_Name", info.lane.MapRoad_Name); //路段编码
CHECK_GET_PARAM(lane, "TouchLineType", info.lane.TouchLineType);
CHECK_GET_PARAM(lane, "TouchDir", info.lane.TouchDir);
CHECK_GET_PARAM(lane, "TouchLineTypeCS", info.lane.TouchLineTypeCS); //车身压线类型
//CHECK_GET_PARAM(lane, "xxxx", data.lane.TouchLineType); //车身压线方向
CHECK_GET_PARAM(lane, "BasePointInLaneNo", info.lane.BasePointInLaneNo);
CHECK_GET_PARAM(lane, "BaseLaneCount", info.lane.BaseLaneCount);
CHECK_GET_PARAM(lane, "FrontPointLaneNo", info.lane.FrontPointLaneNo);
CHECK_GET_PARAM(lane, "FrontPointLaneCount", info.lane.FrontPointLaneCount);
//CHECK_GET_PARAM(lane, "xxxxx", info.lane.Body_RB_ToRightEdge); //后点车道:3/4未找到
//CHECK_GET_PARAM(lane, "xxxxx", info.lane.Body_RB_ToRightEdge);
CHECK_GET_PARAM(lane, "Body_LF_ToLeftEdge", info.lane.Body_LF_ToLeftEdge);
CHECK_GET_PARAM(lane, "Body_LB_ToLeftEdge", info.lane.Body_LB_ToLeftEdge);
CHECK_GET_PARAM(lane, "Body_RF_ToRightEdge", info.lane.Body_RF_ToRightEdge);
CHECK_GET_PARAM(lane, "Body_RB_ToRightEdge", info.lane.Body_RB_ToRightEdge);
//CHECK_GET_PARAM(lane, "xxxxx", data.lane.Body_RB_ToRightEdge); //右前/后车身边线:560/553未找到指车身离右侧路边缘线距离
//CHECK_GET_PARAM(lane, "xxxxx", data.lane.Body_RB_ToRightEdge);
CHECK_GET_PARAM(lane, "Wheel_RF_ToRightEdge", info.lane.Wheel_RF_ToRightEdge);
CHECK_GET_PARAM(lane, "Wheel_RB_ToRightEdge", info.lane.Wheel_RB_ToRightEdge);
CHECK_GET_PARAM(lane, "Wheel_RF_ToBaseLine", info.lane.Wheel_RF_ToBaseLine);
CHECK_GET_PARAM(lane, "Wheel_RB_ToBaseLine", info.lane.Wheel_RB_ToBaseLine);
CHECK_GET_PARAM(lane, "Wheel_LF_ToRightEdge", info.lane.Wheel_LF_ToRightEdge);
CHECK_GET_PARAM(lane, "Wheel_LB_ToRightEdge", info.lane.Wheel_LB_ToRightEdge);
CHECK_GET_PARAM(lane, "Wheel_LF_ToBaseLine", info.lane.Wheel_LF_ToBaseLine);
CHECK_GET_PARAM(lane, "Wheel_LB_ToBaseLine", info.lane.Wheel_LB_ToBaseLine);
CHECK_GET_PARAM(lane, "BasePointInLaneDir", info.lane.BasePointInLaneDir);
CHECK_GET_PARAM(lane, "CrossLineAttr", info.lane.CrossLineAttr);
//CHECK_GET_PARAM(lane, "xxxxx", info.lane.Body_RB_ToRightEdge); //是否逆向行驶
CHECK_GET_PARAM(lane, "InShapeAttr", info.lane.InShapeAttr);
CHECK_GET_PARAM(lane, "ShapeNo", info.lane.ShapeNo); //车身相交的形状线号
//CHECK_GET_PARAM(lane, "xxxxx", info.lane.Body_RB_ToRightEdge); //车轮相交的形状线号
CHECK_GET_PARAM(lane, "CrossPointNo", info.lane.CrossPointNo);
//20240730 增加 yhy
CHECK_GET_PARAM(lane, "TouchLineDirCS", info.lane.TouchLineDirCS);
CHECK_GET_PARAM(lane, "BackPointLaneNo", info.lane.BackPointLaneNo);
CHECK_GET_PARAM(lane, "BackPointLaneCount", info.lane.BackPointLaneCount);
CHECK_GET_PARAM(lane, "Body_RF_ToBaseLine", info.lane.Body_RF_ToBaseLine);
CHECK_GET_PARAM(lane, "Body_RB_ToBaseLine", info.lane.Body_RB_ToBaseLine);
CHECK_GET_PARAM(lane, "DirInverse", info.lane.DirInverse);
CHECK_GET_PARAM(lane, "ShapeNoWheel", info.lane.ShapeNoWheel);
}
return true;
}
std::string XParser::toDataString(const TPerformData& data)
{
HELP_COST_TIME("");
Json::Value root;
set(root, "time", data.time);
set(root, "carzt", data.carzt);
set(root, "grade", data.grade);
set(root, "qjjl", data.qjjl);
set(root, "dcjl", data.dcjl);
set(root, "dxjl", data.dxjl);
set(root, "bxjl", data.bxjl);
set(root, "hint", data.hint);
/*
路段组号:21对应MapRoad_Code_No是个整数
路段编码:0-0对应MapRoad_Name带符号-
车轮压线:0/0TouchLineType/TouchDir
车身碰线:0/0TouchLineTypeCS/与压线类似)
基准车道:3/4BasePointInLaneNo/BaseLaneCount此点建议从定位天线点调整为车身中心点
前点车道:3/4FrontPointLaneNo/FrontPointLaneCount
后点车道:3/4未找到
左前/后车身距离:33/39Body_LF_ToLeftEdge/Body_LB_ToLeftEdge
右前/后车身距离:69/63Body_RF_ToRightEdge/Body_RB_ToRightEdge
右前/后车身边线:560/553未找到指车身离右侧路边缘线距离
右前/后轮距离:73/65Wheel_RF_ToRightEdge/Wheel_RB_ToRightEdge
右前/后轮边线:564/555Wheel_RF_ToBaseLine/Wheel_RB_ToBaseLine
左前/后轮距离:237/232Wheel_LF_ToRightEdge/Wheel_LB_ToRightEdge
左前/后轮边线:728/722Wheel_LF_ToBaseLine/Wheel_LB_ToBaseLine
车道属性:0/0/1BasePointInLaneDir/CrossLineAttr/是否逆向行驶)
形状:0/0/0InShapeAttr/车身相交的形状线号/车轮相交的形状线号)
路段点:0车头穿越的测绘点如项目点路段点
*/
const TInitInfo* infos = FactoryExamService->getInitInfo(); //FactoryExamService->getExamCar()->examSubject();
if(infos && ExamSubject2 == infos->kskm)
{
}
else if(infos && ExamSubject3 == infos->kskm)
{
Json::Value lane;
set(lane, "MapRoad_Code_No", data.lane.MapRoad_Code_No); //路段组号
set(lane, "MapRoad_Name", data.lane.MapRoad_Name); //路段编码
set(lane, "TouchLineType", data.lane.TouchLineType);
set(lane, "TouchDir", data.lane.TouchDir);
set(lane, "TouchLineTypeCS", data.lane.TouchLineTypeCS); //车身压线类型
//set(lane, "xxxx", data.lane.TouchLineType); //车身压线方向
set(lane, "BasePointInLaneNo", data.lane.BasePointInLaneNo);
set(lane, "BaseLaneCount", data.lane.BaseLaneCount);
set(lane, "FrontPointLaneNo", data.lane.FrontPointLaneNo);
set(lane, "FrontPointLaneCount", data.lane.FrontPointLaneCount);
//set(lane, "xxxxx", data.lane.Body_RB_ToRightEdge); //后点车道:3/4未找到
//set(lane, "xxxxx", data.lane.Body_RB_ToRightEdge);
set(lane, "Body_LF_ToLeftEdge", data.lane.Body_LF_ToLeftEdge);
set(lane, "Body_LB_ToLeftEdge", data.lane.Body_LB_ToLeftEdge);
set(lane, "Body_RF_ToRightEdge", data.lane.Body_RF_ToRightEdge);
set(lane, "Body_RB_ToRightEdge", data.lane.Body_RB_ToRightEdge);
//set(lane, "xxxxx", data.lane.Body_RB_ToRightEdge); //右前/后车身边线:560/553未找到指车身离右侧路边缘线距离
//set(lane, "xxxxx", data.lane.Body_RB_ToRightEdge);
set(lane, "Wheel_RF_ToRightEdge", data.lane.Wheel_RF_ToRightEdge);
set(lane, "Wheel_RB_ToRightEdge", data.lane.Wheel_RB_ToRightEdge);
set(lane, "Wheel_RF_ToBaseLine", data.lane.Wheel_RF_ToBaseLine);
set(lane, "Wheel_RB_ToBaseLine", data.lane.Wheel_RB_ToBaseLine);
set(lane, "Wheel_LF_ToRightEdge", data.lane.Wheel_LF_ToRightEdge);
set(lane, "Wheel_LB_ToRightEdge", data.lane.Wheel_LB_ToRightEdge);
set(lane, "Wheel_LF_ToBaseLine", data.lane.Wheel_LF_ToBaseLine);
set(lane, "Wheel_LB_ToBaseLine", data.lane.Wheel_LB_ToBaseLine);
set(lane, "BasePointInLaneDir", data.lane.BasePointInLaneDir);
set(lane, "CrossLineAttr", data.lane.CrossLineAttr);
//set(lane, "xxxxx", data.lane.Body_RB_ToRightEdge); //是否逆向行驶
set(lane, "InShapeAttr", data.lane.InShapeAttr);
set(lane, "ShapeNo", data.lane.ShapeNo); //车身相交的形状线号
//set(lane, "xxxxx", data.lane.Body_RB_ToRightEdge); //车轮相交的形状线号
set(lane, "CrossPointNo", data.lane.CrossPointNo);
//20240730 增加 yhy
set(lane, "TouchLineDirCS", data.lane.TouchLineDirCS);
set(lane, "BackPointLaneNo", data.lane.BackPointLaneNo);
set(lane, "BackPointLaneCount", data.lane.BackPointLaneCount);
set(lane, "Body_RF_ToBaseLine", data.lane.Body_RF_ToBaseLine);
set(lane, "Body_RB_ToBaseLine", data.lane.Body_RB_ToBaseLine);
set(lane, "DirInverse", data.lane.DirInverse);
set(lane, "ShapeNoWheel", data.lane.ShapeNoWheel);
root["lane"] = lane;
}
return Tools::toJson(root);
}
std::string XParser::toDataString(const TJudgeData& data)
{
HELP_COST_TIME("");
Json::Value root;
set(root, "event", data.event);
set(root, "sj", data.sj);
set(root, "carzt", data.carzt);
set(root, "xmks", data.xmks);
set(root, "xmjs", data.xmjs);
set(root, "kf", data.kf);
set(root, "ksjs", data.ksjs);
set(root, "xmqx", data.xmqx);
set(root, "sound", data.sound);
set(root, "mndg", data.mndg);
set(root, "lane", data.lane);
//set(root, "kszt", data.kszt);
//set(root, "dqxm", data.dqxm);
//set(root, "scxmks", data.scxmks);
//set(root, "bbyy", data.bbyy);
//set(root, "ldxx", data.ldxx);
//set(root, "lxxx", data.lxxx);
return Tools::toJson(root);
}
std::string XParser::toDataString(const TInitInfo& data)
{
HELP_COST_TIME("");
Json::Value root;
set(root, "kskm", data.kskm);
set(root, "kchp", data.kchp);
set(root, "kchm", data.kchm);
set(root, "kscx", data.kscx);
set(root, "cxcode", data.cxcode);
set(root, "name", data.name);
set(root, "carmodel", data.carmodel);
set(root, "allitems", data.allitems);
set(root, "mark", data.mark);
set(root, "sysset", data.sysset);
set(root, "systemparm", data.systemparm);
set(root, "carinfo", data.carinfo);
set(root, "map_point", data.map_point);
set(root, "map_point_item", data.map_point_item);
set(root, "roads", data.roads);
set(root, "sharps", data.sharps);
return Tools::toJson(root);
}
std::string XParser::toDataString(const TStuInfo& data)
{
HELP_COST_TIME("");
Json::Value root;
set(root, "kgid", data.kgid);
set(root, "kgxm", data.kgxm);
set(root, "exam", data.exam);
set(root, "replay", data.replay);
set(root, "track", data.track);
set(root, "passing", data.passing);
set(root, "xm", data.xm);
set(root, "sex", data.sex);
set(root, "kslsh", data.kslsh);
set(root, "sfzmhm", data.sfzmhm);
set(root, "ksyy", data.ksyy);
set(root, "kkcs", data.kkcs);
set(root, "sfyk", data.sfyk);
set(root, "ykkkcs", data.ykkkcs);
set(root, "wayno", data.wayno);
set(root, "czlx", data.czlx);
set(root, "kskssj", data.kskssj);
set(root, "ksxm", data.ksxm);
set(root, "ddxk", data.ddxk);
set(root, "ddkssj", data.ddkssj);
set(root, "ykxm", data.ykxm);
set(root, "kfxm", data.kfxm);
set(root, "yklc", data.yklc);
set(root, "sczb", data.sczb);
set(root, "sczbkf", data.sczbkf);
set(root, "dmndg", data.dmndg);
set(root, "nitem1", data.nitem1);
set(root, "nitem41", data.nitem41);
set(root, "mfxx", data.mfxx);
set(root, "mfxxn", data.mfxxn);
return Tools::toJson(root);
}
std::string XParser::toDataString(const TRealExam& data)
{
HELP_COST_TIME("");
Json::Value root;
Json::Value jsonSensor;
Json::Value jsonGps;
Json::Value jsonGps2;
Json::Value jsonVision;
Json::Value jsonRadar;
Json::Value jsonExtend;
const TSensorInfo* sensor = &data.sensor;
const TGpsInfo* gps = &data.gps;
const TGpsInfo* gps2 = &data.gps2;
const TVisionInfo* vision = &data.vision;
const TRadarInfo* radar = &data.radar;
const TExtendInfo* extend = &data.extend;
set(root, "sensor", data.sensor);
set(root, "gps", data.gps);
set(root, "gps2", data.gps2);
set(jsonVision, "sj", vision->sj);
set(jsonVision, "score", vision->score);
set(jsonVision, "zyjd", vision->zyjd);
set(jsonVision, "sxjd", vision->sxjd);
set(jsonVision, "ytjd", vision->ytjd);
set(jsonVision, "fxp", vision->fxp);
set(jsonVision, "ch", vision->ch);
set(jsonVision, "hld", vision->hld);
set(jsonRadar, "sj", radar->sj);
set(jsonRadar, "zxh", radar->zxh);
set(jsonRadar, "qfsj", radar->qfsj);
set(jsonRadar, "hfsj", radar->hfsj);
set(jsonRadar, "zqsj", radar->zqsj);
set(jsonRadar, "zhsj", radar->zhsj);
set(jsonRadar, "zcsj", radar->zcsj);
set(jsonRadar, "yqsj", radar->yqsj);
set(jsonRadar, "yhsj", radar->yhsj);
set(jsonRadar, "ycsj", radar->ycsj);
set(jsonRadar, "fqsj", radar->fqsj);
set(jsonRadar, "qfwt", radar->qfwt);
set(jsonRadar, "rcyz", radar->rcyz);
set(jsonRadar, "show", radar->show);
//root["sensor"] = jsonSensor;
//root["gps"] = jsonGps;
//root["gps2"] = jsonGps2;
root["vision"] = jsonVision;
root["radar"] = jsonRadar;
root["extend"] = jsonExtend;
return Tools::toJson(root);
}
bool XParser::get(Json::Value& object, const char* key, bool& store, bool defaults) noexcept
{
CHECK_GET_BASIC({ if(v.isBool()) { store = v.asBool(); return true; } });
return false;
}
bool XParser::get(Json::Value& object, const char* key, int8& store, int8 defaults) noexcept
{
CHECK_GET_BASIC({ if(v.isInt()) { store = v.asInt(); return true; } });
return false;
}
bool XParser::get(Json::Value& object, const char* key, int16& store, int16 defaults) noexcept
{
CHECK_GET_BASIC({ if(v.isInt()) { store = v.asInt(); return true; } });
return false;
}
bool XParser::get(Json::Value& object, const char* key, int32& store, int32 defaults) noexcept
{
CHECK_GET_BASIC({ if(v.isInt()) { store = v.asInt(); return true; } });
return false;
}
bool XParser::get(Json::Value& object, const char* key, int64& store, int64 defaults) noexcept
{
CHECK_GET_BASIC({ if(v.isInt64()) { store = v.asInt64(); return true; } });
return false;
}
bool XParser::get(Json::Value& object, const char* key, double& store, double defaults) noexcept
{
CHECK_GET_BASIC({ if(v.isDouble()) { store = v.asDouble(); return true; } });
return false;
}
bool XParser::get(Json::Value& object, const char* key, std::string& store, const std::string& defaults) noexcept
{
CHECK_GET_BASIC({ if(v.isString()) { store = v.asString(); return true;} });
return false;
}
bool XParser::get(Json::Value& object, const char* key, std::vector<int8>& store, const std::vector<int8>& defaults) noexcept
{
CHECK_GET_ARRAY({ if(v.isInt()) { store.emplace_back(v.asInt());} });
return true;
}
bool XParser::get(Json::Value& object, const char* key, std::vector<int16>& store, const std::vector<int16>& defaults) noexcept
{
CHECK_GET_ARRAY({ if(v.isInt()) { store.emplace_back(v.asInt());} });
return true;
}
bool XParser::get(Json::Value& object, const char* key, std::vector<int32>& store, const std::vector<int32>& defaults) noexcept
{
CHECK_GET_ARRAY({ if(v.isInt()) { store.emplace_back(v.asInt());} });
return true;
}
bool XParser::get(Json::Value& object, const char* key, std::vector<int64>& store, const std::vector<int64>& defaults) noexcept
{
CHECK_GET_ARRAY({ if(v.isInt64()) { store.emplace_back(v.asInt64());} });
return true;
}
bool XParser::get(Json::Value& object, const char* key, std::vector<double>& store, const std::vector<double>& defaults) noexcept
{
CHECK_GET_ARRAY({ if(v.isDouble()) { store.emplace_back(v.asDouble());} });
return true;
}
bool XParser::get(Json::Value& object, const char* key, std::vector<std::string>& store, const std::vector<std::string>& defaults) noexcept
{
CHECK_GET_ARRAY({ if(v.isString()) { store.emplace_back(v.asString());} });
return true;
}
bool XParser::get(Json::Value& object, const char* key, TKfXm& store, const TKfXm& defaults) noexcept
{
CHECK_GET_OBJECT({
CHECK_GET_PARAM(value, "xmdm", store.xmdm);
CHECK_GET_PARAM(value, "kfdm", store.kfdm);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, TEventItemMark& store, const TEventItemMark& defaults) noexcept
{
CHECK_GET_OBJECT({
CHECK_GET_PARAM(value, "xmdm", store.xmdm);
CHECK_GET_PARAM(value, "kfdm", store.kfdm);
CHECK_GET_PARAM(value, "markcatalog", store.markcatalog);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, TEventExamFinish& store, const TEventExamFinish& defaults) noexcept
{
CHECK_GET_OBJECT({
CHECK_GET_PARAM(value, "type", store.type);
CHECK_GET_PARAM(value, "qjjl", store.qjjl);
CHECK_GET_PARAM(value, "dcjl", store.dcjl);
CHECK_GET_PARAM(value, "d1", store.d1);
CHECK_GET_PARAM(value, "d2", store.d2);
CHECK_GET_PARAM(value, "d3", store.d3);
CHECK_GET_PARAM(value, "d4", store.d4);
CHECK_GET_PARAM(value, "d5", store.d5);
CHECK_GET_PARAM(value, "d6", store.d6);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, std::vector<TKfXm>& store, const std::vector<TKfXm>& defaults) noexcept
{
CHECK_GET_ARRAY({
TKfXm t;
CHECK_GET_PARAM(v, "xmdm", t.xmdm);
CHECK_GET_PARAM(v, "kfdm", t.kfdm);
store.emplace_back(t);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, std::vector<TRadarWay>& store, const std::vector<TRadarWay>& defaults) noexcept
{
CHECK_GET_ARRAY({
TRadarWay t;
CHECK_GET_PARAM(v, "bh", t.bh);
CHECK_GET_PARAM(v, "lx", t.lx);
CHECK_GET_PARAM(v, "jl", t.jl);
CHECK_GET_PARAM(v, "sd", t.sd);
store.emplace_back(t);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, std::vector<TRadarShow>& store, const std::vector<TRadarShow>& defaults) noexcept
{
CHECK_GET_ARRAY({
TRadarShow t;
CHECK_GET_PARAM(v, "bh", t.bh);
CHECK_GET_PARAM(v, "zb", t.zb);
store.emplace_back(t);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, std::vector<Pointi>& store, const std::vector<Pointi>& defaults) noexcept
{
CHECK_GET_ARRAY({
Pointi t;
CHECK_GET_PARAM(v, "x", t.x);
CHECK_GET_PARAM(v, "y", t.y);
store.emplace_back(t);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, TRadarFront& store, const TRadarFront& defaults) noexcept
{
CHECK_GET_OBJECT({
CHECK_GET_PARAM(value, "xrjl", store.xrjl);
CHECK_GET_PARAM(value, "zawjl", store.zawjl);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, TGpsInfo& store, const TGpsInfo& defaults) noexcept
{
CHECK_GET_OBJECT({
CHECK_GET_PARAM(value, "bklx", store.bklx);
CHECK_GET_PARAM(value, "dwzt", store.dwzt);
CHECK_GET_PARAM(value, "jdzt", store.jdzt);
CHECK_GET_PARAM(value, "sj", store.sj);
CHECK_GET_PARAM(value, "jd", store.jd);
CHECK_GET_PARAM(value, "wd", store.wd);
CHECK_GET_PARAM(value, "hxj", store.hxj);
CHECK_GET_PARAM(value, "fyj", store.fyj);
CHECK_GET_PARAM(value, "hbg", store.hbg);
CHECK_GET_PARAM(value, "gdc", store.gdc);
CHECK_GET_PARAM(value, "sd", store.sd);
CHECK_GET_PARAM(value, "age", store.age);
CHECK_GET_PARAM(value, "jdyz", store.jdyz);
CHECK_GET_PARAM(value, "wdyz", store.wdyz);
CHECK_GET_PARAM(value, "dwsxs", store.dwsxs);
CHECK_GET_PARAM(value, "jdsxs", store.jdsxs);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, TSensorInfo& store, const TSensorInfo& defaults) noexcept
{
store = defaults;
CHECK_GET_OBJECT_V2({
CHECK_GET_PARAM(value, "aqd", store.aqd);
CHECK_GET_PARAM(value, "mkg", store.mkg);
CHECK_GET_PARAM(value, "ssc", store.ssc);
CHECK_GET_PARAM(value, "jsc", store.jsc);
CHECK_GET_PARAM(value, "fsc", store.fsc);
CHECK_GET_PARAM(value, "lhq", store.lhq);
CHECK_GET_PARAM(value, "lb", store.lb);
CHECK_GET_PARAM(value, "skd", store.skd);
CHECK_GET_PARAM(value, "jgd", store.jgd);
CHECK_GET_PARAM(value, "ygd", store.ygd);
CHECK_GET_PARAM(value, "zfxd", store.zfxd);
CHECK_GET_PARAM(value, "yfxd", store.yfxd);
CHECK_GET_PARAM(value, "shtd", store.shtd);
CHECK_GET_PARAM(value, "wd", store.wd);
CHECK_GET_PARAM(value, "ygq", store.ygq);
});
CHECK_GET_OBJECT_V2({
CHECK_GET_PARAM(value, "dh1", store.dh1);
CHECK_GET_PARAM(value, "dh2", store.dh2);
CHECK_GET_PARAM(value, "fdjzs", store.fdjzs);
CHECK_GET_PARAM(value, "dw", store.dw);
CHECK_GET_PARAM(value, "cs", store.cs);
CHECK_GET_PARAM(value, "fxp", store.fxp);
CHECK_GET_PARAM(value, "ljmc", store.ljmc);
CHECK_GET_PARAM(value, "lcmc", store.lcmc);
CHECK_GET_PARAM(value, "csbzq", store.csbzq);
CHECK_GET_PARAM(value, "csbzh", store.csbzh);
CHECK_GET_PARAM(value, "csbyq", store.csbyq);
CHECK_GET_PARAM(value, "csbyh", store.csbyh);
CHECK_GET_PARAM(value, "zy", store.zy);
});
CHECK_GET_OBJECT_V2({
CHECK_GET_PARAM(value, "tbp", store.tbp);
CHECK_GET_PARAM(value, "hsj", store.hsj);
CHECK_GET_PARAM(value, "dcj", store.dcj);
CHECK_GET_PARAM(value, "gx", store.gx);
CHECK_GET_PARAM(value, "yl", store.yl);
CHECK_GET_PARAM(value, "yy", store.yy);
CHECK_GET_PARAM(value, "rmndg", store.rmndg);
CHECK_GET_PARAM(value, "mndg", store.mndg); //20240405
CHECK_GET_PARAM(value, "sde", store.sde); //20240405
CHECK_GET_PARAM(value, "xhd", store.xhd);
//get(value, "mitemno", store.mitemno);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, TItemExam& store, const TItemExam& defaults) noexcept
{
CHECK_GET_OBJECT({
CHECK_GET_PARAM(value, "xmdm", store.xmdm);
CHECK_GET_PARAM(value, "xmxh", store.xmxh);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, std::vector<TItemExam>& store, const std::vector<TItemExam>& defaults) noexcept
{
CHECK_GET_ARRAY({
TItemExam t;
CHECK_GET_PARAM(v, "xmdm", t.xmdm);
CHECK_GET_PARAM(v, "xmxh", t.xmxh);
store.emplace_back(t);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, std::vector<TItemArg>& store, const std::vector<TItemArg>& defaults) noexcept
{
CHECK_GET_ARRAY({
TItemArg t;
CHECK_GET_PARAM(v, "xmdm", t.xmdm);
CHECK_GET_PARAM(v, "xmxh", t.xmxh);
CHECK_GET_PARAM(v, "model", t.model);
store.emplace_back(t);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, std::vector<TMarkRule>& store, const std::vector<TMarkRule>& defaults) noexcept
{
CHECK_GET_ARRAY({
TMarkRule t;
CHECK_GET_PARAM(v, "itemno", t.itemno);
//CHECK_GET_PARAM(v, "itemname", t.itemname);
CHECK_GET_PARAM(v, "markserial", t.markserial);
CHECK_GET_PARAM(v, "markreal", t.markreal);
CHECK_GET_PARAM(v, "markcatalog", t.markcatalog);
CHECK_GET_PARAM(v, "markshow", t.markshow);
CHECK_GET_PARAM(v, "OnlyOneKind", t.OnlyOneKind);
CHECK_GET_PARAM(v, "NoCancelId", t.NoCancelId);
CHECK_GET_PARAM(v, "GPS_SID", t.GPS_SID);
store.emplace_back(t);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, std::vector<TSysset>& store, const std::vector<TSysset>& defaults) noexcept
{
CHECK_GET_ARRAY({
TSysset t;
CHECK_GET_PARAM(v, "key", t.key);
CHECK_GET_PARAM(v, "value", t.value);
CHECK_GET_PARAM(v, "name", t.name);
store.emplace_back(t);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, TExamXm& store, const TExamXm& defaults) noexcept
{
CHECK_GET_OBJECT({
CHECK_GET_PARAM(value, "xmdm", store.xmdm);
CHECK_GET_PARAM(value, "xmxh", store.xmxh);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, TEventFinishItem& store, const TEventFinishItem& defaults) noexcept
{
CHECK_GET_OBJECT({
CHECK_GET_PARAM(value, "xmdm", store.xmdm);
CHECK_GET_PARAM(value, "xmxh", store.xmxh);
CHECK_GET_PARAM(value, "xmhg", store.xmhg);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, TEventSound& store, const TEventSound& defaults) noexcept
{
CHECK_GET_OBJECT({
CHECK_GET_PARAM(value, "xmdm", store.xmdm);
CHECK_GET_PARAM(value, "code", store.code);
CHECK_GET_PARAM(value, "type", store.type);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, TEventLane& store, const TEventLane& defaults) noexcept
{
CHECK_GET_OBJECT({
CHECK_GET_PARAM(value, "road", store.road);
CHECK_GET_PARAM(value, "num", store.num);
CHECK_GET_PARAM(value, "count", store.count);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, TExamWay& store, const TExamWay& defaults) noexcept
{
store = defaults;
CHECK_GET_OBJECT_V2({
CHECK_GET_PARAM(value, "ldh", store.ldh);
CHECK_GET_PARAM(value, "jzcds", store.jzcds);
CHECK_GET_PARAM(value, "jzcd", store.jzcd);
CHECK_GET_PARAM(value, "qdcds", store.qdcds);
CHECK_GET_PARAM(value, "qdcd", store.qdcd);
CHECK_GET_PARAM(value, "clyx", store.clyx);
CHECK_GET_PARAM(value, "lbx", store.lbx);
CHECK_GET_PARAM(value, "cdbx", store.cdbx);
CHECK_GET_PARAM(value, "cdzbx", store.cdzbx);
CHECK_GET_PARAM(value, "zql", store.zql);
CHECK_GET_PARAM(value, "yql", store.yql);
CHECK_GET_PARAM(value, "zhl", store.zhl);
CHECK_GET_PARAM(value, "yhl", store.yhl);
});
CHECK_GET_OBJECT_V2({
CHECK_GET_PARAM(value, "cdsx", store.cdsx);
CHECK_GET_PARAM(value, "xzx", store.xzx);
CHECK_GET_PARAM(value, "cyx", store.cyx);
CHECK_GET_PARAM(value, "xzn", store.xzn);
CHECK_GET_PARAM(value, "yxfx", store.yxfx);
CHECK_GET_PARAM(value, "fjdc", store.fjdc);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, TDBCarInfo& store, const TDBCarInfo& defaults) noexcept
{
CHECK_GET_OBJECT({
CHECK_GET_PARAM(value, "CARID", store.CARID);
CHECK_GET_PARAM(value, "IPADDR", store.IPADDR);
CHECK_GET_PARAM(value, "CARCLASS", store.CARCLASS);
CHECK_GET_PARAM(value, "KSCX", store.KSCX);
CHECK_GET_PARAM(value, "CARNAME", store.CARNAME);
CHECK_GET_PARAM(value, "FLAG", store.FLAG);
CHECK_GET_PARAM(value, "BK1", store.BK1);
CHECK_GET_PARAM(value, "BK2", store.BK2);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, std::vector<TDBCarInfo>& store, const std::vector<TDBCarInfo>& defaults) noexcept
{
CHECK_GET_ARRAY({
TDBCarInfo t;
CHECK_GET_PARAM(v, "CARID", t.CARID);
CHECK_GET_PARAM(v, "IPADDR", t.IPADDR);
CHECK_GET_PARAM(v, "CARCLASS", t.CARCLASS);
CHECK_GET_PARAM(v, "KSCX", t.KSCX);
CHECK_GET_PARAM(v, "CARNAME", t.CARNAME);
CHECK_GET_PARAM(v, "FLAG", t.FLAG);
CHECK_GET_PARAM(v, "BK1", t.BK1);
CHECK_GET_PARAM(v, "BK2", t.BK2);
store.emplace_back(t);
});
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const TDBCarInfo& store) noexcept
{
Json::Value value;
set(value, "CARID", store.CARID);
set(value, "IPADDR", store.IPADDR);
set(value, "CARCLASS", store.CARCLASS);
set(value, "KSCX", store.KSCX);
set(value, "CARNAME", store.CARNAME);
set(value, "FLAG", store.FLAG);
set(value, "BK1", store.BK1);
set(value, "BK2", store.BK2);
object[key] = value;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const std::vector<TDBCarInfo>& store) noexcept
{
Json::Value array(Json::arrayValue);
for(size_t i = 0; i < store.size(); i++)
{
const TDBCarInfo& s = store[i];
Json::Value value;
set(value, "CARID", s.CARID);
set(value, "IPADDR", s.IPADDR);
set(value, "CARCLASS", s.CARCLASS);
set(value, "KSCX", s.KSCX);
set(value, "CARNAME", s.CARNAME);
set(value, "FLAG", s.FLAG);
set(value, "BK1", s.BK1);
set(value, "BK2", s.BK2);
array.append(value);
}
object[key] = array;
return true;
}
bool XParser::get(Json::Value& object, const char* key, TDBItemInfo& store, const TDBItemInfo& defaults) noexcept
{
CHECK_GET_OBJECT({
CHECK_GET_PARAM(value, "itemsno", store.itemsno);
CHECK_GET_PARAM(value, "carlist", store.carlist);
CHECK_GET_PARAM(value, "freqinfo", store.freqinfo);
CHECK_GET_PARAM(value, "end_cardsno", store.end_cardsno);
CHECK_GET_PARAM(value, "cininfo", store.cininfo);
CHECK_GET_PARAM(value, "nextinfo", store.nextinfo);
CHECK_GET_PARAM(value, "setup1", store.setup1);
CHECK_GET_PARAM(value, "setup2", store.setup2);
CHECK_GET_PARAM(value, "setup3", store.setup3);
CHECK_GET_PARAM(value, "setup4", store.setup4);
CHECK_GET_PARAM(value, "setup5", store.setup5);
CHECK_GET_PARAM(value, "setup6", store.setup6);
CHECK_GET_PARAM(value, "setup7", store.setup7);
CHECK_GET_PARAM(value, "setup8", store.setup8);
CHECK_GET_PARAM(value, "setup9", store.setup9);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, std::vector<TDBItemInfo>& store, const std::vector<TDBItemInfo>& defaults) noexcept
{
CHECK_GET_ARRAY({
TDBItemInfo t;
CHECK_GET_PARAM(v, "itemsno", t.itemsno);
CHECK_GET_PARAM(v, "carlist", t.carlist);
CHECK_GET_PARAM(v, "freqinfo", t.freqinfo);
CHECK_GET_PARAM(v, "end_cardsno", t.end_cardsno);
CHECK_GET_PARAM(v, "cininfo", t.cininfo);
CHECK_GET_PARAM(v, "nextinfo", t.nextinfo);
CHECK_GET_PARAM(v, "setup1", t.setup1);
CHECK_GET_PARAM(v, "setup2", t.setup2);
CHECK_GET_PARAM(v, "setup3", t.setup3);
CHECK_GET_PARAM(v, "setup4", t.setup4);
CHECK_GET_PARAM(v, "setup5", t.setup5);
CHECK_GET_PARAM(v, "setup6", t.setup6);
CHECK_GET_PARAM(v, "setup7", t.setup7);
CHECK_GET_PARAM(v, "setup8", t.setup8);
CHECK_GET_PARAM(v, "setup9", t.setup9);
store.emplace_back(t);
});
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const TDBItemInfo& store) noexcept
{
Json::Value value;
set(value, "itemsno", store.itemsno);
set(value, "carlist", store.carlist);
set(value, "freqinfo", store.freqinfo);
set(value, "end_cardsno", store.end_cardsno);
set(value, "cininfo", store.cininfo);
set(value, "nextinfo", store.nextinfo);
set(value, "setup1", store.setup1);
set(value, "setup2", store.setup2);
set(value, "setup3", store.setup3);
set(value, "setup4", store.setup4);
set(value, "setup5", store.setup5);
set(value, "setup6", store.setup6);
set(value, "setup7", store.setup7);
set(value, "setup8", store.setup8);
set(value, "setup9", store.setup9);
object[key] = value;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const std::vector<TDBItemInfo>& store) noexcept
{
Json::Value array(Json::arrayValue);
for(size_t i = 0; i < store.size(); i++)
{
const TDBItemInfo& s = store[i];
Json::Value value;
set(value, "itemsno", s.itemsno);
set(value, "carlist", s.carlist);
set(value, "freqinfo", s.freqinfo);
set(value, "end_cardsno", s.end_cardsno);
set(value, "cininfo", s.cininfo);
set(value, "nextinfo", s.nextinfo);
set(value, "setup1", s.setup1);
set(value, "setup2", s.setup2);
set(value, "setup3", s.setup3);
set(value, "setup4", s.setup4);
set(value, "setup5", s.setup5);
set(value, "setup6", s.setup6);
set(value, "setup7", s.setup7);
set(value, "setup8", s.setup8);
set(value, "setup9", s.setup9);
array.append(value);
}
object[key] = array;
return true;
}
bool XParser::get(Json::Value& object, const char* key, TSystemparm& store, const TSystemparm& defaults) noexcept
{
CHECK_GET_OBJECT({
CHECK_GET_PARAM(value, "NO1", store.NO1);
CHECK_GET_PARAM(value, "NO2", store.NO2);
CHECK_GET_PARAM(value, "NO3", store.NO3);
CHECK_GET_PARAM(value, "TXT1", store.TXT1);
CHECK_GET_PARAM(value, "TXT2", store.TXT2);
CHECK_GET_PARAM(value, "TXT3", store.TXT3);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, std::vector<TSystemparm>& store, const std::vector<TSystemparm>& defaults) noexcept
{
CHECK_GET_ARRAY({
TSystemparm t;
CHECK_GET_PARAM(v, "NO1", t.NO1);
CHECK_GET_PARAM(v, "NO2", t.NO2);
CHECK_GET_PARAM(v, "NO3", t.NO3);
CHECK_GET_PARAM(v, "TXT1", t.TXT1);
CHECK_GET_PARAM(v, "TXT2", t.TXT2);
CHECK_GET_PARAM(v, "TXT3", t.TXT3);
store.emplace_back(t);
});
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const TSystemparm& store) noexcept
{
Json::Value value;
set(value, "NO1", store.NO1);
set(value, "NO2", store.NO2);
set(value, "NO3", store.NO3);
set(value, "TXT1", store.TXT1);
set(value, "TXT2", store.TXT2);
set(value, "TXT3", store.TXT3);
object[key] = value;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const std::vector<TSystemparm>& store) noexcept
{
Json::Value array(Json::arrayValue);
for(size_t i = 0; i < store.size(); i++)
{
const TSystemparm& s = store[i];
Json::Value value;
set(value, "NO1", s.NO1);
set(value, "NO2", s.NO2);
set(value, "NO3", s.NO3);
set(value, "TXT1", s.TXT1);
set(value, "TXT2", s.TXT2);
set(value, "TXT3", s.TXT3);
array.append(value);
}
object[key] = array;
return true;
}
bool XParser::get(Json::Value& object, const char* key, TMap_Point& store, const TMap_Point& defaults) noexcept
{
CHECK_GET_OBJECT({
CHECK_GET_PARAM(value, "point_no", store.point_no);
CHECK_GET_PARAM(value, "gps_e", store.gps_e);
CHECK_GET_PARAM(value, "gps_n", store.gps_n);
CHECK_GET_PARAM(value, "point_no_f", store.point_no_f);
CHECK_GET_PARAM(value, "point_type", store.point_type);
CHECK_GET_PARAM(value, "road_code", store.road_code);
CHECK_GET_PARAM(value, "gps_e_Location", store.gps_e_Location);
CHECK_GET_PARAM(value, "gps_n_Location", store.gps_n_Location);
CHECK_GET_PARAM(value, "f_gps_e", store.f_gps_e);
CHECK_GET_PARAM(value, "f_gps_n", store.f_gps_n);
CHECK_GET_PARAM(value, "passed", store.passed);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, TMap_Points& store, const TMap_Points& defaults) noexcept
{
CHECK_GET_ARRAY({
TMap_Point t;
CHECK_GET_PARAM(v, "point_no", t.point_no);
CHECK_GET_PARAM(v, "gps_e", t.gps_e);
CHECK_GET_PARAM(v, "gps_n", t.gps_n);
CHECK_GET_PARAM(v, "point_no_f", t.point_no_f);
CHECK_GET_PARAM(v, "point_type", t.point_type);
CHECK_GET_PARAM(v, "road_code", t.road_code);
CHECK_GET_PARAM(v, "gps_e_Location", t.gps_e_Location);
CHECK_GET_PARAM(v, "gps_n_Location", t.gps_n_Location);
CHECK_GET_PARAM(v, "f_gps_e", t.f_gps_e);
CHECK_GET_PARAM(v, "f_gps_n", t.f_gps_n);
CHECK_GET_PARAM(v, "passed", t.passed);
store.emplace_back(t);
});
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const TMap_Point& store) noexcept
{
Json::Value value;
set(value, "point_no", store.point_no);
set(value, "gps_e", store.gps_e);
set(value, "gps_n", store.gps_n);
set(value, "point_no_f", store.point_no_f);
set(value, "point_type", store.point_type);
set(value, "road_code", store.road_code);
set(value, "gps_e_Location", store.gps_e_Location);
set(value, "gps_n_Location", store.gps_n_Location);
set(value, "f_gps_e", store.f_gps_e);
set(value, "f_gps_n", store.f_gps_n);
set(value, "passed", store.passed);
object[key] = value;
return true;
}
bool XParser::set(Json::Value& object, const char* key, const TMap_Points& store) noexcept
{
Json::Value array(Json::arrayValue);
for(size_t i = 0; i < store.size(); i++)
{
const TMap_Point& s = store[i];
Json::Value value;
set(value, "point_no", s.point_no);
set(value, "gps_e", s.gps_e);
set(value, "gps_n", s.gps_n);
set(value, "point_no_f", s.point_no_f);
set(value, "point_type", s.point_type);
set(value, "road_code", s.road_code);
set(value, "gps_e_Location", s.gps_e_Location);
set(value, "gps_n_Location", s.gps_n_Location);
set(value, "f_gps_e", s.f_gps_e);
set(value, "f_gps_n", s.f_gps_n);
set(value, "passed", s.passed);
array.append(value);
}
object[key] = array;
return true;
}
bool XParser::get(Json::Value& object, const char* key, TMap_Point_Item& store, const TMap_Point_Item& defaults) noexcept
{
CHECK_GET_OBJECT({
CHECK_GET_PARAM(value, "point_no", store.point_no);
CHECK_GET_PARAM(value, "itemno", store.itemno);
CHECK_GET_PARAM(value, "itemno1", store.itemno1);
CHECK_GET_PARAM(value, "subname", store.subname);
});
return true;
}
bool XParser::get(Json::Value& object, const char* key, TMap_Point_Items& store, const TMap_Point_Items& defaults) noexcept
{
CHECK_GET_ARRAY({
TMap_Point_Item t;
CHECK_GET_PARAM(v, "point_no", t.point_no);
CHECK_GET_PARAM(v, "itemno", t.itemno);
CHECK_GET_PARAM(v, "itemno1", t.itemno1);
CHECK_GET_PARAM(v, "subname", t.subname);
store.emplace_back(t);
});
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const TMap_Point_Item& store) noexcept
{
Json::Value value;
set(value, "point_no", store.point_no);
set(value, "itemno", store.itemno);
set(value, "itemno1", store.itemno1);
set(value, "subname", store.subname);
object[key] = value;
return true;
}
bool XParser::set(Json::Value& object, const char* key, const TMap_Point_Items& store) noexcept
{
Json::Value array(Json::arrayValue);
for(size_t i = 0; i < store.size(); i++)
{
const TMap_Point_Item& s = store[i];
Json::Value value;
set(value, "point_no", s.point_no);
set(value, "itemno", s.itemno);
set(value, "itemno1", s.itemno1);
set(value, "subname", s.subname);
array.append(value);
}
object[key] = array;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const bool& store) noexcept
{
return setT<>(object, key, store);
}
inline bool XParser::set(Json::Value& object, const char* key, const int8& store) noexcept
{
return setT<>(object, key, store);
}
inline bool XParser::set(Json::Value& object, const char* key, const int16& store) noexcept
{
return setT<>(object, key, store);
}
inline bool XParser::set(Json::Value& object, const char* key, const int32& store) noexcept
{
return setT<>(object, key, store);
}
inline bool XParser::set(Json::Value& object, const char* key, const int64& store) noexcept
{
return setT<>(object, key, (Json::Int64)store);
}
inline bool XParser::set(Json::Value& object, const char* key, const double& store) noexcept
{
return setT<>(object, key, store);
}
inline bool XParser::set(Json::Value& object, const char* key, const std::string& store) noexcept
{
return setT<>(object, key, store);
}
inline bool XParser::set(Json::Value& object, const char* key, const std::vector<int8>& store) noexcept
{
return setV<>(object, key, store);
}
inline bool XParser::set(Json::Value& object, const char* key, const std::vector<int16>& store) noexcept
{
return setV<>(object, key, store);
}
inline bool XParser::set(Json::Value& object, const char* key, const std::vector<int32>& store) noexcept
{
return setV<>(object, key, store);
}
inline bool XParser::set(Json::Value& object, const char* key, const std::vector<int64>& store) noexcept
{
Json::Value array(Json::arrayValue);
for(size_t i = 0; i < store.size(); i++)
{
array.append(Json::Int64(store[i]));
}
object[key] = array;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const std::vector<double>& store) noexcept
{
return setV<>(object, key, store);
}
inline bool XParser::set(Json::Value& object, const char* key, const std::vector<std::string>& store) noexcept
{
return setV<>(object, key, store);
}
inline bool XParser::set(Json::Value& object, const char* key, const TExamXm& store) noexcept
{
Json::Value value;
set(value, "xmdm", store.xmdm);
set(value, "xmxh", store.xmxh);
object[key] = value;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const TEventFinishItem& store) noexcept
{
Json::Value value;
set(value, "xmdm", store.xmdm);
set(value, "xmxh", store.xmxh);
set(value, "xmhg", store.xmhg);
object[key] = value;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const TEventSound& store) noexcept
{
Json::Value value;
set(value, "xmdm", store.xmdm);
set(value, "code", store.code);
set(value, "type", store.type);
object[key] = value;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const TEventLane& store) noexcept
{
Json::Value value;
set(value, "road", store.road);
set(value, "num", store.num);
set(value, "count", store.count);
object[key] = value;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const TExamWay& store) noexcept
{
Json::Value value;
set(value, "ldh", store.ldh);
set(value, "jzcds", store.jzcds);
set(value, "jzcd", store.jzcd);
set(value, "qdcds", store.qdcds);
set(value, "qdcd", store.qdcd);
set(value, "clyx", store.clyx);
set(value, "lbx", store.lbx);
set(value, "cdbx", store.cdbx);
set(value, "cdzbx", store.cdzbx);
set(value, "zql", store.zql);
set(value, "yql", store.yql);
set(value, "zhl", store.zhl);
set(value, "yhl", store.yhl);
set(value, "cdsx", store.cdsx);
set(value, "xzx", store.xzx);
set(value, "cyx", store.cyx);
set(value, "xzn", store.xzn);
set(value, "yxfx", store.yxfx);
set(value, "fjdc", store.fjdc);
object[key] = value;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const TKfXm& store) noexcept
{
Json::Value value;
set(value, "xmdm", store.xmdm);
set(value, "kfdm", store.kfdm);
object[key] = value;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const TEventItemMark& store) noexcept
{
Json::Value value;
set(value, "xmdm", store.xmdm);
set(value, "kfdm", store.kfdm);
set(value, "markcatalog", store.markcatalog);
set(value, "type", store.type);
object[key] = value;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const TEventExamFinish& store) noexcept
{
Json::Value value;
set(value, "type", store.type);
set(value, "qjjl", store.qjjl);
set(value, "dcjl", store.dcjl);
set(value, "d1", store.d1);
set(value, "d2", store.d2);
set(value, "d3", store.d3);
set(value, "d4", store.d4);
set(value, "d5", store.d5);
set(value, "d6", store.d6);
object[key] = value;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const std::vector<TKfXm>& store) noexcept
{
Json::Value array(Json::arrayValue);
for(size_t i = 0; i < store.size(); i++)
{
const TKfXm& s = store[i];
Json::Value value;
set(value, "xmdm", s.xmdm);
set(value, "kfdm", s.kfdm);
array.append(value);
}
object[key] = array;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const TRadarFront& store) noexcept
{
Json::Value value;
set(value, "xrjl", store.xrjl);
set(value, "zawjl", store.zawjl);
object[key] = value;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const TGpsInfo& store) noexcept
{
Json::Value value;
set(value, "bklx", store.bklx);
set(value, "dwzt", store.dwzt);
set(value, "jdzt", store.jdzt);
set(value, "sj", store.sj);
set(value, "jd", store.jd);
set(value, "wd", store.wd);
set(value, "hxj", store.hxj);
set(value, "fyj", store.fyj);
set(value, "hbg", store.hbg);
set(value, "gdc", store.gdc);
set(value, "sd", store.sd);
set(value, "age", store.age);
set(value, "jdyz", store.jdyz);
set(value, "wdyz", store.wdyz);
set(value, "dwsxs", store.dwsxs);
set(value, "jdsxs", store.jdsxs);
object[key] = value;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const TSensorInfo& store) noexcept
{
Json::Value value;
set(value, "aqd", store.aqd);
set(value, "mkg", store.mkg);
set(value, "ssc", store.ssc);
set(value, "jsc", store.jsc);
set(value, "fsc", store.fsc);
set(value, "lhq", store.lhq);
set(value, "lb", store.lb);
set(value, "skd", store.skd);
set(value, "jgd", store.jgd);
set(value, "ygd", store.ygd);
set(value, "zfxd", store.zfxd);
set(value, "yfxd", store.yfxd);
set(value, "shtd", store.shtd);
set(value, "wd", store.wd);
set(value, "ygq", store.ygq);
set(value, "dh1", store.dh1);
set(value, "dh2", store.dh2);
set(value, "fdjzs", store.fdjzs);
set(value, "dw", store.dw);
set(value, "cs", store.cs);
set(value, "fxp", store.fxp);
set(value, "ljmc", store.ljmc);
set(value, "lcmc", store.lcmc);
set(value, "csbzh", store.csbzh);
set(value, "csbyh", store.csbyh);
set(value, "csbyq", store.csbyq);
set(value, "csbzq", store.csbzq);
set(value, "zy", store.zy);
set(value, "tbp", store.tbp);
set(value, "hsj", store.hsj);
set(value, "dcj", store.dcj);
set(value, "gx", store.gx);
set(value, "yl", store.yl);
set(value, "yy", store.yy);
set(value, "rmndg", store.rmndg);
set(value, "mndg", store.mndg);
set(value, "sde", store.sde);
set(value, "xhd", store.xhd);
//set(value, "mitemno", store.mitemno);
object[key] = value;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const std::vector<Pointi>& store) noexcept
{
Json::Value array(Json::arrayValue);
for(size_t i = 0; i < store.size(); i++)
{
const Pointi& s = store[i];
Json::Value value;
set(value, "x", s.x);
set(value, "y", s.y);
array.append(value);
}
object[key] = array;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const std::vector<TRadarWay>& store) noexcept
{
Json::Value array(Json::arrayValue);
for(size_t i = 0; i < store.size(); i++)
{
const TRadarWay& s = store[i];
Json::Value value;
set(value, "bh", s.bh);
set(value, "lx", s.lx);
set(value, "jl", s.jl);
set(value, "sd", s.sd);
array.append(value);
}
object[key] = array;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const std::vector<TRadarShow>& store) noexcept
{
Json::Value array(Json::arrayValue);
for(size_t i = 0; i < store.size(); i++)
{
const TRadarShow& s = store[i];
Json::Value value;
set(value, "bh", s.bh);
set(value, "zb", s.zb);
array.append(value);
}
object[key] = array;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const TItemExam& store) noexcept
{
Json::Value value;
set(value, "xmdm", store.xmdm);
set(value, "xmxh", store.xmxh);
object[key] = value;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const std::vector<TItemExam>& store) noexcept
{
Json::Value array(Json::arrayValue);
for(size_t i = 0; i < store.size(); i++)
{
const TItemExam& s = store[i];
Json::Value value;
set(value, "xmdm", s.xmdm);
set(value, "xmxh", s.xmxh);
array.append(value);
}
object[key] = array;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const std::vector<TItemArg>& store) noexcept
{
Json::Value array(Json::arrayValue);
for(size_t i = 0; i < store.size(); i++)
{
const TItemArg& s = store[i];
Json::Value value;
set(value, "xmdm", s.xmdm);
set(value, "xmxh", s.xmxh);
set(value, "model", s.model);
array.append(value);
}
object[key] = array;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const std::vector<TMarkRule>& store) noexcept
{
Json::Value array(Json::arrayValue);
for(size_t i = 0; i < store.size(); i++)
{
const TMarkRule& s = store[i];
Json::Value value;
set(value, "itemno", s.itemno);
//set(value, "itemname", s.itemname);
set(value, "markserial", s.markserial);
set(value, "markreal", s.markreal);
set(value, "markcatalog", s.markcatalog);
set(value, "markshow", s.markshow);
set(value, "OnlyOneKind", s.OnlyOneKind);
set(value, "NoCancelId", s.NoCancelId);
set(value, "GPS_SID", s.GPS_SID);
array.append(value);
}
object[key] = array;
return true;
}
inline bool XParser::set(Json::Value& object, const char* key, const std::vector<TSysset>& store) noexcept
{
Json::Value array(Json::arrayValue);
for(size_t i = 0; i < store.size(); i++)
{
const TSysset& s = store[i];
Json::Value value;
set(value, "key", s.key);
set(value, "name", s.name);
set(value, "value", s.value);
array.append(value);
}
object[key] = array;
return true;
}
bool XParser::set(Json::Value& object, const char* key, const std::vector<TModelPoint>& store) noexcept
{
Json::Value array(Json::arrayValue);
for(size_t i = 0; i < store.size(); i++)
{
const TModelPoint& s = store[i];
Json::Value value;
set(value, "Tag1", s.Tag1);
set(value, "X", s.X);
set(value, "Y", s.Y);
set(value, "DelSign", s.DelSign);
array.append(value);
}
object[key] = array;
return true;
}
bool XParser::set(Json::Value& object, const char* key, const Pointi& store) noexcept
{
Json::Value value;
set(value, "x", store.x);
set(value, "y", store.y);
object[key] = value;
return true;
}
bool XParser::set(Json::Value& object, const char* key, const std::vector<TModelLine>& store) noexcept
{
Json::Value array(Json::arrayValue);
for(size_t i = 0; i < store.size(); i++)
{
const TModelLine& s = store[i];
Json::Value value;
set(value, "PtBegin", s.PtBegin);
set(value, "PtEnd", s.PtEnd);
set(value, "PtMiddle", s.PtMiddle);
set(value, "CenterPoint", s.CenterPoint);
set(value, "Radius", s.Radius);
set(value, "Arc_Pt12", s.Arc_Pt12);
set(value, "Tag1", s.Tag1);
set(value, "Tag2", s.Tag2);
set(value, "Index", s.Index);
array.append(value);
}
object[key] = array;
return true;
}
bool XParser::set(Json::Value& object, const char* key, const TModelLine& store) noexcept
{
Json::Value value;
set(value, "PtBegin", store.PtBegin);
set(value, "PtEnd", store.PtEnd);
set(value, "PtMiddle", store.PtMiddle);
set(value, "CenterPoint", store.CenterPoint);
set(value, "Radius", store.Radius);
set(value, "Arc_Pt12", store.Arc_Pt12);
set(value, "Tag1", store.Tag1);
set(value, "Tag2", store.Tag2);
set(value, "Index", store.Index);
object[key] = value;
return true;
}
bool XParser::set(Json::Value& object, const char* key, const std::vector<TModelPolygon>& store) noexcept
{
Json::Value array(Json::arrayValue);
for(size_t i = 0; i < store.size(); i++)
{
const TModelPolygon& s = store[i];
Json::Value value;
set(value, "LaneNo", s.LaneNo);
set(value, "LaneProperty", s.LaneProperty);
set(value, "Pts", s.Pts);
set(value, "Pts1", s.Pts1);
set(value, "CenterPoint1", s.CenterPoint1);
set(value, "Radius1", s.Radius1);
set(value, "Arc_Pt12_1", s.Arc_Pt12_1);
set(value, "CenterPoint2", s.CenterPoint2);
set(value, "Radius2", s.Radius2);
set(value, "Arc_Pt12_2", s.Arc_Pt12_2);
set(value, "Index", s.Index);
set(value, "Tag1", s.Tag1);
set(value, "Tag2", s.Tag2);
array.append(value);
}
object[key] = array;
return true;
}
bool XParser::set(Json::Value& object, const char* key, const TModelPolygon& store) noexcept
{
Json::Value value;
set(value, "LaneNo", store.LaneNo);
set(value, "LaneProperty", store.LaneProperty);
set(value, "Pts", store.Pts);
set(value, "Pts1", store.Pts1);
set(value, "CenterPoint1", store.CenterPoint1);
set(value, "Radius1", store.Radius1);
set(value, "Arc_Pt12_1", store.Arc_Pt12_1);
set(value, "CenterPoint2", store.CenterPoint2);
set(value, "Radius2", store.Radius2);
set(value, "Arc_Pt12_2", store.Arc_Pt12_2);
set(value, "Index", store.Index);
set(value, "Tag1", store.Tag1);
set(value, "Tag2", store.Tag2);
object[key] = value;
return true;
}
bool XParser::set(Json::Value& object, const char* key, const TMapRoadRecs& store) noexcept
{
Json::Value array(Json::arrayValue);
for(size_t i = 0; i < store.size(); i++)
{
const TMapRoadRec* rec = store[i];
Json::Value value;
set(value, "Road_Code", rec->Road_Code);
set(value, "Road_Code_No", rec->Road_Code_No);
set(value, "BaseLine", rec->BaseLine);
set(value, "BorderLines", rec->BorderLines);
set(value, "Lanes", rec->Lanes);
set(value, "LaneCount", rec->LaneCount);
set(value, "Area", rec->Area);
set(value, "IsArc", rec->IsArc);
array.append(value);
}
object[key] = array;
return true;
}
bool XParser::set(Json::Value& object, const char* key, const TMapRoadRec& store) noexcept
{
Json::Value value;
set(value, "Road_Code", store.Road_Code);
set(value, "Road_Code_No", store.Road_Code_No);
set(value, "BaseLine", store.BaseLine);
set(value, "BorderLines", store.BorderLines);
set(value, "Lanes", store.Lanes);
set(value, "LaneCount", store.LaneCount);
set(value, "Area", store.Area);
set(value, "IsArc", store.IsArc);
object[key] = value;
return true;
}
bool XParser::set(Json::Value& object, const char* key, const TMapSubItemRecs& store) noexcept
{
Json::Value array(Json::arrayValue);
for(size_t i = 0; i < store.size(); i++)
{
const TMapSubItemRec* rec = store[i];
Json::Value value;
set(value, "ItemNo", rec->ItemNo);
set(value, "SubName", rec->SubName);
set(value, "SNO ", rec->SNO);
set(value, "Point1", rec->Point1);
set(value, "Point2", rec->Point2);
set(value, "Point3", rec->Point3);
set(value, "Point4", rec->Point4);
set(value, "Line1", rec->Line1);
set(value, "Line2", rec->Line2);
set(value, "Line3", rec->Line3);
set(value, "Polygon", rec->Polygon);
array.append(value);
}
object[key] = array;
return true;
}
bool XParser::set(Json::Value& object, const char* key, const TMapSubItemRec& store) noexcept
{
Json::Value value;
set(value, "ItemNo", store.ItemNo);
set(value, "SubName", store.SubName);
set(value, "SNO ", store.SNO);
set(value, "Point1", store.Point1);
set(value, "Point2", store.Point2);
set(value, "Point3", store.Point3);
set(value, "Point4", store.Point4);
set(value, "Line1", store.Line1);
set(value, "Line2", store.Line2);
set(value, "Line3", store.Line3);
set(value, "Polygon", store.Polygon);
object[key] = value;
return true;
}
bool XParser::set(Json::Value& object, const char* key, const TMeshDefines& store) noexcept
{
Json::Value array(Json::arrayValue);
for(size_t i = 0; i < store.size(); i++)
{
const TMeshDefine* rec = store[i];
Json::Value value;
set(value, "MapRoad_Keys", rec->MapRoad_Keys);
set(value, "MapSubItem_Keys", rec->MapSubItem_Keys);
set(value, "PointItem_Keys", rec->PointItem_Keys);
set(value, "FangXiangDian_Keys", rec->FangXiangDian_Keys);
set(value, "MapRoadKeyLen", rec->MapRoadKeyLen);
set(value, "MapSubItemKeyLen", rec->MapSubItemKeyLen);
set(value, "PointItemKeyLen", rec->PointItemKeyLen);
set(value, "FangXiangDianKeyLen", rec->FangXiangDianKeyLen);
set(value, "RowNo", rec->RowNo);
set(value, "ColNo", rec->ColNo);
set(value, "Area", rec->Area);
array.append(value);
}
object[key] = array;
return true;
}