X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/16f64e28170d4473eebaa309d3082785c32b809c..4ddd90e71988f16c5ea79f5de86a9fcb63973ded:/Model/src/simulator.cpp diff --git a/Model/src/simulator.cpp b/Model/src/simulator.cpp index 66148f2..ac03b47 100644 --- a/Model/src/simulator.cpp +++ b/Model/src/simulator.cpp @@ -314,7 +314,7 @@ void Simulator::loadTank(xmlNodePtr nodo) capacidad = atoi( (char *)XML_GET_CONTENT(nodo->children) ); } else if (xmlStrcmp(nodo->name, BAD_CAST"inicial") == 0) { inicial = atof( (char *)XML_GET_CONTENT(nodo->children) ); - } else if (xmlStrcmp(nodo->name, BAD_CAST"") == 0) { + } else if (xmlStrcmp(nodo->name, BAD_CAST"color") == 0) { color = loadRGB(nodo->children); } } @@ -574,7 +574,7 @@ void Simulator::do_logic_connetions(xmlNodePtr nodo) continue; } // obtengo el items actual por su nombre - if (xmlStrcmp(nodo->name, BAD_CAST"and") == 0) { + if ((xmlStrcmp(nodo->name, BAD_CAST"and") == 0) || (xmlStrcmp(nodo->name, BAD_CAST"not") == 0) || (xmlStrcmp(nodo->name, BAD_CAST"or") == 0)) { std::string s = (char *)xmlGetProp(nodo, BAD_CAST"nombre"); current = find_logic((char *)xmlGetProp(nodo, BAD_CAST"nombre")); connect_logic(current, nodo->children); @@ -594,7 +594,16 @@ void Simulator::connect_logic(LogicControl *current, xmlNodePtr nodo) if (xmlStrcmp(nodo->name, BAD_CAST"entrada") == 0) { item = dynamic_cast(find((char *)XML_GET_CONTENT(nodo->children))); if (item != NULL) { - current->connect( item->get_logic_output(), IConector::IN ); + if (dynamic_cast(item)) { + std::string donde = (char *)xmlGetProp(nodo, BAD_CAST"id"); + if (donde == "inferior") { + current->connect( item->get_logic_output(), IConector::IN ); + } else { + current->connect( item->get_logic_input(), IConector::IN ); + } + } else { + current->connect( item->get_logic_output(), IConector::IN ); + } } else { std::cout << "ERROR : Item no es tipo Control!!" << std::endl; }