[chronojump] forceSensor signal graph better left margin and 21 hor. lines



commit ed91304b3d474527f35428ee13f2d543021c5939
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Dec 20 18:22:26 2017 +0100

    forceSensor signal graph better left margin and 21 hor. lines

 src/forceSensor.cs     |    2 +-
 src/gui/forceSensor.cs |   18 +++++++++++++-----
 2 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/src/forceSensor.cs b/src/forceSensor.cs
index d59a785..800b78d 100644
--- a/src/forceSensor.cs
+++ b/src/forceSensor.cs
@@ -44,7 +44,7 @@ public class ForceSensorCapturePoints
 
        private int widthG;
        private int heightG;
-       private int marginLeft = 30; //px
+       private int marginLeft = 45; //px
        private int marginRight = 30; //px
 
        //initialize
diff --git a/src/gui/forceSensor.cs b/src/gui/forceSensor.cs
index 9040896..f3e0f33 100644
--- a/src/gui/forceSensor.cs
+++ b/src/gui/forceSensor.cs
@@ -1118,11 +1118,19 @@ LogB.Information(" fc R ");
                if(Math.Abs(minForce) > absoluteMaxForce)
                        absoluteMaxForce = Math.Abs(minForce);
 
-               int step = 100;
-               if(absoluteMaxForce < 200)
-                       step = 50;
-               if(absoluteMaxForce < 100)
-                       step = 25;
+               //show 10 steps positive, 10 negative
+               int temp = Convert.ToInt32(absoluteMaxForce / 10.0);
+               int step = temp;
+               if(step <= 10)
+                       step = temp;
+               else if(step <= 100)
+                       step = temp - (temp % 10);
+               else if(step <= 1000)
+                       step = temp - (temp % 100);
+               else if(step <= 10000)
+                       step = temp - (temp % 1000);
+               else //if(step <= 100000)
+                       step = temp - (temp % 10000);
 
                for(int i = step; i <= absoluteMaxForce ; i += step)
                {


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