[chronojump] forceSensorAnalyze manual if only A show instant RFD



commit 840ffcc4a10a4cefe85c54856b7528db86f54312
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon May 7 16:07:46 2018 +0200

    forceSensorAnalyze manual if only A show instant RFD

 src/gui/forceSensorAnalyze.cs |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/src/gui/forceSensorAnalyze.cs b/src/gui/forceSensorAnalyze.cs
index 1fd21a7..aea2e32 100644
--- a/src/gui/forceSensorAnalyze.cs
+++ b/src/gui/forceSensorAnalyze.cs
@@ -712,11 +712,27 @@ public partial class ChronoJumpWindow
                                        layout_force_ai_text);
                }
 
+               // 5) if only A calculate RFD and exit
                if(! checkbutton_force_sensor_ai_b.Active)
+               {
+                       //calculate the instantaneous RFD of A and return
+                       int instant = Convert.ToInt32(hscale_force_sensor_ai_a.Value);
+                       if(instant > 0 && instant < fsAI.GetLength() -1)
+                       {
+                               layout_force_ai_text.SetMarkup(string.Format("RFD: {0:0.#} N/s",
+                                                       Math.Round(fsAI.CalculateRFD(instant -1, instant +1), 
1) ));
+                               textWidth = 1;
+                               textHeight = 1;
+                               layout_force_ai_text.GetPixelSize(out textWidth, out textHeight);
+                               force_sensor_ai_pixmap.DrawLayout (pen_blue_force_ai,
+                                               allocation.Width -textWidth -10, allocation.Height/2 -20,
+                                               layout_force_ai_text);
+                       }
                        return;
+               }
 
                /*
-                * 5) Invert AB if needed to paint correctly blue and red lines
+                * 6) Invert AB if needed to paint correctly blue and red lines
                 * making it work also when B is higher than A
                 */
                if(hscaleLower > hscaleHigher)
@@ -730,7 +746,7 @@ public partial class ChronoJumpWindow
 
                if(hscaleHigher != hscaleLower)
                {
-                       //6) calculate and paint RFD
+                       //7) calculate and paint RFD
                        double forceA = fsAI.GetForce(hscaleLower);
                        double forceB = fsAI.GetForce(hscaleHigher);
 
@@ -747,7 +763,7 @@ public partial class ChronoJumpWindow
                                        allocation.Width -textWidth -10, allocation.Height/2 -20,
                                        layout_force_ai_text);
 
-                       // 7) calculate and paint max RFD
+                       // 8) calculate and paint max RFD
                        //value of count that produce the max RFD (between the previous and next value)
                        int countRFDMax = hscaleLower;
                        layout_force_ai_text.SetMarkup(string.Format("RFD Max: {0:0.#} N/s",


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