[chronojump] ForceSensor itnerpolate path moved to new function



commit 2bde93a1cd613607f813034b9161495b4593adf4
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri May 14 10:23:04 2021 +0200

    ForceSensor itnerpolate path moved to new function

 src/gui/app1/forceSensor.cs | 69 +++++++++++++++++++++++----------------------
 1 file changed, 36 insertions(+), 33 deletions(-)
---
diff --git a/src/gui/app1/forceSensor.cs b/src/gui/app1/forceSensor.cs
index eb233cc3..561a4e79 100644
--- a/src/gui/app1/forceSensor.cs
+++ b/src/gui/app1/forceSensor.cs
@@ -2391,39 +2391,7 @@ LogB.Information(" fs R ");
                        fscPoints.Redo();
 
 
-               //draw interpolated feedback
-               if(interpolate_l != null)
-               {
-                       /*
-                       LogB.Information("fscPoints:");
-                       for(int k = 0; k < fscPoints.Points.Count; k ++)
-                               LogB.Information(string.Format("{0} ({1},{2})", k, fscPoints.Points[k].X, 
fscPoints.Points[k].Y));
-
-                       LogB.Information("paintPointsInterpolate:");
-                       */
-                       int timeCount = 0;
-                       int timeStep = (1000 * 
repetitiveConditionsWin.GetForceSensorFeedbackPathMasterSeconds/10) //if each 1000 ms, then: advance by 100 
(to have 10 interpolated between each master)
-                                               * 1000; //to micros
-
-                       List<Gdk.Point> paintPointsInterpolate = new List<Gdk.Point>();
-                       do {
-                               for(int interY = 0;
-                                               interY < interpolate_l.Count && timeCount < 
fscPoints.GetLastTime();
-                                               interY ++)
-                               {
-                                       paintPointsInterpolate.Add(new Gdk.Point(
-                                                       fscPoints.GetTimeInPx(timeCount), //note we are not 
using interpolate_l[*].X
-                                                       fscPoints.GetForceInPx(interpolate_l[interY].Y)
-                                                       ));
-
-                                       timeCount += timeStep;
-                               }
-                       } while (timeCount < fscPoints.GetLastTime());
-
-                       //paint the points
-                       force_capture_pixmap.DrawLines(pen_blue_light_force_capture_interpolated_feedback, 
paintPointsInterpolate.ToArray());
-               }
-
+               forceSensorDrawInterpolatedFeedback();
 
                forcePaintHVLines(ForceSensorGraphs.CAPTURE,
                                getForceSensorMaxForceIncludingRectangle(forceSensorValues.Max),
@@ -2462,6 +2430,41 @@ LogB.Information(" fs R ");
                button_force_sensor_analyze_analyze.Sensitive = true;
        }
 
+       private void forceSensorDrawInterpolatedFeedback ()
+       {
+               if(interpolate_l != null)
+               {
+                       /*
+                       LogB.Information("fscPoints:");
+                       for(int k = 0; k < fscPoints.Points.Count; k ++)
+                               LogB.Information(string.Format("{0} ({1},{2})", k, fscPoints.Points[k].X, 
fscPoints.Points[k].Y));
+
+                       LogB.Information("paintPointsInterpolate:");
+                       */
+                       int timeCount = 0;
+                       int timeStep = (1000 * 
repetitiveConditionsWin.GetForceSensorFeedbackPathMasterSeconds/10) //if each 1000 ms, then: advance by 100 
(to have 10 interpolated between each master)
+                                               * 1000; //to micros
+
+                       List<Gdk.Point> paintPointsInterpolate = new List<Gdk.Point>();
+                       do {
+                               for(int interY = 0;
+                                               interY < interpolate_l.Count && timeCount < 
fscPoints.GetLastTime();
+                                               interY ++)
+                               {
+                                       paintPointsInterpolate.Add(new Gdk.Point(
+                                                       fscPoints.GetTimeInPx(timeCount), //note we are not 
using interpolate_l[*].X
+                                                       fscPoints.GetForceInPx(interpolate_l[interY].Y)
+                                                       ));
+
+                                       timeCount += timeStep;
+                               }
+                       } while (timeCount < fscPoints.GetLastTime());
+
+                       //paint the points
+                       force_capture_pixmap.DrawLines(pen_blue_light_force_capture_interpolated_feedback, 
paintPointsInterpolate.ToArray());
+               }
+       }
+
        private void setForceSensorTopAtOperationStart()
        {
                if(preferences.forceSensorCaptureFeedbackActive)


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