Skip to content

Commit fd3338f

Browse files
committed
Automatic merge of T1.5.1-757-gef6c1a8c8 and 16 pull requests
- Pull request #570 at 3539862: Experimental glTF 2.0 support with PBR lighting - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #874 at f8dbeab: Dynamic brake controller refactoring - Pull request #875 at 43bf33e: Bug fix for https://bugs.launchpad.net/or/+bug/2036346 Player train switching doesn't work with 3D cabs - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #882 at a055bca: Blueprint/train car operations UI window - Pull request #885 at c81447b: feat: Add notifications to Menu - Pull request #886 at 167e2e4: Scene viewer extension to TrackViewer - Pull request #888 at d7daf62: docs: Document player application model - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #893 at bf8876b: Signal errors - Pull request #894 at 5ff1e73: Correct Decrease Colour - Pull request #896 at 5866028: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains - Pull request #897 at 0a9d939: feat: Improved system information collection - Pull request #898 at e271395: Extra line with all the arguments for debugging purposes in logfile - Pull request #900 at 42ea7ad: DMI updates
18 parents cfabca0 + ef6c1a8 + 3539862 + d00beb9 + f8dbeab + 43bf33e + f92de76 + a055bca + c81447b + 167e2e4 + d7daf62 + 1f5ba4c + bf8876b + 5ff1e73 + 5866028 + 0a9d939 + e271395 + 42ea7ad commit fd3338f

File tree

4 files changed

+15
-68
lines changed

4 files changed

+15
-68
lines changed

Source/Orts.Simulation/Simulation/Physics/Train.cs

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13257,7 +13257,6 @@ public bool CreateStationStop(int platformStartID, int arrivalTime, int departTi
1325713257
false,
1325813258
false,
1325913259
false,
13260-
false,
1326113260
StationStop.STOPTYPE.STATION_STOP);
1326213261

1326313262
thisStation.arrivalDT = arrivalDT;
@@ -16068,7 +16067,6 @@ public StationStop CalculateStationStop(int platformStartID, int arrivalTime, in
1606816067
false,
1606916068
false,
1607016069
false,
16071-
false,
1607216070
StationStop.STOPTYPE.STATION_STOP);
1607316071

1607416072
thisStation.arrivalDT = arrivalDT;
@@ -20569,7 +20567,6 @@ public enum STOPTYPE
2056920567
public bool RestrictPlatformToSignal = false; // restrict end of platform to signal position
2057020568
public bool ExtendPlatformToSignal = false; // extend end of platform to next signal position
2057120569
public bool EndStop = false; // train terminates at station
20572-
public bool AllowDepartEarly = false; // train may depart early if boarding is completed
2057320570
public List<int> ConnectionsWaiting = new List<int>(); // List of trains waiting
2057420571
public Dictionary<int, int> ConnectionsAwaited = new Dictionary<int, int>(); // List of awaited trains : key = trainno., value = arr time
2057520572
public Dictionary<int, WaitInfo> ConnectionDetails = new Dictionary<int, WaitInfo>(); // Details of connection : key = trainno., value = wait info
@@ -20583,7 +20580,7 @@ public StationStop(int platformReference, PlatformDetails platformItem, int subr
2058320580
int tcSectionIndex, int direction, int exitSignal, bool holdSignal, bool noWaitSignal, bool noClaimAllowed, float stopOffset,
2058420581
int arrivalTime, int departTime, bool terminal, int? actualMinStopTime, float? keepClearFront, float? keepClearRear,
2058520582
bool forcePosition, bool closeupSignal, bool closeup,
20586-
bool restrictPlatformToSignal, bool extendPlatformToSignal, bool endStop, bool allowdepartearly, STOPTYPE actualStopType)
20583+
bool restrictPlatformToSignal, bool extendPlatformToSignal, bool endStop, STOPTYPE actualStopType)
2058720584
{
2058820585
ActualStopType = actualStopType;
2058920586
PlatformReference = platformReference;
@@ -20623,7 +20620,6 @@ public StationStop(int platformReference, PlatformDetails platformItem, int subr
2062320620
RestrictPlatformToSignal = restrictPlatformToSignal;
2062420621
ExtendPlatformToSignal = extendPlatformToSignal;
2062520622
EndStop = endStop;
20626-
AllowDepartEarly = allowdepartearly;
2062720623

2062820624
CallOnAllowed = false;
2062920625
}
@@ -20738,7 +20734,6 @@ public StationStop(BinaryReader inf, Signals signalRef)
2073820734
RestrictPlatformToSignal = inf.ReadBoolean();
2073920735
ExtendPlatformToSignal = inf.ReadBoolean();
2074020736
EndStop = inf.ReadBoolean();
20741-
AllowDepartEarly = inf.ReadBoolean();
2074220737
}
2074320738

2074420739
//================================================================================================//
@@ -20862,7 +20857,6 @@ public void Save(BinaryWriter outf)
2086220857
outf.Write(RestrictPlatformToSignal);
2086320858
outf.Write(ExtendPlatformToSignal);
2086420859
outf.Write(EndStop);
20865-
outf.Write(AllowDepartEarly);
2086620860
}
2086720861

2086820862
/// <summary>
@@ -20885,20 +20879,6 @@ public int CalculateDepartTime(int presentTime, Train stoppedTrain)
2088520879
int eightHundredHours = 8 * 3600;
2088620880
int sixteenHundredHours = 16 * 3600;
2088720881

20888-
int stopTime = 0;
20889-
20890-
// allow to depart early if set (timetable mode only, so no need to check for valid schedule)
20891-
if (AllowDepartEarly)
20892-
{
20893-
stoppedTrain.ComputeTrainBoardingTime(this, ref stopTime);
20894-
ActualDepart = ActualArrival + stopTime;
20895-
20896-
// correct for times around midnight
20897-
if (ActualDepart > 24 * 3600) ActualDepart -= 24 * 3600;
20898-
if (DepartTime == 0) DepartTime = ActualDepart;
20899-
return stopTime;
20900-
}
20901-
2090220882
// preset depart to booked time
2090320883
ActualDepart = DepartTime;
2090420884

@@ -20913,8 +20893,7 @@ public int CalculateDepartTime(int presentTime, Train stoppedTrain)
2091320893
}
2091420894

2091520895
// correct stop time for stop around midnight
20916-
stopTime = DepartTime - ArrivalTime;
20917-
20896+
int stopTime = DepartTime - ArrivalTime;
2091820897
if (DepartTime < eightHundredHours && ArrivalTime > sixteenHundredHours) // stop over midnight
2091920898
{
2092020899
stopTime += (24 * 3600);

Source/Orts.Simulation/Simulation/Timetables/ProcessTimetable.cs

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3160,7 +3160,6 @@ public enum SignalHoldType
31603160
public DateTime departureDT;
31613161
public DateTime passDT;
31623162
public bool arrdeppassvalid;
3163-
public bool allowDepartEarly;
31643163
public SignalHoldType holdState;
31653164
public bool noWaitSignal;
31663165
// TODO
@@ -3184,7 +3183,6 @@ public StopInfo(string name, string arrTime, string depTime, TimetableInfo ttinf
31843183
departureTime = -1;
31853184
passTime = -1;
31863185
Commands = null;
3187-
allowDepartEarly = false;
31883186

31893187
TimeSpan atime;
31903188
bool validArrTime = false;
@@ -3202,32 +3200,22 @@ public StopInfo(string name, string arrTime, string depTime, TimetableInfo ttinf
32023200
passDT = new DateTime(atime.Ticks);
32033201
}
32043202
}
3205-
if (arrTime.Contains("*"))
3206-
{
3207-
allowDepartEarly = true;
3208-
string arrivTime = arrTime.Replace('*', ':');
3209-
validArrTime = TimeSpan.TryParse(arrivTime, out atime);
3210-
if (validArrTime)
3211-
{
3212-
departureTime = arrivalTime = Convert.ToInt32(atime.TotalSeconds);
3213-
departureDT = arrivalDT = new DateTime(atime.Ticks);
3214-
}
3215-
}
32163203
else
32173204
{
3205+
32183206
validArrTime = TimeSpan.TryParse(arrTime, out atime);
32193207
if (validArrTime)
32203208
{
32213209
arrivalTime = Convert.ToInt32(atime.TotalSeconds);
32223210
arrivalDT = new DateTime(atime.Ticks);
32233211
}
3212+
}
32243213

3225-
validDepTime = TimeSpan.TryParse(depTime, out atime);
3226-
if (validDepTime)
3227-
{
3228-
departureTime = Convert.ToInt32(atime.TotalSeconds);
3229-
departureDT = new DateTime(atime.Ticks);
3230-
}
3214+
validDepTime = TimeSpan.TryParse(depTime, out atime);
3215+
if (validDepTime)
3216+
{
3217+
departureTime = Convert.ToInt32(atime.TotalSeconds);
3218+
departureDT = new DateTime(atime.Ticks);
32313219
}
32323220

32333221
arrdeppassvalid = validArrTime || validDepTime;
@@ -3406,7 +3394,7 @@ public bool BuildStopInfo(TTTrain actTrain, int actPlatformID, Signals signalRef
34063394

34073395
// Create station stop info
34083396
validStop = actTrain.CreateStationStop(actPlatformID, arrivalTime, departureTime, arrivalDT, departureDT, AITrain.clearingDistanceM,
3409-
AITrain.minStopDistanceM, terminal, actMinStopTime,keepClearFront, keepClearRear, forcePosition, closeupSignal, closeup, restrictPlatformToSignal, extendPlatformToSignal, endStop, allowDepartEarly);
3397+
AITrain.minStopDistanceM, terminal, actMinStopTime, keepClearFront, keepClearRear, forcePosition, closeupSignal, closeup, restrictPlatformToSignal, extendPlatformToSignal, endStop);
34103398

34113399
// Override holdstate using stop info - but only if exit signal is defined
34123400
int exitSignal = actTrain.StationStops[actTrain.StationStops.Count - 1].ExitSignal;

Source/Orts.Simulation/Simulation/Timetables/TTTrain.cs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ public override StationStop SetAlternativeStationStop(StationStop orgStop, TCSub
951951
StationStop newStop = CalculateStationStop(signalRef.PlatformDetailsList[altPlatformIndex].PlatformReference[0],
952952
orgStop.ArrivalTime, orgStop.DepartTime, orgStop.arrivalDT, orgStop.departureDT, clearingDistanceM, minStopDistanceM,
953953
orgStop.Terminal, orgStop.ActualMinStopTime, orgStop.KeepClearFront, orgStop.KeepClearRear, orgStop.ForcePosition,
954-
orgStop.CloseupSignal, orgStop.Closeup, orgStop.RestrictPlatformToSignal, orgStop.ExtendPlatformToSignal, orgStop.EndStop, orgStop.AllowDepartEarly);
954+
orgStop.CloseupSignal, orgStop.Closeup, orgStop.RestrictPlatformToSignal, orgStop.ExtendPlatformToSignal, orgStop.EndStop);
955955

956956
// Add new holding signal if required
957957
if (newStop.HoldSignal && newStop.ExitSignal >= 0)
@@ -1326,7 +1326,7 @@ public override bool PostInit()
13261326
/// <\summary>
13271327
public StationStop CalculateStationStop(int platformStartID, int arrivalTime, int departTime, DateTime arrivalDT, DateTime departureDT, float clearingDistanceM,
13281328
float minStopDistance, bool terminal, int? actMinStopTime, float? keepClearFront, float? keepClearRear, bool forcePosition, bool closeupSignal,
1329-
bool closeup, bool restrictPlatformToSignal, bool extendPlatformToSignal, bool endStop, bool allowdepartearly)
1329+
bool closeup, bool restrictPlatformToSignal, bool extendPlatformToSignal, bool endStop)
13301330
{
13311331
int platformIndex;
13321332
int activeSubroute = 0;
@@ -1404,7 +1404,6 @@ public StationStop CalculateStationStop(int platformStartID, int arrivalTime, in
14041404
restrictPlatformToSignal,
14051405
extendPlatformToSignal,
14061406
endStop,
1407-
allowdepartearly,
14081407
StationStop.STOPTYPE.STATION_STOP)
14091408
{
14101409
arrivalDT = arrivalDT,
@@ -1998,11 +1997,11 @@ public StationStop CalculateStationStopPosition(TCSubpathRoute thisRoute, int ro
19981997
/// <returns></returns>
19991998
public bool CreateStationStop(int platformStartID, int arrivalTime, int departTime, DateTime arrivalDT, DateTime departureDT, float clearingDistanceM,
20001999
float minStopDistanceM, bool terminal, int? actMinStopTime, float? keepClearFront, float? keepClearRear, bool forcePosition, bool closeupSignal,
2001-
bool closeup, bool restrictPlatformToSignal, bool extendPlatformToSignal, bool endStop, bool allowdepartearly)
2000+
bool closeup, bool restrictPlatformToSignal, bool extendPlatformToSignal, bool endStop)
20022001
{
20032002
StationStop thisStation = CalculateStationStop(platformStartID, arrivalTime, departTime, arrivalDT, departureDT, clearingDistanceM,
20042003
minStopDistanceM, terminal, actMinStopTime, keepClearFront, keepClearRear, forcePosition, closeupSignal, closeup,
2005-
restrictPlatformToSignal, extendPlatformToSignal, endStop, allowdepartearly);
2004+
restrictPlatformToSignal, extendPlatformToSignal, endStop);
20062005

20072006
if (thisStation != null)
20082007
{
@@ -10392,14 +10391,7 @@ public override void CheckStationTask()
1039210391
if (!StationStops[0].EndStop)
1039310392
{
1039410393
if (!DriverOnlyOperation) Simulator.SoundNotify = Event.PermissionToDepart; // Sound departure if not doo
10395-
if (StationStops[0].AllowDepartEarly)
10396-
{
10397-
DisplayMessage = Simulator.Catalog.GetString("Passenger boarding completed. Early departure allowed.");
10398-
}
10399-
else
10400-
{
10401-
DisplayMessage = Simulator.Catalog.GetString("Passenger boarding completed. You may depart now.");
10402-
}
10394+
DisplayMessage = Simulator.Catalog.GetString("Passenger boarding completed. You may depart now.");
1040310395
}
1040410396
}
1040510397
}

Source/RunActivity/Viewer3D/Popups/NextStationWindow.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,6 @@ public override void PrepareFrame(ElapsedTime elapsedTime, bool updateFull)
270270
StationPreviousArriveActual.Color = actArrDT < playerTimetableTrain.PreviousStop.arrivalDT ? Color.LightGreen : Color.LightSalmon;
271271
DateTime actDepDT = new DateTime((long)(Math.Pow(10, 7) * playerTimetableTrain.PreviousStop.ActualDepart));
272272
StationPreviousDepartActual.Text = actDepDT.ToString("HH:mm:ss");
273-
if (playerTimetableTrain.PreviousStop.AllowDepartEarly)
274-
{
275-
StationPreviousDepartActual.Text = actDepDT.ToString("HH*mm:ss");
276-
}
277273
StationPreviousDepartActual.Color = actDepDT > playerTimetableTrain.PreviousStop.arrivalDT ? Color.LightGreen : Color.LightSalmon;
278274
}
279275
else
@@ -318,10 +314,6 @@ public override void PrepareFrame(ElapsedTime elapsedTime, bool updateFull)
318314
StationCurrentArriveActual.Text = "";
319315
}
320316
StationCurrentDepartScheduled.Text = playerTimetableTrain.StationStops[0].departureDT.ToString("HH:mm:ss");
321-
if (playerTimetableTrain.StationStops[0].AllowDepartEarly)
322-
{
323-
StationCurrentDepartScheduled.Text = playerTimetableTrain.StationStops[0].departureDT.ToString("HH*mm:ss");
324-
}
325317
StationCurrentDistance.Text = FormatStrings.FormatDistanceDisplay(playerTimetableTrain.StationStops[0].DistanceToTrainM, metric);
326318
Message.Text = playerTimetableTrain.DisplayMessage;
327319
Message.Color = playerTimetableTrain.DisplayColor;
@@ -331,10 +323,6 @@ public override void PrepareFrame(ElapsedTime elapsedTime, bool updateFull)
331323
StationNextName.Text = playerTimetableTrain.StationStops[1].PlatformItem.Name;
332324
StationNextArriveScheduled.Text = playerTimetableTrain.StationStops[1].arrivalDT.ToString("HH:mm:ss");
333325
StationNextDepartScheduled.Text = playerTimetableTrain.StationStops[1].departureDT.ToString("HH:mm:ss");
334-
if (playerTimetableTrain.StationStops[1].AllowDepartEarly)
335-
{
336-
StationNextDepartScheduled.Text = playerTimetableTrain.StationStops[1].departureDT.ToString("HH*mm:ss");
337-
}
338326
StationNextDistance.Text = "";
339327
}
340328
else

0 commit comments

Comments
 (0)