diff options
Diffstat (limited to 'rotord/src/graph.cpp')
| -rw-r--r-- | rotord/src/graph.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/rotord/src/graph.cpp b/rotord/src/graph.cpp index 5871b7b..162232f 100644 --- a/rotord/src/graph.cpp +++ b/rotord/src/graph.cpp @@ -187,7 +187,15 @@ bool Graph::parseJson(string &data,string &media_path){ else cerr << "Rotor: cannot find parameter '" << parameter << "' of "<<settings["type"]<<" "<< nodeID << endl; } - // + //attributes + for (int m=0;m<jnodes[i]["attributes"].size();m++){ + string attribute=jnodes[i]["attributes"][m]["name"].asString(); + if (nodes[nodeID]->attributes.find(attribute)!=nodes[nodeID]->attributes.end()) { + string val=jnodes[i]["attributes"][m]["value"].asString(); + nodes[nodeID]->attributes.find(attribute)->second->value=val; + } + else cerr << "Rotor: cannot find attribute '" << attribute << "' of "<<settings["type"]<<" "<< nodeID << endl; + } } else cerr << "Rotor: duplicate node '"<<nodeID<<"' "<< endl; |
