]> git.llucax.com Git - z.facultad/75.42/plaqui.git/commitdiff
cuando se eliminann items las compuetas ponen sus estados de las salidas o entradas...
authorNicolás Dimov <ndimov@gmail.com>
Sat, 29 Nov 2003 18:31:56 +0000 (18:31 +0000)
committerNicolás Dimov <ndimov@gmail.com>
Sat, 29 Nov 2003 18:31:56 +0000 (18:31 +0000)
Constructor/src/and.cpp
Constructor/src/cistern.cpp
Constructor/src/not.cpp
Constructor/src/or.cpp
Constructor/src/pump.cpp
Constructor/src/workplace.cpp

index 927aa6158f00171ab3c189f21041efc2a3dfe220..15230c0678d8719d66ef68ef7fcf3ddd10be1a64 100644 (file)
@@ -76,6 +76,11 @@ bool And::on_button_press_event(GdkEventButton *event)
                combo_entry->set_popdown_strings(*list_pointed);
                combo_entry->get_entry()->set_text (name);
                workplace->queue_draw();
+               char f[20];
+               Glib::ustring text;
+               sprintf(f,"  Conector OUT = %d",out_connected);
+               text = name+f;
+               status_bar->push ( text, 0);
        }
        
        if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 2)){
index b3638554ef9301737d95f938685acc58a6116cf7..78b0355ce87730e44b5bae7418590f365dd031d1 100644 (file)
@@ -76,13 +76,11 @@ bool Cistern::on_button_press_event(GdkEventButton *event)
                        }
                        CItem::gate_id = -1;
                }
-               char f[10], g[10];
+               char f[20], g[25];
                Glib::ustring text;
-               sprintf(f,"%.1f  ",capacidad);
-               sprintf(g,"%.1f",contenido_inicial);
-               text = name+"  Capacidad: ";
-               text += f;
-               text += "Contenido Inicial: ";
+               sprintf(f,"  Capacidad: %.1f  ",capacidad);
+               sprintf(g,"Contenido Inicial: %.1f",contenido_inicial);
+               text = name+ f;
                text += g;
                status_bar->push ( text, 0);            
        }
index a946d8cc4888848d04837a15229e9895fb76a327..3fd6b7c817ce81eb84059b26b1d5498d85776b21 100644 (file)
@@ -79,6 +79,11 @@ bool Not::on_button_press_event(GdkEventButton *event)
                combo_entry->set_popdown_strings(*list_pointed);
                combo_entry->get_entry()->set_text (name);
                workplace->queue_draw();
+               char f[40];
+               Glib::ustring text;
+               sprintf(f,"  Conector OUT = %d  Conector IN = %d",out_connected, in_connected);
+               text = name+f;
+               status_bar->push ( text, 0);
        }
        
        if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 2)){
index a96d48f335b10a1babfdf60d97e349e79aeaf3ca..7be809ed1febb7c96ebf70cfdd9d561e388c8ad1 100644 (file)
@@ -74,6 +74,11 @@ bool Or::on_button_press_event(GdkEventButton *event)
                list_pointed->push_back(name);
                combo_entry->set_popdown_strings(*list_pointed);
                combo_entry->get_entry()->set_text (name);
+               char f[20];
+               Glib::ustring text;
+               sprintf(f,"  Conector OUT = %d",out_connected);
+               text = name+f;
+               status_bar->push ( text, 0);
        }
        
        if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 2)){
index cafa7d5f039e8ee9c0c300bd9d924a7e935ba9ff..793df76fd89da3c43e5356d02625dff2851b4875 100644 (file)
@@ -73,11 +73,10 @@ bool Pump::on_button_press_event(GdkEventButton *event)
                        }
                        CItem::gate_id = -1;
                }
-               char f[10];
+               char f[20];
                Glib::ustring text;
-               sprintf(f,"%.1f",entrega);
-               text = name+"  Entrega: ";
-               text += f;
+               sprintf(f,"  Entrega:%.1f",entrega);
+               text = name+f;
                status_bar->push ( text, 0);
        }
        
index 206bca3e81c6e0df32c871289c97ed39ece4a087..2dccaa30858c217fb3ea5ea51c705113642220a4 100644 (file)
@@ -210,6 +210,7 @@ void WorkPlace::delete_line(int _id)
        while ( i != lista_lineas_in.end() ){
                if (get_item( (*i).store_id ) != NULL)
                        if ( get_item( (*i).store_id )->get_id() == _id ) {
+                               get_logic_item((*i).logic_id)->set_out_connected(false);        
                                lista_lineas_in.erase(i);
                                i = lista_lineas_in.begin();
                        }
@@ -220,7 +221,6 @@ void WorkPlace::delete_line(int _id)
        while ( i != lista_lineas_in.end() ){
                if ( get_logic_item((*i).logic_id) != NULL)
                        if ( get_logic_item((*i).logic_id)->get_id() == _id) {
-                               get_logic_item((*i).logic_id)->set_out_connected(false);        
                                lista_lineas_in.erase(i);
                                i = lista_lineas_in.begin();
                        }
@@ -231,6 +231,8 @@ void WorkPlace::delete_line(int _id)
        while ( j != lista_lineas_out.end() ){
                if ( get_item((*j).store_id) != NULL )
                        if ( get_item((*j).store_id)->get_id() == _id ) {
+                               if (dynamic_cast<Not *>(get_logic_item((*j).logic_id))) 
+                                       get_logic_item((*j).logic_id)->set_in_connected(false);
                                lista_lineas_out.erase(j);
                                j = lista_lineas_out.begin();
                        }
@@ -241,13 +243,35 @@ void WorkPlace::delete_line(int _id)
        while ( j != lista_lineas_out.end() ){
                if ( get_logic_item((*j).logic_id) != NULL )
                        if ( get_logic_item((*j).logic_id)->get_id() == _id ) {
-                               if (dynamic_cast<Not *>(get_logic_item((*i).logic_id))) 
-                                       get_logic_item((*j).logic_id)->set_in_connected(false);
                                lista_lineas_out.erase(j);
                                j = lista_lineas_out.begin();
                        }
                j++;
        }       
+       
+       std::list<t_line>::iterator k = lista_lineas_logic.begin();
+       while ( k != lista_lineas_logic.end() ){
+               if ( get_logic_item((*k).store_id) != NULL )
+                       if ( get_logic_item((*k).store_id)->get_id() == _id ) {
+                               get_logic_item((*k).logic_id)->set_out_connected(false);
+                               std::cout<< get_logic_item((*k).logic_id)->get_name() <<std::endl;
+                               lista_lineas_logic.erase(k);
+                               k = lista_lineas_logic.begin();
+                       }
+               k++;
+       }       
+
+       k = lista_lineas_logic.begin();
+       while ( k != lista_lineas_logic.end() ){
+               if ( get_logic_item((*k).logic_id) != NULL )
+                       if ( get_logic_item((*k).logic_id)->get_id() == _id ) {
+                               if (dynamic_cast<Not *>(get_logic_item((*k).store_id))) 
+                                       get_logic_item((*k).store_id)->set_in_connected(false);
+                               lista_lineas_logic.erase(k);
+                               k = lista_lineas_logic.begin();
+                       }
+               k++;
+       }       
 }
 
 void WorkPlace::update_logic_position()