+
+void Constructor::create_lines(xmlNodePtr nodo)
+{
+ std::string name;
+
+ nodo = nodo->children;
+ while (nodo != NULL) {
+ if (nodo->type == XML_ELEMENT_NODE) {
+ if (xmlStrcmp(nodo->name, BAD_CAST"and")==0) {
+ name = (char *)xmlGetProp(nodo, BAD_CAST"nombre");
+ std::cout << name << std::endl;
+ create_line(nodo->children, workplace->get_logic_id(name));
+ } else if (xmlStrcmp(nodo->name, BAD_CAST"not")==0) {
+ name = (char *)xmlGetProp(nodo, BAD_CAST"nombre");
+ std::cout << name << std::endl;
+ create_line(nodo->children, workplace->get_logic_id(name));
+ } else if (xmlStrcmp(nodo->name, BAD_CAST"or")==0) {
+ name = (char *)xmlGetProp(nodo, BAD_CAST"nombre");
+ std::cout << name << std::endl;
+ create_line(nodo->children, workplace->get_logic_id(name));
+ }
+ }
+ nodo = nodo->next;
+ }
+}
+
+//Levanta las lineas desde el archvo XML
+void Constructor::create_line(xmlNodePtr nodo, int logic_id)
+{
+ std::string otro;
+ std::cout << "Buscando lineas ..." << std::endl;
+ while (nodo != NULL) {
+ if (nodo->type == XML_ELEMENT_NODE) {
+ if (xmlStrcmp(nodo->name, BAD_CAST"salida")==0) {
+ otro = (char *)XML_GET_CONTENT(nodo->children);
+ t_line tmp_line;
+ tmp_line.logic_id = logic_id;
+ //workplace->get_logic_item(logic_id)->set_out_connected(true);
+ tmp_line.store_id = workplace->get_item_id(otro);
+ std::cout << otro << " " << tmp_line.logic_id << " " << tmp_line.store_id << std::endl;
+ workplace->lista_lineas_in.push_back(tmp_line);
+ } else if (xmlStrcmp(nodo->name, BAD_CAST"entrada")==0) {
+ otro = (char *)XML_GET_CONTENT(nodo->children);
+ t_line tmp_line;
+ tmp_line.logic_id = logic_id;
+ tmp_line.store_id = workplace->get_item_id(otro);
+ workplace->lista_lineas_out.push_back(tmp_line);
+ std::cout << otro << " " << tmp_line.logic_id << " " << tmp_line.store_id << std::endl;
+ }
+ }
+ nodo = nodo->next;
+ }
+}