[chronojump] Fixed forceSensorExercise tabs next/prev since isometric/elastic separation



commit c64e621836adf5a7f6fe03a1f382d43815f32915
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Jul 14 12:32:36 2022 +0200

    Fixed forceSensorExercise tabs next/prev since isometric/elastic separation

 glade/force_sensor_exercise.glade |  8 ++++----
 src/gui/forceSensorExercise.cs    | 28 +++++++++++++++++++---------
 2 files changed, 23 insertions(+), 13 deletions(-)
---
diff --git a/glade/force_sensor_exercise.glade b/glade/force_sensor_exercise.glade
index 29dd7d8f0..3fcd47ca6 100644
--- a/glade/force_sensor_exercise.glade
+++ b/glade/force_sensor_exercise.glade
@@ -101,7 +101,7 @@
                 <property name="can_focus">True</property>
                 <property name="show_tabs">False</property>
                 <child>
-                  <widget class="GtkVBox" id="vbox1">
+                  <widget class="GtkVBox" id="vbox_force">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="border_width">8</property>
@@ -224,7 +224,7 @@
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkVBox" id="vbox3">
+                  <widget class="GtkVBox" id="vbox_fixation">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="border_width">8</property>
@@ -319,7 +319,7 @@
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkVBox" id="vbox5">
+                  <widget class="GtkVBox" id="vbox_mass">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="border_width">8</property>
@@ -1096,7 +1096,7 @@
                         <property name="spacing">16</property>
                         <child>
                           <widget class="GtkRadioButton" id="radio_reps_show_concentric">
-                            <property name="label" translatable="yes">Show only concentric phase</property>
+                            <property name="label" translatable="yes">Show only the phase in which the force 
increases</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">False</property>
diff --git a/src/gui/forceSensorExercise.cs b/src/gui/forceSensorExercise.cs
index e56a44e33..63b95fbdb 100644
--- a/src/gui/forceSensorExercise.cs
+++ b/src/gui/forceSensorExercise.cs
@@ -430,7 +430,7 @@ public class ForceSensorExerciseWindow
                else if(o == Options.REPETITIONS_NO_PREFS)
                        str = Catalog.GetString("These values will be used to detect repetitions.");
                else if(o == Options.REPETITIONS_SHOW)
-                       str = Catalog.GetString("Detected repetitions will show only concentric phase or 
both.");
+                       str = Catalog.GetString("Detected repetitions will show only the phase in which the 
force increases or also where decreases.");
                else //if(o == Options.OTHER)
                        str = Catalog.GetString("0 means horizontally") + "\n" +
                                Catalog.GetString("90 means vertically with the person above the sensor") + 
"\n" +
@@ -664,10 +664,14 @@ public class ForceSensorExerciseWindow
 
        private void on_button_next_clicked (object o, EventArgs args)
        {
-               if(notebook_main.CurrentPage == Convert.ToInt32(Pages.FORCE))
-                       //&& radio_force_sensor_raw.Active) do not ask about elastic. Since 2.2.2 depends on 
mode
-                       notebook_main.CurrentPage = Convert.ToInt32(Pages.REPSDETECT);
-               else if(notebook_main.CurrentPage < Convert.ToInt32(Pages.OTHER))
+               // do not ask about elastic. Since 2.2.2 depends on mode
+               if (notebook_main.CurrentPage == Convert.ToInt32 (Pages.FORCE))
+               {
+                       if (radio_force_sensor_raw.Active)
+                               notebook_main.CurrentPage = Convert.ToInt32 (Pages.REPSDETECT);
+                       else //if (radio_force_resultant.Active)
+                               notebook_main.CurrentPage = Convert.ToInt32 (Pages.MASS);
+               } else if (notebook_main.CurrentPage < Convert.ToInt32 (Pages.OTHER))
                        notebook_main.CurrentPage ++;
                else
                        return;
@@ -676,10 +680,16 @@ public class ForceSensorExerciseWindow
        }
        private void on_button_back_clicked (object o, EventArgs args)
        {
-               if(notebook_main.CurrentPage == Convert.ToInt32(Pages.REPSDETECT))
-                       //&& radio_force_sensor_raw.Active) do not ask about elastic. Since 2.2.2 depends on 
mode
-                       notebook_main.CurrentPage = Convert.ToInt32(Pages.FORCE);
-               else if(notebook_main.CurrentPage > Convert.ToInt32(Pages.FORCE))
+               // do not ask about elastic. Since 2.2.2 depends on mode
+               if (notebook_main.CurrentPage == Convert.ToInt32 (Pages.REPSDETECT))
+               {
+                       if (radio_force_sensor_raw.Active)
+                               notebook_main.CurrentPage = Convert.ToInt32 (Pages.FORCE);
+                       else //if (radio_force_resultant.Active)
+                               notebook_main.CurrentPage = Convert.ToInt32 (Pages.MASS);
+               } else if (notebook_main.CurrentPage == Convert.ToInt32 (Pages.MASS))
+                       notebook_main.CurrentPage = Convert.ToInt32 (Pages.FORCE);
+               else if (notebook_main.CurrentPage > Convert.ToInt32 (Pages.FORCE))
                        notebook_main.CurrentPage --;
                else
                        return;


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