if (xmlStrcmp(nodo->name, BAD_CAST"entrada") == 0) {
item = dynamic_cast<Control *>(find((char *)XML_GET_CONTENT(nodo->children)));
if (item != NULL) {
- if (dynamic_cast<Tank *>(item)) {
+ if (dynamic_cast<Tank *>(item) != NULL) {
std::string donde = (char *)xmlGetProp(nodo, BAD_CAST"id");
if (donde == "inferior") {
current->connect( item->get_logic_output(), IConector::IN );
current->connect( item->get_logic_output(), 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) {
+ current->connect(logic, IConector::IN);
+ } else {
+ std::cout << "ERROR : Item no es tipo Control ni tipo LogicControl ... esto si que esta todo malllll!!" << std::endl;
+ }
}
} else if (xmlStrcmp(nodo->name, BAD_CAST"salida") == 0) {
item = dynamic_cast<Control *>(find((char *)XML_GET_CONTENT(nodo->children)));