[chronojump] racesEncoder: hidden camera and phases/time



commit 27c4eafc114b82b30eb9312352b71f5551071cc4
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Mar 15 11:48:41 2019 +0100

    racesEncoder: hidden camera and phases/time

 src/Makefile.am        |  1 +
 src/gui/chronojump.cs  | 22 ++++++++++++++++------
 src/gui/forceSensor.cs | 17 -----------------
 src/gui/webcam.cs      | 38 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 55 insertions(+), 23 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 0fa19f43..4f934e97 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -62,6 +62,7 @@ SOURCES = \
        gui/networks.cs\
        gui/usefulObjects.cs\
        gui/trigger.cs\
+       gui/webcam.cs\
        statType.cs\
        stats/main.cs\
        stats/chronojumpProfile.cs\
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 93a34542..fadc38cb 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -3448,16 +3448,29 @@ public partial class ChronoJumpWindow
                                }
                        }
                }
-               last_menuitem_mode_defined = true;
 
-               //notebooks_change also does this, but it's not called on encoder modes
-               showHideForceSensorControls(m == Constants.Menuitem_modes.FORCESENSOR);
+               //on capture, show phases, time, record if we are not on forcesensor mode
+               showHideCaptureSpecificControls (m);
+
+               last_menuitem_mode_defined = true;
 
                chronopicRegisterUpdate(false);
 
                chronojumpWindowTestsNext();
        }
 
+       //forceSensor and runEncoder have some specific stuff as they do not have DB yet
+       private void showHideCaptureSpecificControls(Constants.Menuitem_modes m)
+       {
+               hbox_capture_phases_time.Visible = (m != Constants.Menuitem_modes.FORCESENSOR && m != 
Constants.Menuitem_modes.RUNSENCODER);
+
+               showWebcamCapture (m != Constants.Menuitem_modes.FORCESENSOR && m != 
Constants.Menuitem_modes.RUNSENCODER);
+
+               menuitem_force_sensor_open_folder.Visible = (m == Constants.Menuitem_modes.FORCESENSOR);
+               menuitem_force_sensor_check_version.Visible = (m == Constants.Menuitem_modes.FORCESENSOR);
+       }
+
+
        void setEncoderTypePixbuf()
        {
                Pixbuf pixbuf;
@@ -6969,9 +6982,6 @@ LogB.Debug("mc finished 5");
                //LogB.Information("currentPage" + notebook_execute.CurrentPage.ToString());
                //LogB.Information("desiredPage" + desiredPage.ToString());
 
-               //on capture, show phases, time, record if we are not on forcesensor mode
-               showHideForceSensorControls(mode == Constants.Menuitem_modes.FORCESENSOR);
-
                if(mode == Constants.Menuitem_modes.JUMPSSIMPLE)
                {
                        notebook_execute.CurrentPage = 0;
diff --git a/src/gui/forceSensor.cs b/src/gui/forceSensor.cs
index ce773842..8e808bb9 100644
--- a/src/gui/forceSensor.cs
+++ b/src/gui/forceSensor.cs
@@ -75,8 +75,6 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.TextView textview_force_sensor_capture_comment;
        [Widget] Gtk.HBox hbox_force_sensor_lat_and_comments;
        [Widget] Gtk.Alignment alignment_force_sensor_adjust;
-       [Widget] Gtk.VSeparator vseparator_force_sensor_camera_space;
-       [Widget] Gtk.VBox vbox_contacts_camera;
        [Widget] Gtk.Button button_force_sensor_tare;
        [Widget] Gtk.Button button_force_sensor_calibrate;
        [Widget] Gtk.Label label_force_sensor_value_max;
@@ -1488,21 +1486,6 @@ LogB.Information(" re R ");
                        new DialogMessage(Constants.MessageTypes.WARNING, Constants.DirectoryCannotOpen);
        }
 
-       private void showHideForceSensorControls(bool modeForceSensor)
-       {
-               hbox_capture_phases_time.Visible = ! modeForceSensor;
-
-               //make it visible when camera works on force sensor (before we need database stuff for 
forcesensor)
-               //vseparator_force_sensor_camera_space.Visible = modeForceSensor; //extra space before camera 
on force sensor
-               vseparator_force_sensor_camera_space.Visible = false; //extra space before camera on force 
sensor
-               //vbox_contacts_camera.Visible = true; //should be visible on all contacts, but right now 
hide it on force sensor
-               vbox_contacts_camera.Visible = ! modeForceSensor;
-               button_video_play_this_test.Visible = ! modeForceSensor; //should be visible on all contacts, 
but right now hide it on force sensor
-
-               menuitem_force_sensor_open_folder.Visible = modeForceSensor;
-               menuitem_force_sensor_check_version.Visible = modeForceSensor;
-       }
-
        private void on_button_force_sensor_adjust_clicked (object o, EventArgs args)
        {
                hbox_force_capture_buttons.Sensitive = false;
diff --git a/src/gui/webcam.cs b/src/gui/webcam.cs
new file mode 100644
index 00000000..9d35f0dc
--- /dev/null
+++ b/src/gui/webcam.cs
@@ -0,0 +1,38 @@
+/*
+ * This file is part of ChronoJump
+ *
+ * ChronoJump is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or   
+ *    (at your option) any later version.
+ *    
+ * ChronoJump is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
+ *    GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Copyright (C) 2019   Xavier de Blas <xaviblas gmail com>
+ */
+
+using Gtk;
+//using Gdk;
+using Glade;
+
+public partial class ChronoJumpWindow 
+{
+       [Widget] Gtk.VSeparator vseparator_force_sensor_camera_space;
+       [Widget] Gtk.VBox vbox_contacts_camera;
+
+       //should be visible on all contacts, but right now hide it on force sensor and runEncoder
+       //but we need database stuff first
+       public void showWebcamCapture (bool show)
+       {
+               vseparator_force_sensor_camera_space.Visible = false; //extra space before camera on force 
sensor
+               vbox_contacts_camera.Visible = show;
+               button_video_play_this_test.Visible = show;
+       }
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]