[chronojump] Encoder fixed labels capture on ec at showNBars



commit e056ff902b89f3d71d5b6b880e113ee7d5f2bb76
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Mar 5 18:24:43 2020 +0100

    Encoder fixed labels capture on ec at showNBars

 src/gui/encoderGraphObjects.cs | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/src/gui/encoderGraphObjects.cs b/src/gui/encoderGraphObjects.cs
index cbdef561..a0ac6201 100644
--- a/src/gui/encoderGraphObjects.cs
+++ b/src/gui/encoderGraphObjects.cs
@@ -777,14 +777,27 @@ public class EncoderGraphDoPlot
                        {
                                int startX = Convert.ToInt32(dLeft + dWidth/2);
                                string bottomText = (count +1).ToString();
-                               if(showNRepetitions > 0 && capturing && data7Variables.Count > 
showNRepetitions)
-                                       bottomText = ( (data7Variables.Count - showNRepetitions) + count 
+1).ToString();
-
                                if (eccon != "c") {
                                        startX = dLeft;
+                                       //LogB.Information(string.Format("bottomText vars A: {0}, {1}", 
count, ((count +1) / 2) ));
                                        bottomText = ((count +1) / 2).ToString();
                                }
 
+                               if(showNRepetitions > 0 && capturing)
+                               {
+
+                                       if (eccon == "c" && data7Variables.Count > showNRepetitions)
+                                               bottomText = ( (data7Variables.Count - showNRepetitions) + 
count +1).ToString();
+                                       else if (eccon != "c" && data7Variables.Count > showNRepetitions*2)
+                                       {
+                                               //LogB.Information(string.Format("bottomText vars B: {0}, 
{1}, {2}, {3}", data7Variables.Count, showNRepetitions*2, count,
+                                               //                      
Math.Floor(Convert.ToDouble((data7Variables.Count +1)/2)) - showNRepetitions + 
Math.Floor(Convert.ToDouble(((count +1)/2)))
+                                               //                      ));
+                                               bottomText = ( 
Math.Floor(Convert.ToDouble((data7Variables.Count +1)/2)) - showNRepetitions + 
Math.Floor(Convert.ToDouble(((count +1)/2))) ).ToString();
+                                       }
+                               }
+
+
                                layout_encoder_capture_curves_bars.SetMarkup(bottomText);
                                textWidth = 1;
                                textHeight = 1;


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