[chronojump] Inertial vscale much clearer showing direction change with two pixmaps



commit fb4cc573d6abb4c39f95678e569cd182217442a1
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Feb 24 10:14:42 2017 +0100

    Inertial vscale much clearer showing direction change with two pixmaps

 glade/app1.glade                |   77 ++++++++++++++++++++++++++++++++++++++-
 images/md/inertial_extended.png |  Bin 0 -> 425 bytes
 images/md/inertial_rolled.png   |  Bin 0 -> 591 bytes
 src/Makefile.am                 |    2 +
 src/gui/chronojump.cs           |    6 ++--
 src/gui/chronojumpIcons.cs      |    6 +++
 src/gui/encoder.cs              |   15 +++++---
 7 files changed, 95 insertions(+), 11 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 35ba6aa..429601b 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -16277,15 +16277,85 @@ then click this button.</property>
                                                           </packing>
                                                         </child>
                                                         <child>
-                                                          <widget class="GtkVScale" 
id="vscale_encoder_capture_inertial_angle_now">
+                                                          <widget class="GtkVBox" id="vbox_angle_now">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox35">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
+                                                            <widget class="GtkVBox" id="vbox53">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_inertial_extended">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property 
name="stock">gtk-missing-image</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_inertial_rolled">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property 
name="stock">gtk-missing-image</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="pack_type">end</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkVScale" 
id="vscale_encoder_capture_inertial_angle_now">
                                                             <property name="visible">True</property>
                                                             <property name="sensitive">False</property>
                                                             <property name="can_focus">True</property>
-                                                            <property name="adjustment">0 -100 100 1 1 
0</property>
+                                                            <property name="adjustment">0 0 100 1 1 
0</property>
                                                             <property 
name="restrict_to_fill_level">False</property>
                                                             <property name="fill_level">0</property>
                                                             <property name="round_digits">0</property>
                                                             <property name="digits">0</property>
+                                                            <property name="draw_value">False</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkLabel" 
id="label_encoder_capture_inertial_angle_now">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
                                                           </widget>
                                                           <packing>
                                                             <property name="expand">False</property>
@@ -19321,6 +19391,9 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/images/md/inertial_extended.png b/images/md/inertial_extended.png
new file mode 100644
index 0000000..37a75c8
Binary files /dev/null and b/images/md/inertial_extended.png differ
diff --git a/images/md/inertial_rolled.png b/images/md/inertial_rolled.png
new file mode 100644
index 0000000..b79d6ac
Binary files /dev/null and b/images/md/inertial_rolled.png differ
diff --git a/src/Makefile.am b/src/Makefile.am
index da06e79..be0dc4e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -383,6 +383,8 @@ RESOURCES = \
        ../images/md/ic_fitness_center_blue_24dp_1x.png,image_exercise.png \
        ../images/md/ic_keyboard_arrow_up_blue_24dp_1x.png,image_up.png \
        ../images/md/ic_keyboard_arrow_down_blue_24dp_1x.png,image_down.png \
+       ../images/md/inertial_rolled.png,inertial_rolled.png \
+       ../images/md/inertial_extended.png,inertial_extended.png \
        ../images/chronojump_icon.png,chronojump_icon.png \
        ../images/chronojump_icon_graph.png,chronojump_icon_graph.png \
        ../images/stock_right.png,stock_right.png \
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 2d1b9c5..1a2d9ed 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -2868,7 +2868,7 @@ public partial class ChronoJumpWindow
                                        radiobutton_encoder_analyze_neuromuscular_profile.Visible = true;
                                }
                                //hbox_encoder_capture_1_or_cont.Visible = true;
-                               vscale_encoder_capture_inertial_angle_now.Visible = false;
+                               vbox_angle_now.Visible = false;
 
                                if(! radiobutton_gravitatory_not_menu.Active)
                                {
@@ -2907,7 +2907,7 @@ public partial class ChronoJumpWindow
                                
                                radio_encoder_capture_1set.Active = true;
                                //hbox_encoder_capture_1_or_cont.Visible = false;
-                               vscale_encoder_capture_inertial_angle_now.Visible = true;
+                               vbox_angle_now.Visible = true;
 
                                if(! radiobutton_inertial_not_menu.Active)
                                {
@@ -3438,7 +3438,7 @@ public partial class ChronoJumpWindow
 
        void on_button_execute_test_clicked (object o, EventArgs args) 
        {
-               // stop capturing inertial on the background if we start capturing another test
+               // stop capturing inertial on the background if we start capturing a contacts test
                if(encoderThreadBG != null && encoderThreadBG.IsAlive)
                {
                        stopCapturingInertialBG();
diff --git a/src/gui/chronojumpIcons.cs b/src/gui/chronojumpIcons.cs
index eef06c5..7b59c85 100644
--- a/src/gui/chronojumpIcons.cs
+++ b/src/gui/chronojumpIcons.cs
@@ -53,6 +53,8 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Image image_encoder_exercise_add;
        [Widget] Gtk.Image image_encoder_exercise_edit;
        [Widget] Gtk.Image image_encoder_exercise_close;
+       [Widget] Gtk.Image image_inertial_rolled;
+       [Widget] Gtk.Image image_inertial_extended;
 
        private void putNonStandardIcons()
        {
@@ -154,6 +156,10 @@ public partial class ChronoJumpWindow
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_visibility.png");
                image_all_persons_events.Pixbuf = pixbuf;
 
+               pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "inertial_rolled.png");
+               image_inertial_rolled.Pixbuf = pixbuf;
+               pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "inertial_extended.png");
+               image_inertial_extended.Pixbuf = pixbuf;
 
                /*
                 * <------ end of material design icons
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index a0b998e..11693aa 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -75,6 +75,8 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Box hbox_encoder_capture_wait;
        [Widget] Gtk.Box vbox_encoder_capture_doing;
        [Widget] Gtk.VScale vscale_encoder_capture_inertial_angle_now;
+       [Widget] Gtk.VBox vbox_angle_now;
+       [Widget] Gtk.Label label_encoder_capture_inertial_angle_now;
        
        [Widget] Gtk.RadioButton radio_encoder_capture_1set;
        [Widget] Gtk.RadioButton radio_encoder_capture_cont;
@@ -5167,16 +5169,17 @@ public partial class ChronoJumpWindow
                                label_wait.Text = string.Format("Exercise will start in {0} seconds.", 3 - 
elapsed);
                }
 
-               //resize vscale if needed
                int newValue = eCaptureInertialBG.AngleNow;
-               int lower = Convert.ToInt32(vscale_encoder_capture_inertial_angle_now.Adjustment.Lower);
+               //resize vscale if needed
+               //0 is at the graphical top. abs(+-100) is on the bottom, but is called adjustment Upper
                int upper = Convert.ToInt32(vscale_encoder_capture_inertial_angle_now.Adjustment.Upper);
-
-               if(newValue < lower || newValue > upper)
-                       vscale_encoder_capture_inertial_angle_now.SetRange(lower * 2, upper *2);
+               if(Math.Abs(newValue) > upper)
+                       vscale_encoder_capture_inertial_angle_now.SetRange(0, upper *2);
 
                //update vscale value
-               vscale_encoder_capture_inertial_angle_now.Value = eCaptureInertialBG.AngleNow;
+               vscale_encoder_capture_inertial_angle_now.Value = Math.Abs(newValue);
+               label_encoder_capture_inertial_angle_now.Text = newValue.ToString();
+
 
                Thread.Sleep (100);
 


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