[chronojump] Forcesensor: fixed moving AB on a zoom of 1 frame



commit 85b88ceb5b90f9b6ffffed9881179d50677ec4a8
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Feb 12 15:43:03 2020 +0100

    Forcesensor: fixed moving AB on a zoom of 1 frame

 src/gui/app1/forceSensorAnalyze.cs | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/src/gui/app1/forceSensorAnalyze.cs b/src/gui/app1/forceSensorAnalyze.cs
index e81c6bf9..d50a5f6b 100644
--- a/src/gui/app1/forceSensorAnalyze.cs
+++ b/src/gui/app1/forceSensorAnalyze.cs
@@ -660,9 +660,10 @@ public partial class ChronoJumpWindow
                forceSensorAIPlot();
 
                //ranges should have max value the number of the lines of csv file minus the header
-               hscale_force_sensor_ai_a.SetRange(1, fsAI.GetLength() -2);
-               hscale_force_sensor_ai_b.SetRange(1, fsAI.GetLength() -2);
-               hscale_force_sensor_ai_ab.SetRange(1, fsAI.GetLength() -2);
+               hscale_force_sensor_ai_a.SetRange(1, fsAI.GetLength() -1);
+               hscale_force_sensor_ai_b.SetRange(1, fsAI.GetLength() -1);
+               hscale_force_sensor_ai_ab.SetRange(1, fsAI.GetLength() -1);
+               LogB.Information(string.Format("hscale_force_sensor_ai_time_a,b,ab ranges: 1, {0}", 
fsAI.GetLength() -1));
 
                //on zoom put hscale B at the right
                if(zoomB >= 0)
@@ -1306,7 +1307,7 @@ public partial class ChronoJumpWindow
                        //if a or b are at max, don't move the ab to the right
                        //if a or b are at min, don't move the ab to the left
                        if(
-                                       ( difference > 0 && aValue < fsAI.GetLength() -2 && bValue < 
fsAI.GetLength() -2 ) ||
+                                       ( difference > 0 && aValue < fsAI.GetLength() -1 && bValue < 
fsAI.GetLength() -1 ) ||
                                        ( difference < 0 && aValue > 1 && bValue > 1 ) )
                        {
                                //move a and b
@@ -1330,10 +1331,10 @@ public partial class ChronoJumpWindow
                button_hscale_force_sensor_ai_b_first.Sensitive = hscale_force_sensor_ai_b.Value > 1;
                button_hscale_force_sensor_ai_b_pre.Sensitive = hscale_force_sensor_ai_b.Value > 1;
 
-               button_hscale_force_sensor_ai_a_last.Sensitive = hscale_force_sensor_ai_a.Value < 
fsAI.GetLength() -2;
-               button_hscale_force_sensor_ai_a_post.Sensitive = hscale_force_sensor_ai_a.Value < 
fsAI.GetLength() -2;
-               button_hscale_force_sensor_ai_b_last.Sensitive = hscale_force_sensor_ai_b.Value < 
fsAI.GetLength() -2;
-               button_hscale_force_sensor_ai_b_post.Sensitive = hscale_force_sensor_ai_b.Value < 
fsAI.GetLength() -2;
+               button_hscale_force_sensor_ai_a_last.Sensitive = hscale_force_sensor_ai_a.Value < 
fsAI.GetLength() -1;
+               button_hscale_force_sensor_ai_a_post.Sensitive = hscale_force_sensor_ai_a.Value < 
fsAI.GetLength() -1;
+               button_hscale_force_sensor_ai_b_last.Sensitive = hscale_force_sensor_ai_b.Value < 
fsAI.GetLength() -1;
+               button_hscale_force_sensor_ai_b_post.Sensitive = hscale_force_sensor_ai_b.Value < 
fsAI.GetLength() -1;
 
                button_force_sensor_ai_zoom.Sensitive = hscale_force_sensor_ai_a.Value != 
hscale_force_sensor_ai_b.Value;
        }
@@ -1352,7 +1353,7 @@ public partial class ChronoJumpWindow
        }
        private void on_button_hscale_force_sensor_ai_a_last_clicked (object o, EventArgs args)
        {
-               hscale_force_sensor_ai_a.Value = fsAI.GetLength() -2;
+               hscale_force_sensor_ai_a.Value = fsAI.GetLength() -1;
        }
 
        private void on_button_hscale_force_sensor_ai_b_first_clicked (object o, EventArgs args)
@@ -1369,7 +1370,7 @@ public partial class ChronoJumpWindow
        }
        private void on_button_hscale_force_sensor_ai_b_last_clicked (object o, EventArgs args)
        {
-               hscale_force_sensor_ai_b.Value = fsAI.GetLength() -2;
+               hscale_force_sensor_ai_b.Value = fsAI.GetLength() -1;
        }
 
        private void manage_force_sensor_ai_table_visibilities()


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