]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blobdiff - Constructor/src/or.cpp
* Ahora el modelo carga las compuertas logicas y crea las lineas necesarias
[z.facultad/75.42/plaqui.git] / Constructor / src / or.cpp
index 4fdf2f2ae9636ae09ab0ca269f2c840263b9842e..4cbd5352a6d6ebd6c4192974bf0883e6add1accd 100644 (file)
@@ -1,19 +1,45 @@
 #include "or.h"
 
-Or::Or()
+Or::Or(int orientacion)
 {
+       is_logic = true;
        out_connected = false;
-       in_x = x;
-       in_y = y+16;
-       out_x = x+32;
-       out_y = y+16;
        imageN = Gdk::Pixbuf::create_from_file(PACKAGE_DATA_DIR"/plaqui-constructor/pixmaps/or_n.png");
        imageS = Gdk::Pixbuf::create_from_file(PACKAGE_DATA_DIR"/plaqui-constructor/pixmaps/or_s.png");
        imageE = Gdk::Pixbuf::create_from_file(PACKAGE_DATA_DIR"/plaqui-constructor/pixmaps/or_e.png");
        imageO = Gdk::Pixbuf::create_from_file(PACKAGE_DATA_DIR"/plaqui-constructor/pixmaps/or_o.png");
        null = Gdk::Pixbuf::create_from_file(PACKAGE_DATA_DIR"/plaqui-constructor/pixmaps/null.png");
-       imgActual = 0;
-       image = imageE;
+       imgActual = orientacion;
+       switch (imgActual) {
+               case 1:
+                       image = imageS;
+                       in_x = x +16;
+                       in_y = y;
+                       out_x = x+16;
+                       out_y = y+32;
+                       break;
+               case 2:
+                       image = imageO;
+                       in_x = x+32;
+                       in_y = y+16;
+                       out_x = x;
+                       out_y = y+16;
+                       break;
+               case 3:
+                       image = imageN;
+                       in_x = x+16;
+                       in_y = y+32;
+                       out_x = x+16;
+                       out_y = y;
+                       break;
+               default: 
+                       imgActual = 0;
+                       image = imageE;                 
+                       in_x = x;
+                       in_y = y+16;
+                       out_x = x+32;
+                       out_y = y+16;
+       }
        set_size_request(image->get_width(), image->get_height());
        name = "or";
        menulist.push_back( Gtk::Menu_Helpers::ImageMenuElem("Conectar", menu_image_linea,SigC::slot(*this, &CItem::on_menu_popup_conectar) ) ) ;