]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blobdiff - Model/src/simulator.cpp
El make_tar va a usar el numero de REV en breve
[z.facultad/75.42/plaqui.git] / Model / src / simulator.cpp
index ac03b47a1452b2b81fd5b48100d04c36da5a746e..7811d4eef0694d3520ac04452c42421ad986b8cb 100644 (file)
@@ -539,6 +539,9 @@ std::string Simulator::get_state_as_xml()
        for(i2=items.begin(); i2!=items.end(); i2++)
                (*i2)->get_state_as_xml(out);
 
+       std::list<LogicControl *>::iterator i3;
+       for(i3=control_lst.begin(); i3!=control_lst.end(); i3++)
+               (*i3)->get_state_as_xml(out);
        out << "</plantstatus>";
        return out.str();;
 }
@@ -612,7 +615,13 @@ void Simulator::connect_logic(LogicControl *current, xmlNodePtr nodo)
                        if (item != NULL) {
                                item->get_logic_input()->connect( current, IConector::IN );
                        } else {
-                               std::cout << "ERROR : Item no es tipo Control!!" << std::endl;
+                               LogicControl *logic = dynamic_cast<LogicControl *>(find_logic((char *)XML_GET_CONTENT(nodo->children)));
+                               /* Bien, si no era un control, debe ser una compuerta */
+                               if (logic != NULL) {
+                                       logic->connect(current, IConector::IN);
+                               } else {
+                                       std::cout << "ERROR : Item no es tipo Control ni tipo LogicControl ... esto si que esta todo malllll!!" << std::endl;
+                               }
                        }
                }