virtual void update_logic_position();
virtual void get_in_logic_connect_position(int& _a, int& _b);
virtual void get_out_logic_connect_position(int& _a, int& _b);
+ virtual bool get_out_logic_connect();
virtual void set_out_connected(bool _o);
virtual void draw_connectors();
private:
virtual void set_out_connected(bool _o);
virtual void set_in_connected(bool _o);
+ virtual bool get_out_logic_connect();
/**Dibuja los conectores logicos del Item, AZUL == SALIDA, ROJO == ENTRADA.
*/
virtual void draw_connectors();
virtual void update_logic_position();
virtual void get_in_logic_connect_position(int& _a, int& _b);
virtual void get_out_logic_connect_position(int& _a, int& _b);
+ virtual bool get_out_logic_connect();
virtual void set_out_connected(bool _o);
virtual void draw_connectors();
private:
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;
out_connected = _o;
}
+bool And::get_out_logic_connect()
+{
+ return out_connected;
+}
+
void And::draw_connectors()
{
Glib::RefPtr<Gdk::Window> window = get_window();
combo_entry->set_popdown_strings(*list_pointed);
combo_entry->get_entry()->set_text (name);
if (CItem::logic_connect && CItem::gate_id != -1) {
- if ( detect_click_position((int)event->x, (int)event->y) == IN ){
+ if ( detect_click_position((int)event->x, (int)event->y) == IN && !workplace->get_logic_item(CItem::gate_id)->get_out_logic_connect()){
tmp_line.logic_id = workplace->get_logic_item(CItem::gate_id)->get_id();
workplace->get_logic_item(CItem::gate_id)->set_out_connected(true);
tmp_line.store_id = ID;
combo_entry->set_popdown_strings(*list_pointed);
combo_entry->get_entry()->set_text (name);
if (CItem::logic_connect && CItem::gate_id != -1) {
- if ( detect_click_position((int)event->x, (int)event->y) == IN) {
- tmp_line.logic_id = workplace->get_logic_item(CItem::gate_id)->get_id();
+ if ( detect_click_position((int)event->x, (int)event->y) == IN && !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;
workplace->lista_lineas_in.push_back(tmp_line);
_b = y;
}
+bool CItem::get_out_logic_connect()
+{
+ return false;
+}
+
void CItem::update_logic_position()
{
}
t_line tmp_line;
if (CItem::logic_connect) {
if (CItem::gate_id != -1) {
- if ( detect_click_position((int)event->x, (int)event->y) == IN && !in_connected) {
+ if ( detect_click_position((int)event->x, (int)event->y) == IN && !in_connected && !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);
set_in_connected(true);
}
} else
CItem::gate_id = ID;
- }
- if ( CItem::logic_connect ) {
if ( detect_click_position((int)event->x, (int)event->y ) == OUT && !out_connected ) {
CItem::gate_id = ID;
}
t_line tmp_line;
if (CItem::logic_connect) {
if (CItem::gate_id != -1) {
- if ( detect_click_position((int)event->x, (int)event->y) == IN) {
+ if ( detect_click_position((int)event->x, (int)event->y) == IN && !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;
out_connected = _o;
}
+bool Or::get_out_logic_connect()
+{
+ return out_connected;
+}
+
void Or::draw_connectors()
{
Glib::RefPtr<Gdk::Window> window = get_window();
WorkPlace::pointed = ID;
std::cout<< "CItem::gate_id = "<<CItem::gate_id<<std::endl;
if (CItem::logic_connect && CItem::gate_id != -1) {
- if ( detect_click_position((int)event->x, (int)event->y) == IN) {
+ if ( detect_click_position((int)event->x, (int)event->y) == IN && !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;