[chronojump] ForceSensor AIgraph uses exercise cut reps criteria



commit 4358eaa34437f0033b170b1bbc77fc96ccd79b51
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Feb 24 12:24:30 2020 +0100

    ForceSensor AIgraph uses exercise cut reps criteria

 src/forceSensor.cs                 | 13 +++++++++++++
 src/gui/app1/forceSensorAnalyze.cs | 17 +++++++----------
 src/gui/forceSensorExercise.cs     |  1 -
 3 files changed, 20 insertions(+), 11 deletions(-)
---
diff --git a/src/forceSensor.cs b/src/forceSensor.cs
index b3ff84c3..8cc08006 100644
--- a/src/forceSensor.cs
+++ b/src/forceSensor.cs
@@ -516,6 +516,19 @@ public class ForceSensorExercise
                get { return conMin; }
        }
 
+       public double GetEccOrConMinMaybePreferences(bool ecc, double prefsMinDispl, int prefsMinForce)
+       {
+               if(ecc && eccMin >= 0)
+                       return eccMin;
+               if(! ecc && conMin >= 0)
+                       return conMin;
+
+               if(ComputeAsElastic)
+                       return prefsMinDispl;
+               else
+                       return prefsMinForce;
+       }
+
 }
 
 public class ForceSensorElasticBand
diff --git a/src/gui/app1/forceSensorAnalyze.cs b/src/gui/app1/forceSensorAnalyze.cs
index 36991262..b62addb9 100644
--- a/src/gui/app1/forceSensorAnalyze.cs
+++ b/src/gui/app1/forceSensorAnalyze.cs
@@ -629,16 +629,13 @@ public partial class ChronoJumpWindow
                }
 
                //pass them as doubles
-               double eccMinDispl;
-               double conMinDispl;
-               if(currentForceSensorExercise.ComputeAsElastic)
-               {
-                       eccMinDispl = preferences.forceSensorElasticEccMinDispl;
-                       conMinDispl = preferences.forceSensorElasticConMinDispl;
-               } else {
-                       eccMinDispl = preferences.forceSensorNotElasticEccMinForce;
-                       conMinDispl = preferences.forceSensorNotElasticConMinForce;
-               }
+               double eccMinDispl = currentForceSensorExercise.GetEccOrConMinMaybePreferences(true,
+                               preferences.forceSensorElasticEccMinDispl,
+                               preferences.forceSensorNotElasticEccMinForce);
+               double conMinDispl = currentForceSensorExercise.GetEccOrConMinMaybePreferences(false,
+                               preferences.forceSensorElasticConMinDispl,
+                               preferences.forceSensorNotElasticConMinForce);
+               LogB.Information(string.Format("eccMinDispl: {0}, conMinDispl: {1}", eccMinDispl, 
conMinDispl));
 
                //LogB.Information(string.Format("creating fsAI with zoomA: {0}, zoomB: {1}", zoomA, zoomB));
                fsAI = new ForceSensorAnalyzeInstant(
diff --git a/src/gui/forceSensorExercise.cs b/src/gui/forceSensorExercise.cs
index 22bd3ccd..b368aff2 100644
--- a/src/gui/forceSensorExercise.cs
+++ b/src/gui/forceSensorExercise.cs
@@ -697,7 +697,6 @@ public class ForceSensorExerciseWindow
                get { return fakeButtonReadValues; }
        }
 
-       //at the moment only name will be used
        public ForceSensorExercise Exercise
        {
                get { return exercise; }


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