[chronojump] ForceSensor better AI position Y values



commit f803c2f048405d513d63b0f249d3808dad41e31a
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Feb 26 12:13:18 2020 +0100

    ForceSensor better AI position Y values

 src/forceSensor.cs | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/src/forceSensor.cs b/src/forceSensor.cs
index 8f21f97b..cb2de7aa 100644
--- a/src/forceSensor.cs
+++ b/src/forceSensor.cs
@@ -737,7 +737,7 @@ public class ForceSensorCapturePoints
        public int NumPainted;
 
        public enum GraphTypes { FORCESIGNAL, FORCEAIFORCE, FORCEAIDISPL }
-       private GraphTypes graphType; //useful to debug
+       private GraphTypes graphType;
 
        //used to redo all points if change RealWidthG or RealHeightG
        private List<int> times;
@@ -753,6 +753,10 @@ public class ForceSensorCapturePoints
        public int RealHeightG; //Newtons (will be upgraded if needed)
        public int RealHeightGNeg; //Newtons (negative) (will be upgraded if needed)
 
+       //for displacement
+       public const int DefaultRealHeightGDispl = 1;
+       public const int DefaultRealHeightGNegDispl = 0;
+
        private int widthG;
        private int heightG;
        private int marginLeft = 45; //px
@@ -789,6 +793,12 @@ public class ForceSensorCapturePoints
 
                RealHeightG = DefaultRealHeightG; //Newtons (will be upgraded when needed) (nice to see the 
+25 -25 marks)
                RealHeightGNeg = DefaultRealHeightGNeg; //Newtons (will be upgraded when needed) (nice to see 
the +25 -25 marks)
+
+               if(graphType == GraphTypes.FORCEAIDISPL)
+               {
+                       RealHeightG = DefaultRealHeightGDispl;
+                       RealHeightGNeg = DefaultRealHeightGNegDispl;
+               }
        }
 
        public void Add(int time, double force)


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