[chronojump/FS-TFT-Menu] RunInterval realtime graph has no spaces between bars to show continuiti



commit 97f5bbce7ffd89847349d9dc9391ef55b8b7f7e6
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Apr 19 12:02:19 2022 +0200

    RunInterval realtime graph has no spaces between bars to show continuiti

 src/gui/cairo/bars.cs   | 9 +++++++++
 src/gui/eventExecute.cs | 2 ++
 2 files changed, 11 insertions(+)
---
diff --git a/src/gui/cairo/bars.cs b/src/gui/cairo/bars.cs
index 81234adbd..82e6e4ba0 100644
--- a/src/gui/cairo/bars.cs
+++ b/src/gui/cairo/bars.cs
@@ -95,6 +95,7 @@ public abstract class CairoBars : CairoGeneric
        protected string xUnits = "";
        protected string yUnits = "cm";
        protected List<int> inBarNums_l; //used on Wichro to identify photocells
+       protected bool spaceBetweenBars;
 
        //used when there are two series (for legend)
        protected string variableSerieA = "";
@@ -1042,6 +1043,10 @@ public abstract class CairoBars : CairoGeneric
                set { inBarNums_l = value; }
        }
 
+       public bool SpaceBetweenBars {
+               set { spaceBetweenBars = value; }
+       }
+
        //for CairoBarsNHSeries (legend)
        public string VariableSerieA {
                set { variableSerieA = value; }
@@ -1116,6 +1121,7 @@ public class CairoBars1Series : CairoBars
                this.paintGrid = paintGrid;
 
                this.colorSerieA = colorFromGdk(Config.ColorBackground); //but note if we are using system 
colors, this will not match
+               spaceBetweenBars = true;
        }
 
        protected override void topMarginSet ()
@@ -1168,6 +1174,9 @@ public class CairoBars1Series : CairoBars
                        sideWidthRatio = 0.25;
 
                double spaceBetweenBarsRatio = .7;
+               if(! spaceBetweenBars) //on runInterval realtime, as the bars are together continuous on time
+                       spaceBetweenBarsRatio = 0;
+
                /*
                   divide graphWidhtUsable by total objects (bars, leftrightspace, spacesbetweenbars)
                   for 3 bars on ratios 1, .5, .5, this will be 5
diff --git a/src/gui/eventExecute.cs b/src/gui/eventExecute.cs
index 469cddf71..a11add124 100644
--- a/src/gui/eventExecute.cs
+++ b/src/gui/eventExecute.cs
@@ -3314,6 +3314,8 @@ public class CairoPaintBarsPreRunIntervalRealtimeCapture : CairoPaintBarsPre
                if(photocell_l.Count > 0)
                        cb.InBarNums_l = photocell_l;
 
+               cb.SpaceBetweenBars = false;
+
                cb.PassData1Serie (point_l,
                                new List<Cairo.Color>(), names_l,
                                -1, 14, 22, title); //22 because there are two rows


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