[Jderobot-admin] jderobot-r1103 - trunk/src/testing/components/teleoperator

lr.morales en jderobot.org lr.morales en jderobot.org
Mar Nov 12 01:25:39 CET 2013


Author: lr.morales
Date: 2013-11-12 01:25:39 +0100 (Tue, 12 Nov 2013)
New Revision: 1103

Modified:
   trunk/src/testing/components/teleoperator/Gui.cpp
   trunk/src/testing/components/teleoperator/Gui.h
Log:
#115 Adds handlers for closing motors, encoders and laser windows


Modified: trunk/src/testing/components/teleoperator/Gui.cpp
===================================================================
--- trunk/src/testing/components/teleoperator/Gui.cpp	2013-11-12 00:19:07 UTC (rev 1102)
+++ trunk/src/testing/components/teleoperator/Gui.cpp	2013-11-12 00:25:39 UTC (rev 1103)
@@ -58,6 +58,7 @@
     this->motors_canvas->signal_event().connect(sigc::mem_fun(this, &Gui::on_button_press_motors_canvas));
     this->stop_button->signal_clicked().connect(sigc::mem_fun(this, &Gui::stop_button_clicked));
     this->check_motors->signal_toggled().connect(sigc::mem_fun(this, &Gui::check_motors_clicked));
+    this->motors_window->signal_hide().connect(sigc::mem_fun(this, &Gui::on_motors_window_hide));
     //Init widgets
     this->motors_canvas->add_events(Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::VISIBILITY_NOTIFY_MASK | Gdk::BUTTON1_MOTION_MASK);
     this->motors_canvas->get_size_request(this->previous_event_x, this->previous_event_y);
@@ -70,6 +71,7 @@
     this->builder->get_widget("check_encoders", this->check_encoders);
     //SIGNALS
     this->check_encoders->signal_toggled().connect(sigc::mem_fun(this, &Gui::check_encoders_clicked));
+    this->encoders_window->signal_hide().connect(sigc::mem_fun(this, &Gui::on_encoders_window_hide));
     //LABELS
     this->builder->get_widget("encoders_x", this->encoders_x);
     this->builder->get_widget("encoders_y", this->encoders_y);
@@ -85,6 +87,7 @@
     this->builder->get_widget("check_laser", this->check_laser);
     //SIGNALS
     this->check_laser->signal_toggled().connect(sigc::mem_fun(this, &Gui::check_laser_clicked));
+    this->laser_window->signal_hide().connect(sigc::mem_fun(this, &Gui::on_laser_window_hide));
     //END_LASER
 
     //CAMERAS
@@ -392,6 +395,22 @@
     }
 }
 
+void Gui::on_motors_window_hide(){
+    if(check_motors->get_active())
+        this->check_motors->set_active(false);
+}
+
+void Gui::on_encoders_window_hide(){
+    if(check_encoders->get_active())
+        this->check_encoders->set_active(false);
+}
+
+void Gui::on_laser_window_hide(){
+    if(check_laser->get_active())
+        this->check_laser->set_active(false);
+}
+
+
 void Gui::stop_button_clicked() {
     this->previous_event_x = 100;
     this->previous_event_y = 100;

Modified: trunk/src/testing/components/teleoperator/Gui.h
===================================================================
--- trunk/src/testing/components/teleoperator/Gui.h	2013-11-12 00:19:07 UTC (rev 1102)
+++ trunk/src/testing/components/teleoperator/Gui.h	2013-11-12 00:25:39 UTC (rev 1103)
@@ -56,6 +56,7 @@
     Gtk::CheckButton* check_motors;
     bool motorsShowed;
     bool on_button_press_motors_canvas(GdkEvent* event);
+    void on_motors_window_hide();
     void stop_button_clicked();
     int previous_event_x, previous_event_y, cameras_previous_event_x, cameras_previous_event_y;
     void displayMotorsData();
@@ -79,6 +80,7 @@
     Gtk::Label* encoders_y;
     Gtk::Label* encoders_theta;
     bool encodersShowed;
+    void on_encoders_window_hide();
     void displayEncodersData();
     void check_encoders_clicked();
     //END_ENCODERS   
@@ -87,6 +89,7 @@
     Gtk::DrawingArea* laser_canvas;
     Gtk::Window* laser_window;
     Gtk::ToggleButton* check_laser;
+    void on_laser_window_hide();
     void check_laser_clicked();
     void drawLaser();
     bool laserShowed;



More information about the Jderobot-admin mailing list