Skip to content
Snippets Groups Projects
Commit 337bf479 authored by Joaquim Casals Buñuel's avatar Joaquim Casals Buñuel
Browse files

Fixed missing sensor name from callbacks in YAML

parent 73dae109
No related branches found
No related tags found
1 merge request!275WIP: Resolve "Demo related issues"
Pipeline #3427 passed
...@@ -64,7 +64,7 @@ class parserYAML { ...@@ -64,7 +64,7 @@ class parserYAML {
string _file; string _file;
bool _relative_path; bool _relative_path;
string _path_root; string _path_root;
vector<array<string, 2>> _callbacks; vector<array<string, 3>> _callbacks;
public: public:
parserYAML(){ parserYAML(){
_params = map<string, string>(); _params = map<string, string>();
...@@ -75,7 +75,7 @@ public: ...@@ -75,7 +75,7 @@ public:
_files = vector<string>(); _files = vector<string>();
_path_root = ""; _path_root = "";
_relative_path = false; _relative_path = false;
_callbacks = vector<array<string, 2>>(); _callbacks = vector<array<string, 3>>();
} }
parserYAML(string file){ parserYAML(string file){
_params = map<string, string>(); _params = map<string, string>();
...@@ -86,7 +86,7 @@ public: ...@@ -86,7 +86,7 @@ public:
_file = file; _file = file;
_path_root = ""; _path_root = "";
_relative_path = false; _relative_path = false;
_callbacks = vector<array<string, 2>>(); _callbacks = vector<array<string, 3>>();
} }
parserYAML(string file, string path_root){ parserYAML(string file, string path_root){
_params = map<string, string>(); _params = map<string, string>();
...@@ -97,7 +97,7 @@ public: ...@@ -97,7 +97,7 @@ public:
_file = file; _file = file;
_path_root = path_root; _path_root = path_root;
_relative_path = true; _relative_path = true;
_callbacks = vector<array<string, 2>>(); _callbacks = vector<array<string, 3>>();
} }
~parserYAML(){ ~parserYAML(){
// //
...@@ -112,7 +112,7 @@ public: ...@@ -112,7 +112,7 @@ public:
vector<array<string, 2>> sensorsSerialization(); vector<array<string, 2>> sensorsSerialization();
vector<array<string, 3>> processorsSerialization(); vector<array<string, 3>> processorsSerialization();
vector<string> getFiles(); vector<string> getFiles();
vector<array<string, 2>> getCallbacks(); vector<array<string, 3>> getCallbacks();
map<string,string> getParams(); map<string,string> getParams();
void parse(); void parse();
map<string, string> fetchAsMap(YAML::Node); map<string, string> fetchAsMap(YAML::Node);
...@@ -239,7 +239,7 @@ void parserYAML::parseFirstLevel(string file){ ...@@ -239,7 +239,7 @@ void parserYAML::parseFirstLevel(string file){
_paramsProc.push_back(pProc); _paramsProc.push_back(pProc);
} }
for(const auto& kv : n_config["callbacks"]){ for(const auto& kv : n_config["callbacks"]){
_callbacks.push_back({{kv[0].as<std::string>(), kv[1].as<std::string>()}}); _callbacks.push_back({{kv[0].as<std::string>(), kv[1].as<std::string>(), kv[2].as<std::string>()}});
} }
YAML::Node n_files = n["files"]; YAML::Node n_files = n["files"];
assert(n_files.Type() == YAML::NodeType::Sequence && "trying to parse files node but found a non-Sequence node"); assert(n_files.Type() == YAML::NodeType::Sequence && "trying to parse files node but found a non-Sequence node");
...@@ -262,7 +262,7 @@ vector<array<string, 3>> parserYAML::processorsSerialization(){ ...@@ -262,7 +262,7 @@ vector<array<string, 3>> parserYAML::processorsSerialization(){
vector<string> parserYAML::getFiles(){ vector<string> parserYAML::getFiles(){
return this->_files; return this->_files;
} }
vector<array<string, 2>> parserYAML::getCallbacks(){ vector<array<string, 3>> parserYAML::getCallbacks(){
return this->_callbacks; return this->_callbacks;
} }
map<string,string> parserYAML::getParams(){ map<string,string> parserYAML::getParams(){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment