|
@@ -175,113 +175,41 @@ void grpcclient::dec_yaml(const char * stryamlpath)
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- std::vector<std::string> vecmodulename;
|
|
|
-
|
|
|
-
|
|
|
if(config["server"])
|
|
|
{
|
|
|
gstrserverip = config["server"].as<std::string>();
|
|
|
}
|
|
|
- if(config["port"])
|
|
|
+ if(config["uploadPort"])
|
|
|
{
|
|
|
- gstrserverport = config["port"].as<std::string>();
|
|
|
+ gstruploadPort = config["uploadPort"].as<std::string>();
|
|
|
}
|
|
|
- if(config["uploadinterval"])
|
|
|
+ if(config["patrolPort"])
|
|
|
{
|
|
|
- gstruploadinterval = config["uploadinterval"].as<std::string>();
|
|
|
+ gstrpatrolPort = config["patrolPort"].as<std::string>();
|
|
|
}
|
|
|
-
|
|
|
- if(config["VIN"])
|
|
|
+ if(config["controlPort"])
|
|
|
{
|
|
|
- gstrVIN = config["VIN"].as<std::string>();
|
|
|
+ gstrcontrolPort = config["controlPort"].as<std::string>();
|
|
|
}
|
|
|
-
|
|
|
- if(config["queryMD5"])
|
|
|
+ if(config["uploadInterval"])
|
|
|
{
|
|
|
- gstrqueryMD5 = config["queryMD5"].as<std::string>();
|
|
|
+ gstruploadInterval = config["uploadInterval"].as<std::string>();
|
|
|
}
|
|
|
- else
|
|
|
+ if(config["patrolInterval"])
|
|
|
{
|
|
|
- return;
|
|
|
+ gstrpatrolInterval = config["patrolInterval"].as<std::string>();
|
|
|
}
|
|
|
|
|
|
- if(config["ctrlMD5"])
|
|
|
+ if(config["id"])
|
|
|
{
|
|
|
- gstrctrlMD5 = config["ctrlMD5"].as<std::string>();
|
|
|
+ gstrid = config["id"].as<std::string>();
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- std::string strmsgname;
|
|
|
-
|
|
|
- if(config["uploadmessage"])
|
|
|
+ if(config["plateNumber"])
|
|
|
{
|
|
|
-
|
|
|
- for(YAML::const_iterator it= config["uploadmessage"].begin(); it != config["uploadmessage"].end();++it)
|
|
|
- {
|
|
|
- std::string strtitle = it->first.as<std::string>();
|
|
|
- std::cout<<strtitle<<std::endl;
|
|
|
-
|
|
|
- if(config["uploadmessage"][strtitle]["msgname"]&&config["uploadmessage"][strtitle]["buffersize"]&&config["uploadmessage"][strtitle]["buffercount"])
|
|
|
- {
|
|
|
- iv::msgunit xmu;
|
|
|
- strmsgname = config["uploadmessage"][strtitle]["msgname"].as<std::string>();
|
|
|
- strncpy(xmu.mstrmsgname,strmsgname.data(),255);
|
|
|
- xmu.mnBufferSize = config["uploadmessage"][strtitle]["buffersize"].as<int>();
|
|
|
- xmu.mnBufferCount = config["uploadmessage"][strtitle]["buffercount"].as<int>();
|
|
|
- if(config["uploadmessage"][strtitle]["bimportant"])
|
|
|
- {
|
|
|
- std::string strimportant = config["uploadmessage"][strtitle]["bimportant"].as<std::string>();
|
|
|
- if(strimportant == "true")
|
|
|
- {
|
|
|
- xmu.mbImportant = true;
|
|
|
- }
|
|
|
- }
|
|
|
- if(config["uploadmessage"][strtitle]["keeptime"])
|
|
|
- {
|
|
|
- std::string strkeep = config["uploadmessage"][strtitle]["keeptime"].as<std::string>();
|
|
|
- xmu.mnkeeptime = atoi(strkeep.data());
|
|
|
- }
|
|
|
- mvectormsgunit.push_back(xmu);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- if(!config["ctrlMD5"])
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if(config["ctrlmessage"])
|
|
|
- {
|
|
|
- std::string strnodename = "ctrlmessage";
|
|
|
- for(YAML::const_iterator it= config[strnodename].begin(); it != config[strnodename].end();++it)
|
|
|
- {
|
|
|
- std::string strtitle = it->first.as<std::string>();
|
|
|
- std::cout<<strtitle<<std::endl;
|
|
|
-
|
|
|
- if(config[strnodename][strtitle]["msgname"]&&config[strnodename][strtitle]["buffersize"]&&config[strnodename][strtitle]["buffercount"])
|
|
|
- {
|
|
|
- iv::msgunit xmu;
|
|
|
- strmsgname = config[strnodename][strtitle]["msgname"].as<std::string>();
|
|
|
- strncpy(xmu.mstrmsgname,strmsgname.data(),255);
|
|
|
- xmu.mnBufferSize = config[strnodename][strtitle]["buffersize"].as<int>();
|
|
|
- xmu.mnBufferCount = config[strnodename][strtitle]["buffercount"].as<int>();
|
|
|
- mvectorctrlmsgunit.push_back(xmu);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
-
|
|
|
+ gstrplateNumber = config["plateNumber"].as<std::string>();
|
|
|
}
|
|
|
|
|
|
return;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
void grpcclient::sharectrlmsg(iv::cloud::cloudmsg * pxmsg)
|