Skip to content

Commit c8ce4be

Browse files
committed
Automatic merge of T1.5.1-963-g375f79869 and 15 pull requests
- Pull request #799 at dfc715e: Consolidated wind simulation - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #882 at 3ca0eb1: Blueprint/train car operations UI window - Pull request #891 at 9a1d6b2: Auto save - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #896 at 5866028: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains - Pull request #900 at c27f32d: DMI updates - Pull request #903 at 7af1f91: Downloading route content (Github, zip) - Pull request #912 at 5f5f1f5: New Triple Valve Features Vol. 2 - Pull request #919 at 26cc6a8: Added mouse wheel support for controls which can be moved by pressing t… - Pull request #922 at abe2e52: Autopilot for timetable mode - Pull request #923 at 4c27204: Add curve squeal to route - Pull request #939 at 6c8095a: Add KM/HOUR/MIN to Cabview Units - Pull request #940 at f8b5b15: Browser HUD column alignment improvements
17 parents 1bef191 + 375f798 + dfc715e + d00beb9 + f92de76 + 3ca0eb1 + 9a1d6b2 + 1f5ba4c + 5866028 + c27f32d + 7af1f91 + 5f5f1f5 + 26cc6a8 + abe2e52 + 4c27204 + 6c8095a + f8b5b15 commit c8ce4be

File tree

4 files changed

+212
-15
lines changed

4 files changed

+212
-15
lines changed

Source/Documentation/Manual/features-rollingstock.rst

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,8 @@ and the state of these parameters when the wagon or locomotive is full.
663663
single: EmptyORTSWagonFrontalArea
664664
single: EmptyORTSDavisDragConstant
665665
single: EmptyCentreOfGravity_Y
666+
single: EmptyBrakeRelayValveRatio
667+
single: EmptyBrakeRelayValveInshot
666668
single: IsGondola
667669
single: UnloadingStartDelay
668670
single: FreightAnimContinuous
@@ -680,11 +682,13 @@ and the state of these parameters when the wagon or locomotive is full.
680682
single: FullORTSWagonFrontalArea
681683
single: FullORTSDavisDragConstant
682684
single: FullCentreOfGravity_Y
685+
single: FullBrakeRelayValveRatio
686+
single: FullBrakeRelayValveInshot
683687

684688
To configure the stock correctly the following empty and full parameters need to be
685689
included in the ORTSFreightAnims file. Empty values are included in the first block,
686690
and full values are included in the second code block. A sample code block is shown
687-
below.::
691+
below::
688692

689693
ORTSFreightAnims
690694
(
@@ -720,6 +724,58 @@ below.::
720724
)
721725
)
722726

727+
For some rolling stock, it may be more realistic to handle variations in load/empty
728+
brake force by changing the brake cylinder pressure developed, rather than changing
729+
the brake force directly. In such cases, the empty/load relay valve parameters work
730+
best. Unlike other freight physics parameters, the relay valve ratio will not change
731+
continuously as freight is loaded. Instead, when the freight load is above 25% capacity,
732+
the loaded relay valve ratio is used, otherwise the empty ratio (or the ratio defined
733+
in the main .wag file) is used. The level of brake cylinder in-shot can also be changed
734+
depending on the load level as is often the case on load proportioning equipment. The
735+
standard behavior of these parameters is defined in more detail in the
736+
:ref:`air brakes physics <physics-braking-parameters>` section.
737+
738+
Here is an example of a gondola with a 50% load/empty valve::
739+
740+
ORTSMaxBrakeShoeForce ( 31300lb )
741+
MaxHandbrakeForce ( 32000lb )
742+
743+
ORTSFreightAnims (
744+
MSTSFreightAnimEnabled ( 0 )
745+
WagonEmptyWeight( 28.9t-us )
746+
747+
EmptyBrakeRelayValveRatio ( 0.5 )
748+
EmptyBrakeRelayValveInshot ( -15psi )
749+
750+
ORTSDavis_A ( 87.35lbf )
751+
ORTSDavis_B ( 0.289lbf/mph )
752+
ORTSDavis_C ( 0.144lbf/mph^2 )
753+
ORTSWagonFrontalArea ( 120ft^2 )
754+
ORTSDavisDragConstant ( 0.0012 )
755+
EmptyCentreOfGravity_Y ( 1.377 )
756+
IsGondola( 1 )
757+
UnloadingStartDelay ( 5 )
758+
759+
FreightAnimContinuous (
760+
IntakePoint ( 0.0 6.0 FreightCoal )
761+
Shape ( COAL_LOAD.s )
762+
MaxHeight ( 0.0 )
763+
MinHeight ( -2.2 )
764+
FreightWeightWhenFull ( 114.1t-us )
765+
FullAtStart ( 0 )
766+
767+
FullBrakeRelayValveRatio ( 1.0 )
768+
FullBrakeRelayValveInshot ( 0psi )
769+
770+
FullORTSDavis_A ( 258.5lbf )
771+
FullORTSDavis_B ( 1.43lbf/mph )
772+
FullORTSDavis_C ( 0.0504lbf/mph^2 )
773+
ORTSWagonFrontalArea ( 120ft^2 )
774+
ORTSDavisDragConstant ( 0.00042 )
775+
FullCentreOfGravity_Y ( 2.251 )
776+
)
777+
)
778+
723779
.. index::
724780
single: Shape
725781
single: MaxHeight

Source/Orts.Simulation/Simulation/RollingStocks/MSTSWagon.cs

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,8 @@ public void Load()
406406
float LoadEmptyMaxBrakeForceN;
407407
float LoadEmptyMaxHandbrakeForceN;
408408
float LoadEmptyCentreOfGravityM_Y;
409+
float LoadEmptyRelayValveRatio;
410+
float LoadEmptyInshotPSI;
409411

410412
float LoadFullMassKg;
411413
float LoadFullORTSDavis_A;
@@ -416,6 +418,8 @@ public void Load()
416418
float LoadFullMaxBrakeForceN;
417419
float LoadFullMaxHandbrakeForceN;
418420
float LoadFullCentreOfGravityM_Y;
421+
float LoadFullRelayValveRatio;
422+
float LoadFullInshotPSI;
419423

420424

421425
/// <summary>
@@ -782,6 +786,24 @@ public virtual void LoadFromWagFile(string wagFilePath)
782786
LoadEmptyCentreOfGravityM_Y = CentreOfGravityM.Y;
783787
}
784788

789+
if (FreightAnimations.EmptyRelayValveRatio > 0)
790+
{
791+
LoadEmptyRelayValveRatio = FreightAnimations.EmptyRelayValveRatio;
792+
}
793+
else if (BrakeSystem is AirSinglePipe brakes)
794+
{
795+
LoadEmptyRelayValveRatio = brakes.RelayValveRatio;
796+
}
797+
798+
if (FreightAnimations.EmptyInshotPSI != 0)
799+
{
800+
LoadEmptyInshotPSI = FreightAnimations.EmptyInshotPSI;
801+
}
802+
else if (BrakeSystem is AirSinglePipe brakes)
803+
{
804+
LoadEmptyInshotPSI = brakes.RelayValveInshotPSI;
805+
}
806+
785807
// Read (initialise) Static load ones if a static load
786808
// Test each value to make sure that it has been defined in the WAG file, if not default to Root WAG file value
787809
if (FreightAnimations.FullPhysicsStaticOne != null)
@@ -861,6 +883,24 @@ public virtual void LoadFromWagFile(string wagFilePath)
861883
{
862884
LoadFullCentreOfGravityM_Y = CentreOfGravityM.Y;
863885
}
886+
887+
if (FreightAnimations.FullPhysicsStaticOne.FullStaticRelayValveRatio > 0)
888+
{
889+
LoadFullRelayValveRatio = FreightAnimations.FullPhysicsStaticOne.FullStaticRelayValveRatio;
890+
}
891+
else if (BrakeSystem is AirSinglePipe brakes)
892+
{
893+
LoadFullRelayValveRatio = brakes.RelayValveRatio;
894+
}
895+
896+
if (FreightAnimations.FullPhysicsStaticOne.FullStaticInshotPSI > 0)
897+
{
898+
LoadFullInshotPSI = FreightAnimations.FullPhysicsStaticOne.FullStaticInshotPSI;
899+
}
900+
else if (BrakeSystem is AirSinglePipe brakes)
901+
{
902+
LoadFullInshotPSI = brakes.RelayValveInshotPSI;
903+
}
864904
}
865905

866906
// Read (initialise) Continuous load ones if a continuous load
@@ -951,6 +991,24 @@ public virtual void LoadFromWagFile(string wagFilePath)
951991
{
952992
LoadFullCentreOfGravityM_Y = CentreOfGravityM.Y;
953993
}
994+
995+
if (FreightAnimations.FullPhysicsContinuousOne.FullRelayValveRatio > 0)
996+
{
997+
LoadFullRelayValveRatio = FreightAnimations.FullPhysicsContinuousOne.FullRelayValveRatio;
998+
}
999+
else if (BrakeSystem is AirSinglePipe brakes)
1000+
{
1001+
LoadFullRelayValveRatio = brakes.RelayValveRatio;
1002+
}
1003+
1004+
if (FreightAnimations.FullPhysicsContinuousOne.FullInshotPSI != 0)
1005+
{
1006+
LoadFullInshotPSI = FreightAnimations.FullPhysicsContinuousOne.FullInshotPSI;
1007+
}
1008+
else if (BrakeSystem is AirSinglePipe brakes)
1009+
{
1010+
LoadFullInshotPSI = brakes.RelayValveInshotPSI;
1011+
}
9541012
}
9551013

9561014
if (!FreightAnimations.MSTSFreightAnimEnabled) FreightShapeFileName = null;
@@ -973,6 +1031,11 @@ public virtual void LoadFromWagFile(string wagFilePath)
9731031
// Update brake parameters
9741032
MaxBrakeForceN = LoadFullMaxBrakeForceN;
9751033
MaxHandbrakeForceN = LoadFullMaxHandbrakeForceN;
1034+
if (BrakeSystem is AirSinglePipe brakes)
1035+
{
1036+
brakes.RelayValveRatio = LoadFullRelayValveRatio;
1037+
brakes.RelayValveInshotPSI = LoadFullInshotPSI;
1038+
}
9761039

9771040
// Update friction related parameters
9781041
DavisAN = LoadFullORTSDavis_A;
@@ -997,6 +1060,12 @@ public virtual void LoadFromWagFile(string wagFilePath)
9971060
// Update brake parameters
9981061
MaxBrakeForceN = ((LoadFullMaxBrakeForceN - LoadEmptyMaxBrakeForceN) * TempMassDiffRatio) + LoadEmptyMaxBrakeForceN;
9991062
MaxHandbrakeForceN = ((LoadFullMaxHandbrakeForceN - LoadEmptyMaxHandbrakeForceN) * TempMassDiffRatio) + LoadEmptyMaxHandbrakeForceN;
1063+
// Not sensible to vary the relay valve ratio continouously; instead, it changes to loaded if more than 25% cargo is present
1064+
if (BrakeSystem is AirSinglePipe brakes)
1065+
{
1066+
brakes.RelayValveRatio = TempMassDiffRatio > 0.25f ? LoadFullRelayValveRatio : LoadEmptyRelayValveRatio;
1067+
brakes.RelayValveInshotPSI = TempMassDiffRatio > 0.25f ? LoadFullInshotPSI : LoadEmptyInshotPSI;
1068+
}
10001069

10011070
// Update friction related parameters
10021071
DavisAN = ((LoadFullORTSDavis_A - LoadEmptyORTSDavis_A) * TempMassDiffRatio) + LoadEmptyORTSDavis_A;
@@ -1025,6 +1094,11 @@ public virtual void LoadFromWagFile(string wagFilePath)
10251094
// Update brake physics
10261095
MaxBrakeForceN = LoadEmptyMaxBrakeForceN;
10271096
MaxHandbrakeForceN = LoadEmptyMaxHandbrakeForceN;
1097+
if (BrakeSystem is AirSinglePipe brakes)
1098+
{
1099+
brakes.RelayValveRatio = LoadEmptyRelayValveRatio;
1100+
brakes.RelayValveInshotPSI = LoadEmptyInshotPSI;
1101+
}
10281102

10291103
// Update friction related parameters
10301104
DavisAN = LoadEmptyORTSDavis_A;
@@ -1710,6 +1784,8 @@ public virtual void Copy(MSTSWagon copy)
17101784
LoadEmptyORTSDavis_C = copy.LoadEmptyORTSDavis_C;
17111785
LoadEmptyDavisDragConstant = copy.LoadEmptyDavisDragConstant;
17121786
LoadEmptyWagonFrontalAreaM2 = copy.LoadEmptyWagonFrontalAreaM2;
1787+
LoadEmptyRelayValveRatio = copy.LoadEmptyRelayValveRatio;
1788+
LoadEmptyInshotPSI = copy.LoadEmptyInshotPSI;
17131789
LoadFullMassKg = copy.LoadFullMassKg;
17141790
LoadFullCentreOfGravityM_Y = copy.LoadFullCentreOfGravityM_Y;
17151791
LoadFullMaxBrakeForceN = copy.LoadFullMaxBrakeForceN;
@@ -1719,6 +1795,8 @@ public virtual void Copy(MSTSWagon copy)
17191795
LoadFullORTSDavis_C = copy.LoadFullORTSDavis_C;
17201796
LoadFullDavisDragConstant = copy.LoadFullDavisDragConstant;
17211797
LoadFullWagonFrontalAreaM2 = copy.LoadFullWagonFrontalAreaM2;
1798+
LoadFullRelayValveRatio = copy.LoadFullRelayValveRatio;
1799+
LoadFullInshotPSI = copy.LoadFullInshotPSI;
17221800

17231801
if (copy.IntakePointList != null)
17241802
{
@@ -2110,6 +2188,12 @@ public override void Update(float elapsedClockSeconds)
21102188
// Update brake parameters
21112189
MaxBrakeForceN = ((LoadFullMaxBrakeForceN - LoadEmptyMaxBrakeForceN) * TempMassDiffRatio) + LoadEmptyMaxBrakeForceN;
21122190
MaxHandbrakeForceN = ((LoadFullMaxHandbrakeForceN - LoadEmptyMaxHandbrakeForceN) * TempMassDiffRatio) + LoadEmptyMaxHandbrakeForceN;
2191+
// Not sensible to vary the relay valve ratio continouously; instead, it changes to loaded if more than 25% cargo is present
2192+
if (BrakeSystem is AirSinglePipe brakes)
2193+
{
2194+
brakes.RelayValveRatio = TempMassDiffRatio > 0.25f ? LoadFullRelayValveRatio : LoadEmptyRelayValveRatio;
2195+
brakes.RelayValveInshotPSI = TempMassDiffRatio > 0.25f ? LoadFullInshotPSI : LoadEmptyInshotPSI;
2196+
}
21132197
// Update friction related parameters
21142198
DavisAN = ((LoadFullORTSDavis_A - LoadEmptyORTSDavis_A) * TempMassDiffRatio) + LoadEmptyORTSDavis_A;
21152199
DavisBNSpM = ((LoadFullORTSDavis_B - LoadEmptyORTSDavis_B) * TempMassDiffRatio) + LoadEmptyORTSDavis_B;
@@ -2217,6 +2301,12 @@ private void UpdateLocomotiveLoadPhysics()
22172301
// Update brake parameters
22182302
MaxBrakeForceN = ((LoadFullMaxBrakeForceN - LoadEmptyMaxBrakeForceN) * TempMassDiffRatio) + LoadEmptyMaxBrakeForceN;
22192303
MaxHandbrakeForceN = ((LoadFullMaxHandbrakeForceN - LoadEmptyMaxHandbrakeForceN) * TempMassDiffRatio) + LoadEmptyMaxHandbrakeForceN;
2304+
// Not sensible to vary the relay valve ratio continouously; instead, it changes to loaded if more than 25% cargo is present
2305+
if (BrakeSystem is AirSinglePipe brakes)
2306+
{
2307+
brakes.RelayValveRatio = TempMassDiffRatio > 0.25f ? LoadFullRelayValveRatio : LoadEmptyRelayValveRatio;
2308+
brakes.RelayValveInshotPSI = TempMassDiffRatio > 0.25f ? LoadFullInshotPSI : LoadEmptyInshotPSI;
2309+
}
22202310
// Update friction related parameters
22212311
DavisAN = ((LoadFullORTSDavis_A - LoadEmptyORTSDavis_A) * TempMassDiffRatio) + LoadEmptyORTSDavis_A;
22222312
DavisBNSpM = ((LoadFullORTSDavis_B - LoadEmptyORTSDavis_B) * TempMassDiffRatio) + LoadEmptyORTSDavis_B;
@@ -2263,6 +2353,12 @@ private void UpdateLocomotiveLoadPhysics()
22632353
// Update brake parameters
22642354
MaxBrakeForceN = ((LoadFullMaxBrakeForceN - LoadEmptyMaxBrakeForceN) * TempMassDiffRatio) + LoadEmptyMaxBrakeForceN;
22652355
MaxHandbrakeForceN = ((LoadFullMaxHandbrakeForceN - LoadEmptyMaxHandbrakeForceN) * TempMassDiffRatio) + LoadEmptyMaxHandbrakeForceN;
2356+
// Not sensible to vary the relay valve ratio continouously; instead, it changes to loaded if more than 25% cargo is present
2357+
if (BrakeSystem is AirSinglePipe brakes)
2358+
{
2359+
brakes.RelayValveRatio = TempMassDiffRatio > 0.25f ? LoadFullRelayValveRatio : LoadEmptyRelayValveRatio;
2360+
brakes.RelayValveInshotPSI = TempMassDiffRatio > 0.25f ? LoadFullInshotPSI : LoadEmptyInshotPSI;
2361+
}
22662362
// Update friction related parameters
22672363
DavisAN = ((LoadFullORTSDavis_A - LoadEmptyORTSDavis_A) * TempMassDiffRatio) + LoadEmptyORTSDavis_A;
22682364
DavisBNSpM = ((LoadFullORTSDavis_B - LoadEmptyORTSDavis_B) * TempMassDiffRatio) + LoadEmptyORTSDavis_B;
@@ -3204,6 +3300,12 @@ private void UpdateTenderLoad()
32043300
// Update brake parameters
32053301
MaxBrakeForceN = ((LoadFullMaxBrakeForceN - LoadEmptyMaxBrakeForceN) * TempTenderMassDiffRatio) + LoadEmptyMaxBrakeForceN;
32063302
MaxHandbrakeForceN = ((LoadFullMaxHandbrakeForceN - LoadEmptyMaxHandbrakeForceN) * TempTenderMassDiffRatio) + LoadEmptyMaxHandbrakeForceN;
3303+
// Not sensible to vary the relay valve ratio continouously; instead, it changes to loaded if more than 25% cargo is present
3304+
if (BrakeSystem is AirSinglePipe brakes)
3305+
{
3306+
brakes.RelayValveRatio = TempTenderMassDiffRatio > 0.25f ? LoadFullRelayValveRatio : LoadEmptyRelayValveRatio;
3307+
brakes.RelayValveInshotPSI = TempTenderMassDiffRatio > 0.25f ? LoadFullInshotPSI : LoadEmptyInshotPSI;
3308+
}
32073309
// Update friction related parameters
32083310
DavisAN = ((LoadFullORTSDavis_A - LoadEmptyORTSDavis_A) * TempTenderMassDiffRatio) + LoadEmptyORTSDavis_A;
32093311
DavisBNSpM = ((LoadFullORTSDavis_B - LoadEmptyORTSDavis_B) * TempTenderMassDiffRatio) + LoadEmptyORTSDavis_B;
@@ -3237,6 +3339,12 @@ private void UpdateTenderLoad()
32373339
// Update brake parameters
32383340
MaxBrakeForceN = ((LoadFullMaxBrakeForceN - LoadEmptyMaxBrakeForceN) * TempTenderMassDiffRatio) + LoadEmptyMaxBrakeForceN;
32393341
MaxHandbrakeForceN = ((LoadFullMaxHandbrakeForceN - LoadEmptyMaxHandbrakeForceN) * TempTenderMassDiffRatio) + LoadEmptyMaxHandbrakeForceN;
3342+
// Not sensible to vary the relay valve ratio continouously; instead, it changes to loaded if more than 25% cargo is present
3343+
if (BrakeSystem is AirSinglePipe brakes)
3344+
{
3345+
brakes.RelayValveRatio = TempTenderMassDiffRatio > 0.25f ? LoadFullRelayValveRatio : LoadEmptyRelayValveRatio;
3346+
brakes.RelayValveInshotPSI = TempTenderMassDiffRatio > 0.25f ? LoadFullInshotPSI : LoadEmptyInshotPSI;
3347+
}
32403348
// Update friction related parameters
32413349
DavisAN = ((LoadFullORTSDavis_A - LoadEmptyORTSDavis_A) * TempTenderMassDiffRatio) + LoadEmptyORTSDavis_A;
32423350
DavisBNSpM = ((LoadFullORTSDavis_B - LoadEmptyORTSDavis_B) * TempTenderMassDiffRatio) + LoadEmptyORTSDavis_B;

0 commit comments

Comments
 (0)