Skip to content

Commit ea1ee0b

Browse files
committed
Automatic merge of T1.5.1-687-gd279e384a and 14 pull requests
- Pull request #570 at c59c788: 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 #865 at 67014b7: Dispatcher window improvements - 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 #878 at 25f5e06: Implement Polach Adhesion - Pull request #882 at d8a1c4d: Blueprint/train car operations UI window - Pull request #883 at edcc2dd: SwitchPanel disconnect/connect handling - Pull request #885 at c81447b: feat: Add notifications to Menu - Pull request #886 at 7c4922e: Scene viewer extension to TrackViewer - Pull request #887 at 4665bda: docs: Document projects, assemblies, namespaces - Pull request #888 at d7daf62: docs: Document player application model - Pull request #889 at 43341cf: No speed update
16 parents bf05f13 + d279e38 + c59c788 + d00beb9 + 67014b7 + f8dbeab + 43bf33e + f92de76 + 25f5e06 + d8a1c4d + edcc2dd + c81447b + 7c4922e + 4665bda + d7daf62 + 43341cf commit ea1ee0b

File tree

6 files changed

+24
-4
lines changed

6 files changed

+24
-4
lines changed

Source/Orts.Formats.Msts/SignalConfigurationFile.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,8 @@ public class SignalAspect
10521052
public float SpeedMpS { get; private set; }
10531053
/// <summary>Set to true if SignalFlags ASAP option specified, meaning train needs to go to speed As Soon As Possible</summary>
10541054
public bool Asap { get; private set; }
1055+
/// <summary>Set to true if SignalFlags NoSpeedUpdate option specified, meaning speed limits are not in any way affected by the state of this signal>
1056+
public bool NoSpeedUpdate { get; private set; }
10551057
/// <summary>Set to true if SignalFlags RESET option specified (ORTS only)</summary>
10561058
public bool Reset;
10571059
/// <summary>Set to true if no speed reduction is required for RESTRICTED or STOP_AND_PROCEED aspects (ORTS only) </summary>
@@ -1068,6 +1070,7 @@ public SignalAspect(MstsSignalAspect reqAspect, string reqName)
10681070
DrawStateName = String.Copy(reqName);
10691071
SpeedMpS = -1;
10701072
Asap = false;
1073+
NoSpeedUpdate = false;
10711074
NoSpeedReduction = false;
10721075
}
10731076

@@ -1099,6 +1102,7 @@ public SignalAspect(STFReader stf)
10991102
switch (stf.ReadString().ToLower())
11001103
{
11011104
case "asap": Asap = true; break;
1105+
case "or_nospeedupdate": NoSpeedUpdate = true; break;
11021106
case "or_speedreset": Reset = true; break;
11031107
case "or_nospeedreduction": NoSpeedReduction = true; break;
11041108
default: stf.StepBackOneItem(); STFException.TraceInformation(stf, "Skipped unknown DrawLight flag " + stf.ReadString()); break;

Source/Orts.Simulation/Simulation/AIs/AITrain.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6810,6 +6810,7 @@ public static ObjectItemInfo RestoreActiveItem(BinaryReader inf, Signals signalR
68106810
thisInfo.speed_passenger = inf.ReadSingle();
68116811
thisInfo.speed_freight = inf.ReadSingle();
68126812
thisInfo.speed_flag = inf.ReadInt32();
6813+
thisInfo.no_speedUpdate = inf.ReadInt32();
68136814
thisInfo.actual_speed = inf.ReadSingle();
68146815

68156816
thisInfo.processed = inf.ReadBoolean();
@@ -6861,6 +6862,7 @@ public static void SaveActiveItem(BinaryWriter outf, ObjectItemInfo ActiveItem)
68616862
outf.Write(ActiveItem.speed_passenger);
68626863
outf.Write(ActiveItem.speed_freight);
68636864
outf.Write(ActiveItem.speed_flag);
6865+
outf.Write(ActiveItem.no_speedUpdate);
68646866
outf.Write(ActiveItem.actual_speed);
68656867

68666868
outf.Write(ActiveItem.processed);

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3512,6 +3512,7 @@ public void UpdateSignalState(int backward)
35123512
firstObject.speed_passenger = thisSpeed?.speed_pass ?? -1;
35133513
firstObject.speed_freight = thisSpeed?.speed_freight ?? -1;
35143514
firstObject.speed_flag = thisSpeed?.speed_flag ?? 0;
3515+
firstObject.no_speedUpdate = thisSpeed?.no_speedUpdate ?? 0;
35153516
firstObject.speed_reset = thisSpeed?.speed_reset ?? 0;
35163517
break;
35173518

@@ -3522,6 +3523,7 @@ public void UpdateSignalState(int backward)
35223523
firstObject.speed_freight = thisSpeed?.speed_freight ?? -1;
35233524
firstObject.speed_flag = thisSpeed?.speed_flag ?? 0;
35243525
firstObject.speed_reset = thisSpeed?.speed_reset ?? 0;
3526+
firstObject.no_speedUpdate = thisSpeed?.no_speedUpdate ?? 0;
35253527
firstObject.speed_noSpeedReductionOrIsTempSpeedReduction = thisSpeed?.speed_noSpeedReductionOrIsTempSpeedReduction ?? 0;
35263528
firstObject.speed_isWarning = thisSpeed?.speed_isWarning ?? false;
35273529
break;
@@ -3551,13 +3553,15 @@ public void UpdateSignalState(int backward)
35513553
nextObject.speed_passenger = -1;
35523554
nextObject.speed_freight = -1;
35533555
nextObject.speed_flag = 0;
3556+
nextObject.no_speedUpdate = 0;
35543557
nextObject.speed_reset = 0;
35553558
}
35563559
else
35573560
{
35583561
nextObject.speed_passenger = thisSpeed?.speed_pass ?? -1;
35593562
nextObject.speed_freight = thisSpeed?.speed_freight ?? -1;
35603563
nextObject.speed_flag = thisSpeed?.speed_flag ?? 0;
3564+
nextObject.no_speedUpdate = thisSpeed?.no_speedUpdate ?? 0;
35613565
nextObject.speed_reset = thisSpeed?.speed_reset ?? 0;
35623566
}
35633567
break;
@@ -3568,6 +3572,7 @@ public void UpdateSignalState(int backward)
35683572
nextObject.speed_passenger = thisSpeed?.speed_pass ?? -1;
35693573
nextObject.speed_freight = thisSpeed?.speed_freight ?? -1;
35703574
nextObject.speed_flag = thisSpeed?.speed_flag ?? 0;
3575+
nextObject.no_speedUpdate = thisSpeed?.no_speedUpdate ?? 0;
35713576
nextObject.speed_reset = thisSpeed?.speed_reset ?? 0;
35723577
nextObject.speed_noSpeedReductionOrIsTempSpeedReduction = thisSpeed?.speed_noSpeedReductionOrIsTempSpeedReduction ?? 0;
35733578
nextObject.speed_isWarning = thisSpeed?.speed_isWarning ?? false;
@@ -3643,6 +3648,7 @@ public void UpdateSignalState(int backward)
36433648
nextObject.speed_passenger = thisSpeed?.speed_pass ?? -1;
36443649
nextObject.speed_freight = thisSpeed?.speed_freight ?? -1;
36453650
nextObject.speed_flag = thisSpeed?.speed_flag ?? 0;
3651+
nextObject.no_speedUpdate = thisSpeed?.no_speedUpdate ?? 0;
36463652
nextObject.speed_reset = thisSpeed?.speed_reset ?? 0;
36473653
break;
36483654

@@ -3652,6 +3658,7 @@ public void UpdateSignalState(int backward)
36523658
nextObject.speed_passenger = thisSpeed?.speed_pass ?? -1;
36533659
nextObject.speed_freight = thisSpeed?.speed_freight ?? -1;
36543660
nextObject.speed_flag = thisSpeed?.speed_flag ?? 0;
3661+
nextObject.no_speedUpdate = thisSpeed?.no_speedUpdate ?? 0;
36553662
nextObject.speed_reset = thisSpeed?.speed_reset ?? 0;
36563663
nextObject.speed_noSpeedReductionOrIsTempSpeedReduction = thisSpeed?.speed_noSpeedReductionOrIsTempSpeedReduction ?? 0;
36573664
nextObject.speed_isWarning = thisSpeed?.speed_isWarning ?? false;
@@ -3819,7 +3826,7 @@ public void UpdateSpeedInfo()
38193826
#endif
38203827
}
38213828
}
3822-
else
3829+
else if (thisObject.no_speedUpdate == 1)
38233830
{
38243831
validSpeedSignalMpS = TrainMaxSpeedMpS;
38253832
float newSpeedMpS = Math.Min(validSpeedSignalMpS, Math.Min(validSpeedLimitMpS, validTempSpeedLimitMpS));

Source/Orts.Simulation/Simulation/Signalling/ObjectItemInfo.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public enum ObjectItemFindState
5757
public int speed_reset;
5858
// for signals: if = 1 no speed reduction; for speedposts: if = 0 standard; = 1 start of temp speedreduction post; = 2 end of temp speed reduction post
5959
public int speed_noSpeedReductionOrIsTempSpeedReduction;
60+
public int no_speedUpdate;
6061
public bool speed_isWarning;
6162
public float actual_speed; // set active by TRAIN
6263

@@ -78,6 +79,7 @@ public ObjectItemInfo(SignalObject thisObject, float distance)
7879
speed_passenger = -1; // set active by TRAIN
7980
speed_freight = -1; // set active by TRAIN
8081
speed_flag = 0; // set active by TRAIN
82+
no_speedUpdate = 0; // set active by TRAIN
8183
speed_reset = 0; // set active by TRAIN
8284
speed_noSpeedReductionOrIsTempSpeedReduction = 0;
8385
}
@@ -89,6 +91,7 @@ public ObjectItemInfo(SignalObject thisObject, float distance)
8991
speed_passenger = speed_info.speed_pass;
9092
speed_freight = speed_info.speed_freight;
9193
speed_flag = speed_info.speed_flag;
94+
no_speedUpdate = speed_info.no_speedUpdate;
9295
speed_reset = speed_info.speed_reset;
9396
speed_noSpeedReductionOrIsTempSpeedReduction = speed_info.speed_noSpeedReductionOrIsTempSpeedReduction;
9497
speed_isWarning = speed_info.speed_isWarning;

Source/Orts.Simulation/Simulation/Signalling/ObjectSpeedInfo.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,18 @@ public class ObjectSpeedInfo
2222
public float speed_pass;
2323
public float speed_freight;
2424
public int speed_flag;
25+
public int no_speedUpdate;
2526
public int speed_reset;
2627
public int speed_noSpeedReductionOrIsTempSpeedReduction;
2728
public bool speed_isWarning;
2829

29-
public ObjectSpeedInfo(float pass, float freight, bool asap, bool reset, int nospeedreductionOristempspeedreduction, bool isWarning)
30+
public ObjectSpeedInfo(float pass, float freight, bool asap, bool reset, int nospeedreductionOristempspeedreduction, bool isWarning, bool nospeedupdate = false)
3031
{
3132
speed_pass = pass;
3233
speed_freight = freight;
3334
speed_flag = asap ? 1 : 0;
3435
speed_reset = reset ? 1 : 0;
36+
no_speedUpdate = nospeedupdate ? 1 : 0;
3537
speed_noSpeedReductionOrIsTempSpeedReduction = nospeedreductionOristempspeedreduction;
3638
speed_isWarning = isWarning;
3739
}

Source/Orts.Simulation/Simulation/Signalling/SignalHead.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ public SignalHead(SignalObject sigObject, int trItem, int TDBRef, SpeedPostItem
9999

100100
float passSpeed = speedItem.IsPassenger ? speedMpS : -1;
101101
float freightSpeed = speedItem.IsFreight ? speedMpS : -1;
102-
ObjectSpeedInfo speedinfo = new ObjectSpeedInfo(passSpeed, freightSpeed, false, false, speedItem is TempSpeedPostItem ? (speedMpS == 999f ? 2 : 1) : 0, speedItem.IsWarning);
102+
ObjectSpeedInfo speedinfo = new ObjectSpeedInfo(passSpeed, freightSpeed, false, false, speedItem is TempSpeedPostItem ? (speedMpS == 999f ? 2 : 1) : 0,
103+
speedItem.IsWarning);
103104
speed_info[(int)state] = speedinfo;
104105
}
105106

@@ -128,7 +129,8 @@ public void SetSignalType(TrItem[] TrItems, SignalConfigurationFile sigCFG)
128129
foreach (SignalAspect thisAspect in signalType.Aspects)
129130
{
130131
int arrindex = (int)thisAspect.Aspect;
131-
speed_info[arrindex] = new ObjectSpeedInfo(thisAspect.SpeedMpS, thisAspect.SpeedMpS, thisAspect.Asap, thisAspect.Reset, thisAspect.NoSpeedReduction ? 1 : 0, false);
132+
speed_info[arrindex] = new ObjectSpeedInfo(thisAspect.SpeedMpS, thisAspect.SpeedMpS, thisAspect.Asap, thisAspect.Reset,
133+
thisAspect.NoSpeedReduction ? 1 : 0, false, thisAspect.NoSpeedUpdate);
132134
}
133135

134136
// set normal subtype

0 commit comments

Comments
 (0)