X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/1977f2e514c49ae6bdf411be9b08bc59be554a60..b0a202776ab7634c206b495b42e20cfe6492e035:/Model/src/simulator.cpp diff --git a/Model/src/simulator.cpp b/Model/src/simulator.cpp index c5eb381..3f432b9 100644 --- a/Model/src/simulator.cpp +++ b/Model/src/simulator.cpp @@ -5,6 +5,7 @@ using namespace PlaQui::Model; Simulator::Simulator(const std::string &filename) { + frame = 0; /* Parseo de ejemplo de un XML desde archivo */ xmlDocPtr document; document = xmlParseFile(filename.c_str()); @@ -140,6 +141,8 @@ void Simulator::simulate() std::list::iterator i2; for(i2=items.begin(); i2!=items.end(); i2++) (*i2)->simulate(); + + frame++; } IConector *Simulator::find(const std::string &name) @@ -301,3 +304,21 @@ void Simulator::loadUnion(xmlNodePtr nodo) add_union(name); } + +std::string Simulator::get_state_as_xml() +{ + std::stringstream out; + + // XML Header + out << "" << std::endl; + + out << "" << std::endl; + + std::list::iterator i2; + for(i2=items.begin(); i2!=items.end(); i2++) + (*i2)->get_state_as_xml(out); + + out << ""; + return out.str();; +} +