[chronojump] ForceSensor show repetition count at analyze graph



commit 7df701f68eca0583af7d74d0f2f60af6b3d430d8
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Nov 25 21:18:41 2019 +0100

    ForceSensor show repetition count at analyze graph

 src/gui/forceSensorAnalyze.cs | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/src/gui/forceSensorAnalyze.cs b/src/gui/forceSensorAnalyze.cs
index 98b45792..d3438ac2 100644
--- a/src/gui/forceSensorAnalyze.cs
+++ b/src/gui/forceSensorAnalyze.cs
@@ -950,14 +950,31 @@ public partial class ChronoJumpWindow
                        hbox_force_sensor_ai_power.Visible = false;
                }
 
+               // paint repetitions info (vertical line and number)
                if(fsAI.CalculedElasticPSAP)
-                       foreach(ForceSensorRepetition fsr in fsAI.ForceSensorRepetition_l)
+               {
+                       int xposRepPrevious = 0;
+                       for(int i = 0; i < fsAI.ForceSensorRepetition_l.Count; i ++)
                        {
                                // paint vertical line for each rep
-                               int xposRep = fsAI.GetXFromSampleCount(fsr.posX);
+                               int xposRep = fsAI.GetXFromSampleCount(fsAI.ForceSensorRepetition_l[i].posX);
                                force_sensor_ai_pixmap.DrawLine(pen_green_force_ai,
                                                xposRep, 0, xposRep, allocation.Height -20);
+
+                               // write repetition count
+                               if(i > 0)
+                               {
+                                       layout_force_ai_text.SetMarkup(i.ToString());
+                                       textWidth = 1; textHeight = 1;
+                                       layout_force_ai_text.GetPixelSize(out textWidth, out textHeight);
+                                       force_sensor_ai_pixmap.DrawLayout (pen_green_force_ai,
+                                                       Convert.ToInt32((xposRepPrevious + xposRep)/2 - 
textWidth/2), 0,
+                                                       layout_force_ai_text);
+                               }
+
+                               xposRepPrevious = xposRep;
                        }
+               }
 
 
                // 6) if only A calculate exit


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