From 20f30a0ae955fb71428ab382aeaf025a5f93b7e1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicol=C3=A1s=20Dimov?= Date: Sun, 30 Nov 2003 17:04:54 +0000 Subject: [PATCH] se arregla el bug de la NOT --- Constructor/src/cistern.cpp | 2 +- Constructor/src/exclusa.cpp | 2 +- Constructor/src/not.cpp | 6 +++++- Constructor/src/pump.cpp | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Constructor/src/cistern.cpp b/Constructor/src/cistern.cpp index 78b0355..3240c3d 100644 --- a/Constructor/src/cistern.cpp +++ b/Constructor/src/cistern.cpp @@ -60,7 +60,7 @@ bool Cistern::on_button_press_event(GdkEventButton *event) workplace->queue_draw(); } else if (detect_click_position((int)event->x, (int)event->y) == OUT ) { if (dynamic_cast(workplace->get_logic_item(CItem::gate_id))) { - if ( !dynamic_cast(workplace->get_logic_item(CItem::gate_id))->get_out_logic_connect()) { + if ( !dynamic_cast(workplace->get_logic_item(CItem::gate_id))->get_in_logic_connect()) { workplace->get_logic_item(CItem::gate_id)->set_in_connected(true); tmp_line.logic_id = CItem::gate_id; tmp_line.store_id = ID; diff --git a/Constructor/src/exclusa.cpp b/Constructor/src/exclusa.cpp index 5fc6cee..5eb4ead 100644 --- a/Constructor/src/exclusa.cpp +++ b/Constructor/src/exclusa.cpp @@ -55,7 +55,7 @@ bool Exclusa::on_button_press_event(GdkEventButton *event) workplace->queue_draw(); } else if (detect_click_position((int)event->x, (int)event->y) == OUT ) { if (dynamic_cast(workplace->get_logic_item(CItem::gate_id))) { - if (!dynamic_cast(workplace->get_logic_item(CItem::gate_id))->get_out_logic_connect()) { + if (!dynamic_cast(workplace->get_logic_item(CItem::gate_id))->get_in_logic_connect()) { workplace->get_logic_item(CItem::gate_id)->set_in_connected(true); tmp_line.logic_id = CItem::gate_id; tmp_line.store_id = ID; diff --git a/Constructor/src/not.cpp b/Constructor/src/not.cpp index 679f9df..2be71fe 100644 --- a/Constructor/src/not.cpp +++ b/Constructor/src/not.cpp @@ -51,7 +51,6 @@ Not::~Not() bool Not::on_button_press_event(GdkEventButton *event) { - if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 1)) { WorkPlace::pointed = ID; t_line tmp_line; @@ -304,6 +303,11 @@ bool Not::get_out_logic_connect() return out_connected; } +bool Not::get_in_logic_connect() +{ + return in_connected; +} + void Not::draw_connectors() { Glib::RefPtr window = get_window(); diff --git a/Constructor/src/pump.cpp b/Constructor/src/pump.cpp index 793df76..fb827d3 100644 --- a/Constructor/src/pump.cpp +++ b/Constructor/src/pump.cpp @@ -57,7 +57,7 @@ bool Pump::on_button_press_event(GdkEventButton *event) workplace->queue_draw(); } else if (detect_click_position((int)event->x, (int)event->y) == OUT ) { if (dynamic_cast(workplace->get_logic_item(CItem::gate_id))) { - if ( !dynamic_cast(workplace->get_logic_item(CItem::gate_id))->get_out_logic_connect()) { + if ( !dynamic_cast(workplace->get_logic_item(CItem::gate_id))->get_in_logic_connect()) { workplace->get_logic_item(CItem::gate_id)->set_in_connected(true); tmp_line.logic_id = CItem::gate_id; tmp_line.store_id = ID; -- 2.43.0