[chronojump] Fixed run double contact arrival mode, start in with double contacts



commit 17ee1e087bec3989af2dc14bfd5d41ae577ea93a
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Apr 23 22:51:17 2018 +0200

    Fixed run double contact arrival mode, start in with double contacts

 src/execute/runObjects.cs |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/src/execute/runObjects.cs b/src/execute/runObjects.cs
index 3cc6b7d..0c8d3bf 100644
--- a/src/execute/runObjects.cs
+++ b/src/execute/runObjects.cs
@@ -248,7 +248,7 @@ public class RunPhaseInfoManage
        }
 
        //if pos == -1 return all
-       public double SumUntilPos(int pos, bool firstTrackDone, bool speedStartArrival)
+       public double SumUntilPos(int pos, bool firstTrackDone, bool speedStart, bool speedStartArrival)
        {
                LogB.Information(string.Format("SumUntilPos: startAt: {0}, until pos: {1}, firstTrackDone: 
{2}, speedStartArrival: {3}",
                                        startPos, pos, firstTrackDone, speedStartArrival));
@@ -263,8 +263,13 @@ public class RunPhaseInfoManage
                {
                        if(countStart >= startPos && countEnd < pos)
                        {
-                               //if it has not firstTrackDone 1st track take care of leaving or not to count 
the related tc)
-                               if(! firstTrackDone && sum == 0 && rpi.IsContact() && ! speedStartArrival)
+                               /*
+                                * if it has not firstTrackDone 1st track take care of leaving or not to 
count the related tc)
+                                * do not count it if
+                                *      started inside (! speedStart) or
+                                *      speed start but start on leaving
+                                */
+                               if( ! firstTrackDone && sum == 0 && rpi.IsContact() && (! speedStart || ! 
speedStartArrival) )
                                {
                                        //do nothing
                                }
@@ -483,7 +488,7 @@ public class RunDoubleContact
        private double getDCBiggestTC()
        {
                int bigTCPosition = GetPosOfBiggestTC(true);
-               double sum = rpim.SumUntilPos(bigTCPosition, FirstTrackDone, speedStartArrival);
+               double sum = rpim.SumUntilPos(bigTCPosition, FirstTrackDone, SpeedStart, speedStartArrival);
                LogB.Information(string.Format("trackDoing getDBBiggestTC bigTCPosition: {0}, Sum: {1}", 
bigTCPosition, sum));
 
                //fix problem of a tc + tf lower than checkTime
@@ -492,7 +497,7 @@ public class RunDoubleContact
                        while (sum < checkTime && bigTCPosition +2 <= rpim.LastPositionOfList)
                        {
                                bigTCPosition += 2;
-                               sum = rpim.SumUntilPos(bigTCPosition, FirstTrackDone, speedStartArrival);
+                               sum = rpim.SumUntilPos(bigTCPosition, FirstTrackDone, SpeedStart, 
speedStartArrival);
                                LogB.Information(string.Format("SUM was < checkTime. New bigTCPosition: {0}, 
New Sum: {1}", bigTCPosition, sum));
                        }
                }


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