X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/3314f9284024c7bb9e618f310ca467a93990922d..20f30a0ae955fb71428ab382aeaf025a5f93b7e1:/Constructor/src/workplace.cpp?ds=inline diff --git a/Constructor/src/workplace.cpp b/Constructor/src/workplace.cpp index 206bca3..2dccaa3 100644 --- a/Constructor/src/workplace.cpp +++ b/Constructor/src/workplace.cpp @@ -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(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(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::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() <get_id() == _id ) { + if (dynamic_cast(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()