[chronojump] ForceSensor path does not start at 0 anymore



commit f94abf73e21770b28a9358fbea7e7739142bc54d
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon May 31 10:54:17 2021 +0200

    ForceSensor path does not start at 0 anymore

 src/gui/app1/forceSensor.cs | 1 -
 src/utilMath.cs             | 8 ++------
 2 files changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/src/gui/app1/forceSensor.cs b/src/gui/app1/forceSensor.cs
index 92f8b981d..51288b52f 100644
--- a/src/gui/app1/forceSensor.cs
+++ b/src/gui/app1/forceSensor.cs
@@ -2206,7 +2206,6 @@ LogB.Information(" fs R ");
                        preferences.forceSensorFeedbackPathMasterSeconds;
 
                InterpolateSignal interpolateS = new InterpolateSignal(
-                               true, //start at 0
                                preferences.forceSensorFeedbackPathMin,
                                preferences.forceSensorFeedbackPathMax,
                                maxx * 1000,
diff --git a/src/utilMath.cs b/src/utilMath.cs
index fcb88d22d..e4d51e479 100644
--- a/src/utilMath.cs
+++ b/src/utilMath.cs
@@ -446,8 +446,7 @@ public class InterpolateSignal
        {
                this.point_l = point_l;
        }
-       //TODO: if startAt0, do not create the point_l[0] = 0, because it will be repeated each cycle
-       public InterpolateSignal (bool startAt0, int minY, int maxY, int maxX, int stepX)
+       public InterpolateSignal (int minY, int maxY, int maxX, int stepX)
        {
                Random random = new Random();
                this.point_l = new List<PointF>();
@@ -457,10 +456,7 @@ public class InterpolateSignal
 
                for(int i = 0; i < maxX; i += stepX)
                {
-                       if(startAt0 && i == 0)
-                               point_l.Add(new PointF(i, 0));
-                       else
-                               point_l.Add(new PointF(i, minY + (random.NextDouble() * range)));
+                       point_l.Add(new PointF(i, minY + (random.NextDouble() * range)));
 
                        /*
                        PointF p = new PointF(i, minY + (random.NextDouble() * range));


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