[chronojump] Run, runInterval graph don't show TCs if prefs: "no use double contacts"



commit 3926aff0fd3ba90d931021457250b8137a43d375
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon May 7 17:19:37 2018 +0200

    Run, runInterval graph don't show TCs if prefs: "no use double contacts"

 src/execute/run.cs        |    5 ++++-
 src/execute/runObjects.cs |   10 +++++++++-
 src/gui/eventExecute.cs   |    4 ++--
 3 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/src/execute/run.cs b/src/execute/run.cs
index 48ae54a..c4800e3 100644
--- a/src/execute/run.cs
+++ b/src/execute/run.cs
@@ -254,7 +254,10 @@ public class RunExecute : EventExecute
                                checkDoubleContactTime,
                                speedStartArrival
                                );
-               runPTL = new RunPhaseTimeList(checkDoubleContactTime);
+               runPTL = new RunPhaseTimeList(
+                               checkDoubleContactMode,
+                               checkDoubleContactTime
+                               );
 
                bool firstFromChronopicReceived = false;
                bool exitWaitEventBucle = false;
diff --git a/src/execute/runObjects.cs b/src/execute/runObjects.cs
index 5b64591..1ce4bb4 100644
--- a/src/execute/runObjects.cs
+++ b/src/execute/runObjects.cs
@@ -514,13 +514,15 @@ public class RunPhaseTimeList
        public bool SpeedStart;
 
        private List<PhaseTime> listPhaseTime;
+       private Constants.DoubleContact checkDoubleContactMode;
        private int checkTime;
 
        //if there are double contacts at start, first run phase infos will not be used
        public int FirstRPIs;
 
-       public RunPhaseTimeList(int checkTime)
+       public RunPhaseTimeList(Constants.DoubleContact checkDoubleContactMode, int checkTime)
        {
+               this.checkDoubleContactMode = checkDoubleContactMode;
                this.checkTime = checkTime;
 
                listPhaseTime = new List<PhaseTime>();
@@ -551,6 +553,12 @@ public class RunPhaseTimeList
                return str;
        }
 
+       //to show tc chunks or not on gui/eventExecute.cs
+       public bool UseDoubleContacts()
+       {
+               return (checkDoubleContactMode != Constants.DoubleContact.NONE);
+       }
+
        public List<RunPhaseTimeListObject> InListForPainting()
        {
                List<RunPhaseTimeListObject> list_in = new List<RunPhaseTimeListObject>();
diff --git a/src/gui/eventExecute.cs b/src/gui/eventExecute.cs
index f92a56b..617d730 100644
--- a/src/gui/eventExecute.cs
+++ b/src/gui/eventExecute.cs
@@ -1199,7 +1199,7 @@ public partial class ChronoJumpWindow
                
                double timeTotal = eventGraph.time;
                // start of contact chunks
-               if(runPTL != null)
+               if(runPTL != null && runPTL.UseDoubleContacts())
                {
                        List<RunPhaseTimeListObject> runPTLInListForPainting = runPTL.InListForPainting();
 
@@ -1675,7 +1675,7 @@ public partial class ChronoJumpWindow
                        // start of contact chunks
                        double negativePTLTime = 0;
                        double timeTotalWithExtraPTL = timeTotal;
-                       if(runPTL != null)
+                       if(runPTL != null && runPTL.UseDoubleContacts())
                        {
                                List<RunPhaseTimeListObject> runPTLInListForPainting = 
runPTL.InListForPainting();
 


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