[chronojump] ForceSensor AI max and min if they fit



commit 6eeea7714077684d0c1f8c8f0ce0ca5bc461687f
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Feb 28 12:40:09 2020 +0100

    ForceSensor AI max and min if they fit

 src/gui/app1/forceSensorAnalyze.cs | 37 +++++++++++++++++++++++++++----------
 1 file changed, 27 insertions(+), 10 deletions(-)
---
diff --git a/src/gui/app1/forceSensorAnalyze.cs b/src/gui/app1/forceSensorAnalyze.cs
index 9cef0f02..b1f9f2ec 100644
--- a/src/gui/app1/forceSensorAnalyze.cs
+++ b/src/gui/app1/forceSensorAnalyze.cs
@@ -1091,17 +1091,34 @@ public partial class ChronoJumpWindow
                        layout_force_ai_text.GetPixelSize(out textWidth, out textHeight);
                        force_sensor_ai_pixmap.DrawLayout (pen_green_force_ai,
                                        xPxEnd +2, fsAI.GetPxAtDispl(0) - textHeight/2, layout_force_ai_text);
-               
-                       //horizontal distance max line
-                       force_sensor_ai_pixmap.DrawLine(pen_green_discont_force_ai,
-                                       xPxStart, fsAI.GetPxAtDispl(fsAI.FscAIPointsDispl.ForceMax), xPxEnd, 
fsAI.GetPxAtDispl(fsAI.FscAIPointsDispl.ForceMax));
-                       
-                       //print max value
-                       layout_force_ai_text.SetMarkup(Util.TrimDecimals(fsAI.FscAIPointsDispl.ForceMax,2));
-                       layout_force_ai_text.GetPixelSize(out textWidth, out textHeight);
-                       force_sensor_ai_pixmap.DrawLayout (pen_green_force_ai,
-                                       xPxEnd +2, fsAI.GetPxAtDispl(fsAI.FscAIPointsDispl.ForceMax) - 
textHeight/2, layout_force_ai_text);
 
+                       //max (if it fits)
+                       if(fsAI.GetPxAtDispl(0) - fsAI.GetPxAtDispl(fsAI.FscAIPointsDispl.ForceMax) > 
textHeight)
+                       {
+                               //horizontal distance max line
+                               force_sensor_ai_pixmap.DrawLine(pen_green_discont_force_ai,
+                                               xPxStart, fsAI.GetPxAtDispl(fsAI.FscAIPointsDispl.ForceMax), 
xPxEnd, fsAI.GetPxAtDispl(fsAI.FscAIPointsDispl.ForceMax));
+
+                               //print max value
+                               
layout_force_ai_text.SetMarkup(Util.TrimDecimals(fsAI.FscAIPointsDispl.ForceMax,2));
+                               layout_force_ai_text.GetPixelSize(out textWidth, out textHeight);
+                               force_sensor_ai_pixmap.DrawLayout (pen_green_force_ai,
+                                               xPxEnd +2, fsAI.GetPxAtDispl(fsAI.FscAIPointsDispl.ForceMax) 
- textHeight/2, layout_force_ai_text);
+                       }
+
+                       //min (if it fits)
+                       if(fsAI.GetPxAtDispl(fsAI.FscAIPointsDispl.ForceMin) < 0 && 
fsAI.GetPxAtDispl(fsAI.FscAIPointsDispl.ForceMin) - fsAI.GetPxAtDispl(0) > textHeight)
+                       {
+                               //horizontal distance min line
+                               force_sensor_ai_pixmap.DrawLine(pen_green_discont_force_ai,
+                                               xPxStart, fsAI.GetPxAtDispl(fsAI.FscAIPointsDispl.ForceMin), 
xPxEnd, fsAI.GetPxAtDispl(fsAI.FscAIPointsDispl.ForceMin));
+
+                               //print max value
+                               
layout_force_ai_text.SetMarkup(Util.TrimDecimals(fsAI.FscAIPointsDispl.ForceMin,2));
+                               layout_force_ai_text.GetPixelSize(out textWidth, out textHeight);
+                               force_sensor_ai_pixmap.DrawLayout (pen_green_force_ai,
+                                               xPxEnd +2, fsAI.GetPxAtDispl(fsAI.FscAIPointsDispl.ForceMin) 
- textHeight/2, layout_force_ai_text);
+                       }
                }
 
                // 3) paint points as line (can be done also with DrawPoints to debug)


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