[chronojump] ForceSensor maximumIsometric force configurable % loss max force



commit 8e83344adaeae0ea03ac303ca78c7f79e69b2755
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Feb 3 16:28:05 2020 +0100

    ForceSensor maximumIsometric force configurable % loss max force

 glade/app1.glade              | 90 ++++++++++++++++++++++++++++++++++++++-----
 src/forceSensor.cs            |  8 ++--
 src/gui/app1/forceSensor.cs   |  5 ++-
 src/gui/forceSensorAnalyze.cs |  3 ++
 4 files changed, 91 insertions(+), 15 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index ec7208a5..ffe3b340 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -20123,8 +20123,13 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkRadioButton" 
id="radio_force_rfd_duration_percent">
-                                                            <property name="label" translatable="yes">Until 
5% decrease in max force</property>
+                                                            <widget class="GtkHBox" id="hbox241">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">6</property>
+                                                            <child>
+                                                            <widget class="GtkRadioButton" 
id="radio_force_duration_seconds">
+                                                            <property name="label" translatable="yes">Until 
this seconds:</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property 
name="receives_default">False</property>
@@ -20135,22 +20140,52 @@ Concentric</property>
                                                             <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkSpinButton" 
id="spin_force_duration_seconds">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="invisible_char">●</property>
+                                                            <property name="width_chars">3</property>
+                                                            <property 
name="primary_icon_activatable">False</property>
+                                                            <property 
name="secondary_icon_activatable">False</property>
+                                                            <property 
name="primary_icon_sensitive">True</property>
+                                                            <property 
name="secondary_icon_sensitive">True</property>
+                                                            <property name="adjustment">2 1 20 0.01 10 
0</property>
+                                                            <property name="climb_rate">1</property>
+                                                            <property name="digits">1</property>
+                                                            <property name="snap_to_ticks">True</property>
+                                                            <property name="numeric">True</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>
+                                                            <property name="fill">False</property>
                                                             <property name="position">1</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkHBox" id="hbox241">
+                                                            <widget class="GtkHBox" id="hbox356">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">6</property>
                                                             <child>
-                                                            <widget class="GtkRadioButton" 
id="radio_force_duration_seconds">
-                                                            <property name="label" translatable="yes">This 
seconds:</property>
+                                                            <widget class="GtkRadioButton" 
id="radio_force_rfd_duration_percent">
+                                                            <property name="label" translatable="yes">Until 
this decrease in max force:</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property 
name="receives_default">False</property>
+                                                            <property name="active">True</property>
                                                             <property name="draw_indicator">True</property>
-                                                            <property 
name="group">radio_force_rfd_duration_percent</property>
+                                                            <property 
name="group">radio_force_duration_seconds</property>
                                                             <signal name="toggled" 
handler="on_radio_force_rfd_duration_toggled" swapped="no"/>
                                                             </widget>
                                                             <packing>
@@ -20160,23 +20195,46 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkSpinButton" 
id="spin_force_duration_seconds">
+                                                            <widget class="GtkHBox" 
id="hbox_force_rfd_duration_percent">
                                                             <property name="visible">True</property>
                                                             <property name="sensitive">False</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">6</property>
+                                                            <child>
+                                                            <widget class="GtkSpinButton" 
id="spin_force_rfd_duration_percent">
+                                                            <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="invisible_char">●</property>
-                                                            <property name="width_chars">4</property>
+                                                            <property name="width_chars">1</property>
                                                             <property 
name="primary_icon_activatable">False</property>
                                                             <property 
name="secondary_icon_activatable">False</property>
                                                             <property 
name="primary_icon_sensitive">True</property>
                                                             <property 
name="secondary_icon_sensitive">True</property>
-                                                            <property name="adjustment">1 1 20 0.01 10 
0</property>
+                                                            <property name="adjustment">5 1 100 0.01 10 
0</property>
                                                             <property name="climb_rate">1</property>
-                                                            <property name="digits">2</property>
                                                             <property name="snap_to_ticks">True</property>
                                                             <property name="numeric">True</property>
                                                             </widget>
                                                             <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkLabel" id="label435">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label">%</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">False</property>
                                                             <property name="fill">False</property>
                                                             <property name="position">1</property>
@@ -23121,6 +23179,12 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -32715,6 +32779,12 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/src/forceSensor.cs b/src/forceSensor.cs
index 48e1d4d6..02c98903 100644
--- a/src/forceSensor.cs
+++ b/src/forceSensor.cs
@@ -1234,7 +1234,7 @@ public class ForceSensorGraph
        List<ForceSensorRFD> rfdList;
        ForceSensorImpulse impulse;
        double averageLength;
-       double percentChange;
+       int percentChange;
        bool vlineT0;
        bool vline50fmax_raw;
        bool vline50fmax_fitted;
@@ -1246,18 +1246,18 @@ public class ForceSensorGraph
        string datetime;
 
        public ForceSensorGraph(ForceSensor.CaptureOptions fsco, List<ForceSensorRFD> rfdList,
-                       ForceSensorImpulse impulse, int testLength, string title, string exercise, string 
datetime)
+                       ForceSensorImpulse impulse, int testLength, int percentChange, string title, string 
exercise, string datetime)
        {
                this.fsco = fsco;
                this.rfdList = rfdList;
                this.impulse = impulse;
                this.testLength = testLength;
+               this.percentChange = percentChange;
                this.title = title;
                this.exercise = exercise;
                this.datetime = datetime;
 
                averageLength = 0.1;
-               percentChange = 5;
                vlineT0 = false;
                vline50fmax_raw = false;
                vline50fmax_fitted = false;
@@ -1287,7 +1287,7 @@ public class ForceSensorGraph
                        "#graphWidth\n" +               graphWidth.ToString() + "\n" +
                        "#graphHeight\n" +              graphHeight.ToString() + "\n" +
                        "#averageLength\n" +            Util.ConvertToPoint(averageLength) + "\n" +
-                       "#percentChange\n" +            Util.ConvertToPoint(percentChange) + "\n" +
+                       "#percentChange\n" +            percentChange.ToString() + "\n" +
                        "#vlineT0\n" +                  Util.BoolToRBool(vlineT0) + "\n" +
                        "#vline50fmax.raw\n" +          Util.BoolToRBool(vline50fmax_raw) + "\n" +
                        "#vline50fmax.fitted\n" +       Util.BoolToRBool(vline50fmax_fitted) + "\n" +
diff --git a/src/gui/app1/forceSensor.cs b/src/gui/app1/forceSensor.cs
index d8327285..369f341f 100644
--- a/src/gui/app1/forceSensor.cs
+++ b/src/gui/app1/forceSensor.cs
@@ -1767,7 +1767,9 @@ LogB.Information(" fs R ");
                //else
                //      title = Util.RemoveChar(title, '_');
 
-               ForceSensorGraph fsg = new ForceSensorGraph(getForceSensorCaptureOptions(), rfdList, impulse, 
duration, title, exercise, currentForceSensor.DateTimePublic);
+               ForceSensorGraph fsg = new ForceSensorGraph(getForceSensorCaptureOptions(), rfdList, impulse,
+                               duration, Convert.ToInt32(spin_force_rfd_duration_percent.Value),
+                               title, exercise, currentForceSensor.DateTimePublic);
 
                int imageWidth = UtilGtk.WidgetWidth(viewport_force_sensor_graph);
                int imageHeight = UtilGtk.WidgetHeight(viewport_force_sensor_graph);
@@ -2102,6 +2104,7 @@ LogB.Information(" fs R ");
        private void on_radio_force_rfd_duration_toggled (object o, EventArgs args)
        {
                spin_force_duration_seconds.Sensitive = radio_force_duration_seconds.Active;
+               hbox_force_rfd_duration_percent.Sensitive = radio_force_rfd_duration_percent.Active;
        }
 
        private void on_button_force_sensor_image_save_signal_clicked (object o, EventArgs args)
diff --git a/src/gui/forceSensorAnalyze.cs b/src/gui/forceSensorAnalyze.cs
index 3b0f2fca..f9a71b9d 100644
--- a/src/gui/forceSensorAnalyze.cs
+++ b/src/gui/forceSensorAnalyze.cs
@@ -45,6 +45,9 @@ public partial class ChronoJumpWindow
 
        [Widget] Gtk.SpinButton spin_force_duration_seconds;
        [Widget] Gtk.RadioButton radio_force_duration_seconds;
+       [Widget] Gtk.HBox hbox_force_rfd_duration_percent;
+       [Widget] Gtk.RadioButton radio_force_rfd_duration_percent;
+       [Widget] Gtk.SpinButton spin_force_rfd_duration_percent;
 
        //analyze options
        [Widget] Gtk.Notebook notebook_force_sensor_analyze; //decide between automatic and manual


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