@@ -3058,6 +3058,13 @@ public virtual bool PostInit()
30583058 if (IsActualPlayerTrain)
30593059 {
30603060 SetTrainSpeedLoggingFlag();
3061+
3062+
3063+ // if debug, print out all passing paths
3064+
3065+ #if DEBUG_DEADLOCK
3066+ Printout_PassingPaths();
3067+ #endif
30613068 }
30623069
30633070 return (validPosition);
@@ -13440,7 +13447,6 @@ public bool CreateStationStop(int platformStartID, int arrivalTime, int departTi
1344013447 false,
1344113448 false,
1344213449 false,
13443- false,
1344413450 StationStop.STOPTYPE.STATION_STOP);
1344513451
1344613452 thisStation.arrivalDT = arrivalDT;
@@ -16326,7 +16332,6 @@ public StationStop CalculateStationStop(int platformStartID, int arrivalTime, in
1632616332 false,
1632716333 false,
1632816334 false,
16329- false,
1633016335 StationStop.STOPTYPE.STATION_STOP);
1633116336
1633216337 thisStation.arrivalDT = arrivalDT;
@@ -20827,14 +20832,9 @@ public enum STOPTYPE
2082720832 public bool RestrictPlatformToSignal = false; // restrict end of platform to signal position
2082820833 public bool ExtendPlatformToSignal = false; // extend end of platform to next signal position
2082920834 public bool EndStop = false; // train terminates at station
20830- public bool AllowDepartEarly = false; // train is allowed to depart early
2083120835 public List<int> ConnectionsWaiting = new List<int>(); // List of trains waiting
2083220836 public Dictionary<int, int> ConnectionsAwaited = new Dictionary<int, int>(); // List of awaited trains : key = trainno., value = arr time
2083320837 public Dictionary<int, WaitInfo> ConnectionDetails = new Dictionary<int, WaitInfo>(); // Details of connection : key = trainno., value = wait info
20834- public RequestStop ReqStopDetails = null; // Request stop details
20835- public int PassTime; // Passing time (int)
20836- public DateTime passDT; // Passing time (DateTime)
20837- public bool PassingOnly;
2083820838
2083920839 //================================================================================================//
2084020840 //
@@ -20843,9 +20843,9 @@ public enum STOPTYPE
2084320843
2084420844 public StationStop(int platformReference, PlatformDetails platformItem, int subrouteIndex, int routeIndex,
2084520845 int tcSectionIndex, int direction, int exitSignal, bool holdSignal, bool noWaitSignal, bool noClaimAllowed, float stopOffset,
20846- int? arrivalTime, int? departTime, bool terminal, int? actualMinStopTime, float? keepClearFront, float? keepClearRear,
20846+ int arrivalTime, int departTime, bool terminal, int? actualMinStopTime, float? keepClearFront, float? keepClearRear,
2084720847 bool forcePosition, bool closeupSignal, bool closeup,
20848- bool restrictPlatformToSignal, bool extendPlatformToSignal, bool endStop, bool allowdepartearly, STOPTYPE actualStopType)
20848+ bool restrictPlatformToSignal, bool extendPlatformToSignal, bool endStop, STOPTYPE actualStopType)
2084920849 {
2085020850 ActualStopType = actualStopType;
2085120851 PlatformReference = platformReference;
@@ -20861,21 +20861,14 @@ public StationStop(int platformReference, PlatformDetails platformItem, int subr
2086120861 StopOffset = stopOffset;
2086220862 if (actualStopType == STOPTYPE.STATION_STOP)
2086320863 {
20864- if (arrivalTime.HasValue)
20865- {
20866- ArrivalTime = Math.Max(0, arrivalTime.Value);
20867- DepartTime = Math.Max(0, departTime.Value);
20868- }
20869- else
20870- {
20871- ArrivalTime = DepartTime = -1;
20872- }
20864+ ArrivalTime = Math.Max(0, arrivalTime);
20865+ DepartTime = Math.Max(0, departTime);
2087320866 }
2087420867 else
2087520868 // times may be <0 for waiting point
2087620869 {
20877- ArrivalTime = arrivalTime.Value ;
20878- DepartTime = departTime.Value ;
20870+ ArrivalTime = arrivalTime;
20871+ DepartTime = departTime;
2087920872 }
2088020873 ActualArrival = -1;
2088120874 ActualDepart = -1;
@@ -20892,10 +20885,8 @@ public StationStop(int platformReference, PlatformDetails platformItem, int subr
2089220885 RestrictPlatformToSignal = restrictPlatformToSignal;
2089320886 ExtendPlatformToSignal = extendPlatformToSignal;
2089420887 EndStop = endStop;
20895- AllowDepartEarly = allowdepartearly;
2089620888
2089720889 CallOnAllowed = false;
20898- PassingOnly = false;
2089920890 }
2090020891
2090120892 //================================================================================================//
@@ -21008,16 +20999,6 @@ public StationStop(BinaryReader inf, Signals signalRef)
2100820999 RestrictPlatformToSignal = inf.ReadBoolean();
2100921000 ExtendPlatformToSignal = inf.ReadBoolean();
2101021001 EndStop = inf.ReadBoolean();
21011- AllowDepartEarly = inf.ReadBoolean();
21012-
21013- if (inf.ReadBoolean())
21014- {
21015- ReqStopDetails = new RequestStop(inf, signalRef);
21016- }
21017-
21018- PassTime = inf.ReadInt32();
21019- passDT = new DateTime(inf.ReadInt64());
21020- PassingOnly = inf.ReadBoolean();
2102121002 }
2102221003
2102321004 //================================================================================================//
@@ -21141,21 +21122,6 @@ public void Save(BinaryWriter outf)
2114121122 outf.Write(RestrictPlatformToSignal);
2114221123 outf.Write(ExtendPlatformToSignal);
2114321124 outf.Write(EndStop);
21144- outf.Write(AllowDepartEarly);
21145-
21146- if (ReqStopDetails != null)
21147- {
21148- outf.Write(true);
21149- ReqStopDetails.Save(outf);
21150- }
21151- else
21152- {
21153- outf.Write(false);
21154- }
21155-
21156- outf.Write(PassTime);
21157- outf.Write((Int64)passDT.Ticks);
21158- outf.Write(PassingOnly);
2115921125 }
2116021126
2116121127 /// <summary>
@@ -21178,21 +21144,6 @@ public int CalculateDepartTime(int presentTime, Train stoppedTrain)
2117821144 int eightHundredHours = 8 * 3600;
2117921145 int sixteenHundredHours = 16 * 3600;
2118021146
21181- int stopTime = 0;
21182-
21183- // allow to depart early if set (timetable mode only, so no need to check for valid schedule)
21184- // also allow to depart after boarding time if arrival time is not set
21185- if (AllowDepartEarly || ArrivalTime < 0)
21186- {
21187- stoppedTrain.ComputeTrainBoardingTime(this, ref stopTime);
21188- ActualDepart = ActualArrival + stopTime;
21189-
21190- // correct for times around midnight
21191- if (ActualDepart > 24 * 3600) ActualDepart -= 24 * 3600;
21192- if (DepartTime == 0) DepartTime = ActualDepart;
21193- return stopTime;
21194- }
21195-
2119621147 // preset depart to booked time
2119721148 ActualDepart = DepartTime;
2119821149
@@ -21207,7 +21158,7 @@ public int CalculateDepartTime(int presentTime, Train stoppedTrain)
2120721158 }
2120821159
2120921160 // correct stop time for stop around midnight
21210- stopTime = DepartTime - ArrivalTime;
21161+ int stopTime = DepartTime - ArrivalTime;
2121121162 if (DepartTime < eightHundredHours && ArrivalTime > sixteenHundredHours) // stop over midnight
2121221163 {
2121321164 stopTime += (24 * 3600);
0 commit comments