]> git.llucax.com Git - z.facultad/75.42/plaqui.git/commitdiff
Se arreglan un par de huevadas y ahora se ve 10 puntos el exclusa_inteligente.xml
authorRicardo Markiewicz <gazer.arg@gmail.com>
Fri, 5 Dec 2003 02:28:22 +0000 (02:28 +0000)
committerRicardo Markiewicz <gazer.arg@gmail.com>
Fri, 5 Dec 2003 02:28:22 +0000 (02:28 +0000)
 Ademas tambien se siluma bien.

Client/src/item_and.cpp
Client/src/principal.cpp
Model/src/exclusa.cpp
Model/src/tank.cpp
Samples/exclusa_inteligente.xml

index ee3bdcc8d98b222f79c5bfd09bc4a5fab47804d8..61fa342793e79a434ddc0b793a8b5172ba1bcc44 100644 (file)
@@ -14,6 +14,7 @@ ViewAnd::ViewAnd(Glib::ustring _name, int orientacion):ViewItem(_name)
                        out_y = 16;
                        offset_x = 15;
                        offset_y = 0;
+                       item_offset_x = item_offset_y = 0;
                break;
                case 1:
                        image.set(PACKAGE_DATA_DIR"/plaqui-client/pixmaps/and_s.png");
@@ -23,6 +24,7 @@ ViewAnd::ViewAnd(Glib::ustring _name, int orientacion):ViewItem(_name)
                        out_y = 32;
                        offset_x = 0;
                        offset_y = 15;
+                       item_offset_x = item_offset_y = 0;
                break;
                case 2:
                        image.set(PACKAGE_DATA_DIR"/plaqui-client/pixmaps/and_o.png");
@@ -32,6 +34,7 @@ ViewAnd::ViewAnd(Glib::ustring _name, int orientacion):ViewItem(_name)
                        out_y = 16;
                        offset_x = -15;
                        offset_y = 0;
+                       item_offset_x = item_offset_y = 0;
                break;
                case 3:
                        image.set(PACKAGE_DATA_DIR"/plaqui-client/pixmaps/and_n.png");
@@ -41,6 +44,7 @@ ViewAnd::ViewAnd(Glib::ustring _name, int orientacion):ViewItem(_name)
                        out_y = 0;
                        offset_x = 0;
                        offset_y = -15;
+                       item_offset_x = item_offset_y = 0;
        }
        m_or = orientacion;
        image.show();
index c3c553ad6789086f91dd171a778779367aceea90..e70f36d50f831a89321d8bd436ccd94e9f597da5 100644 (file)
@@ -494,6 +494,7 @@ void Principal::loadNot(xmlNodePtr nodo)
                                y = atoi( (char *)XML_GET_CONTENT(nodo->children) );
                        } else if (xmlStrcmp(nodo->name, BAD_CAST"salida") == 0) {
                                linea.dst = (char *)XML_GET_CONTENT(nodo->children);
+                               linea.is_tank = false;
                                p->out_lines.push_back(linea);
                        } else if (xmlStrcmp(nodo->name, BAD_CAST"entrada") == 0) {
                                linea.dst = (char *)XML_GET_CONTENT(nodo->children);
@@ -539,6 +540,7 @@ void Principal::loadOr(xmlNodePtr nodo)
                                y = atoi( (char *)XML_GET_CONTENT(nodo->children) );
                        } else if (xmlStrcmp(nodo->name, BAD_CAST"salida") == 0) {
                                linea.dst = (char *)XML_GET_CONTENT(nodo->children);
+                               linea.is_tank = false;
                                p->out_lines.push_back(linea);
                        } else if (xmlStrcmp(nodo->name, BAD_CAST"entrada") == 0) {
                                linea.dst = (char *)XML_GET_CONTENT(nodo->children);
@@ -844,7 +846,6 @@ void Principal::read_status_xml(const std::string &_frame)
                                if (xmlStrcmp(items->name, BAD_CAST"float")==0) {
                                        tmp = get_float_from_xml(items->children);
                                        item_name = (char *)xmlGetProp(items, BAD_CAST"name");
-                                       std::cout << item_name << " " << tmp << std::endl;
                                        mapItems[item_name]->set_actual_flow(tmp);
                                } else if (xmlStrcmp(items->name, BAD_CAST"exclusa")==0) {
                                        tmp_b = get_bool_from_xml(items->children);
@@ -873,7 +874,7 @@ void Principal::read_status_xml(const std::string &_frame)
                                                        else if (xmlStrcmp(nodo_tmp->name, BAD_CAST"litros")==0)
                                                                lit= atof( (char *)XML_GET_CONTENT(nodo_tmp->children) );
                                                        else if (xmlStrcmp(nodo_tmp->name, BAD_CAST"salida")==0) {
-                                                               if (xmlStrcmp(xmlGetProp(items, BAD_CAST"id"), BAD_CAST"inferior")==0) {
+                                                               if (xmlStrcmp(xmlGetProp(nodo_tmp, BAD_CAST"id"), BAD_CAST"inferior")==0) {
                                                                        b_inf = get_bool_from_xml(nodo_tmp->children);
                                                                } else {
                                                                        b_sup = get_bool_from_xml(nodo_tmp->children);
index 42535074ff3eb3a474fb08989bf674c01968ff14..96c8f99994d2289196f64e9840ef039435f3337b 100644 (file)
@@ -23,8 +23,6 @@ Exclusa::~Exclusa()
 
 void Exclusa::update(int dir)
 {
-       if (updated) return;
-
        // Primero me fijo si la entrada esta operando, es decir
        // si hay alguien conectado para automatizar.
        if (input->is_operational()) {
@@ -32,6 +30,7 @@ void Exclusa::update(int dir)
                // mi estado
                is_open = input->get_output();
        }
+       if (updated) return;
        actual_flow = temp = INFINITO;
 }
 
index c9a4cc668c3e4483cc8e7a56030607b93c15a5a8..58a90ff08f3c17c4ea64bed99c08276224a72991 100644 (file)
@@ -22,6 +22,7 @@ Tank::~Tank()
 
 bool Tank::get_output()
 {
+       std::cout << "TODO MAL" << std::endl;
        return litros > 0;
 }
 
index e74577b619e1cb2080de8540cda24db7785094a7..97e8c139cbdd82c190ac4d6b2c73583b513e0c09 100644 (file)
@@ -79,9 +79,9 @@
                <salida>exclusa3</salida>
        </and>
        <or nombre="or6" id="6">
-               <orientacion>3</orientacion>
-               <x>288</x>
-               <y>128</y>
+               <orientacion>0</orientacion>
+               <x>320</x>
+               <y>288</y>
                <entrada id = "superior">tanque2</entrada>
                <entrada>exclusa3</entrada>
                <salida>and5</salida>