]> git.llucax.com Git - z.facultad/75.42/plaqui.git/commitdiff
Se cargan todas las compuertas y se conectan en el modelo . Creo que solo
authorRicardo Markiewicz <gazer.arg@gmail.com>
Sun, 30 Nov 2003 23:45:13 +0000 (23:45 +0000)
committerRicardo Markiewicz <gazer.arg@gmail.com>
Sun, 30 Nov 2003 23:45:13 +0000 (23:45 +0000)
 falta la conexion entre compuertas.

 Solo hay que hacer un Karnot a veces para no pensar tanto lo que hay que
 poner :-)

Model/src/simulator.cpp

index f5c011452c1c1a8e66854b8baee9b3a3255dfbcc..ac03b47a1452b2b81fd5b48100d04c36da5a746e 100644 (file)
@@ -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<Control *>(find((char *)XML_GET_CONTENT(nodo->children)));
                        if (item != NULL) {
-                               current->connect( item->get_logic_output(), IConector::IN );
+                               if (dynamic_cast<Tank *>(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;
                        }