]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blobdiff - Constructor/src/and.cpp
-Arregle un poco el tema de que cada compuerta puede tener una sola salida
[z.facultad/75.42/plaqui.git] / Constructor / src / and.cpp
index 3e5287695cbfc2d7f243d50b45d2f443b128157c..927aa6158f00171ab3c189f21041efc2a3dfe220 100644 (file)
@@ -57,7 +57,7 @@ bool And::on_button_press_event(GdkEventButton *event)
                std::cout << CItem::gate_id << std::endl;
                if (CItem::logic_connect) {
                        if (CItem::gate_id != -1 ) {
                std::cout << CItem::gate_id << std::endl;
                if (CItem::logic_connect) {
                        if (CItem::gate_id != -1 ) {
-                               if ( detect_click_position((int)event->x, (int)event->y ) == IN && CItem::gate_id != ID ) {
+                               if ( detect_click_position((int)event->x, (int)event->y ) == IN && CItem::gate_id != ID && !workplace->get_logic_item(CItem::gate_id)->get_out_logic_connect()) {
                                        tmp_line.logic_id =  CItem::gate_id;
                                        workplace->get_logic_item(CItem::gate_id)->set_out_connected(true);
                                        tmp_line.store_id = ID;
                                        tmp_line.logic_id =  CItem::gate_id;
                                        workplace->get_logic_item(CItem::gate_id)->set_out_connected(true);
                                        tmp_line.store_id = ID;
@@ -263,6 +263,11 @@ void And::set_out_connected(bool _o)
        out_connected = _o;
 }
 
        out_connected = _o;
 }
 
+bool And::get_out_logic_connect()
+{
+       return out_connected;
+}
+
 void And::draw_connectors()
 {
        Glib::RefPtr<Gdk::Window> window = get_window();
 void And::draw_connectors()
 {
        Glib::RefPtr<Gdk::Window> window = get_window();