[chronojump] RunInterval: display of a contact time bigger than double contact time * 1.5



commit 3829b119bfc001c7592a6b79fd9b509bea8162f2
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Aug 3 16:42:51 2020 +0200

    RunInterval: display of a contact time bigger than double contact time * 1.5

 src/execute/event.cs | 14 +++++++++++---
 src/execute/run.cs   | 11 ++++++-----
 2 files changed, 17 insertions(+), 8 deletions(-)
---
diff --git a/src/execute/event.cs b/src/execute/event.cs
index 3b38f341..74fece7f 100644
--- a/src/execute/event.cs
+++ b/src/execute/event.cs
@@ -345,10 +345,17 @@ public class EventExecute
                        needCallTrackDone = false;
                }
                //Race track with DoubleContacts mode != NONE
+               //LogB.Information("needCheckIfTrackEnded: " + needCheckIfTrackEnded.ToString());
                if(needCheckIfTrackEnded && lastTfCheckTimeEnded())
                {
-                       trackDone();
-                       needCheckIfTrackEnded = false;
+                       if(trackDone())
+                       {
+                               //LogB.Information("needCheckIfTrackEnded changing to false");
+                               needCheckIfTrackEnded = false;
+                       } else {
+                               //LogB.Information("needCheckIfTrackEnded continue true, trackDone() will be 
called again");
+                               //this helps to fix when contact time display when it is bigger than double 
contact time * 1.5
+                       }
                }
 
                //RSA
@@ -399,8 +406,9 @@ public class EventExecute
        {
        }
 
-       protected virtual void trackDone()
+       protected virtual bool trackDone()
        {
+               return true;
        }
 
        // <-------------------------- end of races specific
diff --git a/src/execute/run.cs b/src/execute/run.cs
index f95f093f..a8d16a06 100644
--- a/src/execute/run.cs
+++ b/src/execute/run.cs
@@ -324,7 +324,7 @@ public class RunExecute : EventExecute
                                //LogB.Information("timestamp:" + timestamp);
                                if (has_arrived()) // timestamp is tf
                                {
-LogB.Information("has arrived");
+                                       LogB.Information("has arrived");
                                        loggedState = States.ON;
                                        runChangeImage.Current = RunChangeImage.Types.PHOTOCELL;
 
@@ -551,13 +551,13 @@ LogB.Information("has lifted");
        //big change in 1.8.1: this is called from GTK thread
        //so don't write to SQL here
        //and use static variables where needed
-       protected override void trackDone()
+       protected override bool trackDone()
        {
                LogB.Information("In trackDone() A");
 
                runDC.TrackDoneHasToBeCalledAgain = false;
                if(success)
-                       return;
+                       return true;
 
                LogB.Information("In trackDone() B");
                //double myTrackTime = 0;
@@ -588,7 +588,7 @@ LogB.Information("has lifted");
                                                runPTL.FirstRPIs = posOfBiggestTC +1;
 
                                        runDC.UpdateStartPos(posOfBiggestTC);
-                                       return;
+                                       return true;
                                }
                                else
                                {
@@ -615,7 +615,7 @@ LogB.Information("has lifted");
                LogB.Information("trackTime: " + trackTime.ToString());
                //solve possible problems of bad copied data between threads on start
                if(trackTime == 0)
-                       return;
+                       return false; //helps to fix display of a contact time bigger than double contact 
time * 1.5
 
                runEI.ChangePhase(RunExecuteInspector.Phases.IN,
                                string.Format("; timestamp: {0}; <b>trackTime: {1}</b>",
@@ -630,6 +630,7 @@ LogB.Information("has lifted");
                if(! success && runDC.TrackDoneHasToBeCalledAgain)
                        trackDone();
 
+               return true;
        }
 
        protected virtual void trackDoneRunSpecificStuff ()


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