Skip to content

Commit 7c5396f

Browse files
committed
Automatic merge of T1.5.1-1088-g264349b1ce and 20 pull requests
- Pull request #891 at 9a1d6b2: Auto save - Pull request #954 at 3efaf6d: Multiple Track Profiles & Superelevation Improvements - Pull request #959 at 2452cb0: Fix TrackViewer crash on big zoom value - Pull request #972 at e90a2aa: On Map window color changed switch or signal is not changed - Pull request #976 at 877cc94: Increased center of gravity range - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #882 at 8f695a4: Blueprint/train car operations UI window - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #922 at a3bc9e7: Autopilot for timetable mode - Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes - Pull request #962 at 46d0472: Fix pantographs on unpowered cars - Pull request #970 at 6fa5eed: feat: Remove unnecessary Windows.Forms usage - Pull request #973 at c35be87: fix: Using singular target framework to allow for different platforms across different projects - Pull request #974 at 5faea6f: Bug fix for https://bugs.launchpad.net/or/+bug/2076034 Doors remain open in AI trains - Pull request #975 at b2dd5c0: Bug fix for https://bugs.launchpad.net/or/+bug/2076133 Crash when AI train dissolves near camera - Pull request #900 at c27f32d: DMI updates - Pull request #903 at 9dabe97: Downloading route content (Github, zip) - Pull request #799 at dfc715e: Consolidated wind simulation - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #952 at 8347095: Investigation - Pulsing graphics
22 parents 563a7cf + 264349b + 9a1d6b2 + 3efaf6d + 2452cb0 + e90a2aa + 877cc94 + d00beb9 + 8f695a4 + 1f5ba4c + a3bc9e7 + a519452 + 46d0472 + 6fa5eed + c35be87 + 5faea6f + b2dd5c0 + c27f32d + 9dabe97 + dfc715e + f92de76 + 8347095 commit 7c5396f

File tree

3 files changed

+140
-82
lines changed

3 files changed

+140
-82
lines changed

Source/Documentation/Manual/features-route.rst

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,7 @@ Defining Curve Superelevation
867867
single: MaxRunOffSlope
868868
single: MaxRunOffSpeed
869869
single: MinimumSpeed
870+
single: MaximumSpeed
870871

871872
This feature allows curves within the route to be assigned a value for superelevation. It
872873
is inserted either in the route's root .trk file or in the "Include" .trk file.
@@ -879,7 +880,8 @@ To define a superelevation standard, add a ``ORTSSuperElevation`` block to the r
879880
file and add some (or all) of the following parameters inside the ``ORTSSuperElevation`` block:
880881

881882
- ``MaxFreightUnderbalance`` -- The maximum amount (using units of length) of cant deficiency/underbalance
882-
that should be allowed for trains travelling at the freight speed limit. (Default 5 cm ~ 2 inches.)
883+
that should be allowed for trains travelling at the freight speed limit. Larger allowed underbalance
884+
results in less extreme superelevation. (Default 5 cm ~ 2 inches.)
883885
- ``MaxPassengerUnderbalance`` -- The maximum amount (using units of length) of cant deficiency/underbalance
884886
that should be allowed for trains travelling at the passenger speed limit. (Default 7.5 cm ~ 3 inches.)
885887
For comfort reasons, the underbalance values should be equal to or less than the
@@ -889,7 +891,8 @@ file and add some (or all) of the following parameters inside the ``ORTSSuperEle
889891
- ``MinimumCant`` -- If a curve needs superelevation, the amount of superelevation will be no lower than
890892
this value (given in units of length). (Default 1.25 cm ~ 0.5 inches.)
891893
- ``MaximumCant`` -- Sets the maximum amount of superelevation (units of length) that any curve is allowed
892-
to have, regardless of other factors. Usually curves should be designed to avoid reaching this limit.
894+
to have, regardless of other factors. Usually curves should be designed to avoid reaching this limit, as
895+
exceeding the limit could result in excessive curve force or even trains toppling over at low speeds.
893896
(Default is determined by the superelevation setting in the options menu. Level 0 = 7 cm, level 10 = 17 cm.)
894897
- ``Precision`` -- Determines the accuracy (in length) to which the superelevation is maintained. If
895898
the superelevation required by a curve is not a nice number, it will be rounded up to the nearest
@@ -902,6 +905,9 @@ file and add some (or all) of the following parameters inside the ``ORTSSuperEle
902905
track at high speeds. (Default 4 cm/sec ~ 1.5 inches/sec.)
903906
- ``MinimumSpeed`` -- The minimum speed limit required for superelevation to be added to a curve. Useful for
904907
preventing superelevation from being generated in yards. (Default 25 kmh ~ 15 mph.)
908+
- ``MaximumSpeed`` -- The maximum speed limit allowed for superelevation to be added to a curve. This
909+
is only useful if a route needs multiple sets of superelevation settings. See section below for a
910+
description on use of multiple superelevation standards. (Default unlimited.)
905911

906912
Any parameters not specified will use the default values, which are suitable for most medium-speed routes.
907913
Upon route loading, the given parameters will be used to calculate the appropriate amount of superelevation
@@ -919,6 +925,33 @@ defines the superelevation standard used by Union Pacific is given below::
919925
MinimumSpeed ( 15mph )
920926
)
921927

928+
More than one ``ORTSSuperElevation`` block can be added to the .trk file to facilitate routes that require
929+
different superelevation standards for different track speeds (for example, a route with both standard speed
930+
160 kmh tracks and dedicated 300 kmh high speed tracks). If a track has a speed limit below ``MinimumSpeed``
931+
or above ``MaximumSpeed``, the track will skip the superelevation standard defined and check the next standard in
932+
the .trk file to see if the speed limit is in between the min and max of that standard. Only if the track
933+
speed is out of bounds for every superelevation standard will no superelevation be applied at all. For
934+
example, to have 3 different types of superelevation on one route, one from 25-60 kmh, another from 60-160 kmh,
935+
and a third standard for 160 kph and up, the required Minimum/MaximumSpeed settings would look like this::
936+
937+
ORTSSuperElevation(
938+
...
939+
MinimumSpeed ( 25km/h )
940+
MaximumSpeed ( 60km/h )
941+
)
942+
ORTSSuperElevation(
943+
...
944+
MinimumSpeed ( 60km/h )
945+
MaximumSpeed ( 160km/h )
946+
)
947+
ORTSSuperElevation(
948+
...
949+
MinimumSpeed ( 160km/h )
950+
)
951+
952+
Note that the order of the ``ORTSSuperElevation`` blocks is important; they are read from top down
953+
so the slowest superelevation standard should be on top of all faster superelevation standards.
954+
922955
Open Rails also supports a simpler but less accurate way to define superelevation. It is
923956
recommended to not use this system as it does not follow the principles of real superelevation
924957
design, producing less accurate results. However, it has been retained to support prior routes.

Source/Orts.Formats.Msts/RouteFile.cs

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ public Tr_RouteFile(STFReader stf)
105105
new STFReader.TokenProcessor("ortsuserpreferenceremoveforesttreesfromroads", ()=>{ RemoveForestTreesFromRoads = stf.ReadBoolBlock(false); }),
106106
// values for superelevation
107107
new STFReader.TokenProcessor("ortstracksuperelevation", ()=>{ SuperElevationHgtpRadiusM = new Interpolator(stf); }),
108-
new STFReader.TokenProcessor("ortssuperelevation", ()=>{ SuperElevationHgtpRadiusM = null; SuperElevation = new SuperElevationStandard(stf); }),
108+
// New superelevation standard, will overwrite ORTSTrackSuperElevation
109+
new STFReader.TokenProcessor("ortssuperelevation", ()=>{ SuperElevationHgtpRadiusM = null; SuperElevation.Add(new SuperElevationStandard(stf)); }),
109110
// images
110111
new STFReader.TokenProcessor("graphic", ()=>{ Thumbnail = stf.ReadStringBlock(null); }),
111112
new STFReader.TokenProcessor("loadingscreen", ()=>{ LoadingScreen = stf.ReadStringBlock(null); }),
@@ -130,7 +131,7 @@ public Tr_RouteFile(STFReader stf)
130131
if (Description == null) throw new STFException(stf, "Missing Description");
131132
if (RouteStart == null) throw new STFException(stf, "Missing RouteStart");
132133
if (ForestClearDistance == 0 && RemoveForestTreesFromRoads) Trace.TraceWarning("You must define also ORTSUserPreferenceForestClearDistance to avoid trees on roads");
133-
if (SuperElevation == null) SuperElevation = new SuperElevationStandard();
134+
if (SuperElevation.Count <= 0) SuperElevation.Add(new SuperElevationStandard());
134135
}
135136

136137
public string RouteID; // ie JAPAN1 - used for TRK file and route folder name
@@ -151,7 +152,7 @@ public Tr_RouteFile(STFReader stf)
151152
public string DefaultSignalSMS;
152153
public float TempRestrictedSpeed = -1f;
153154
public Interpolator SuperElevationHgtpRadiusM; // Superelevation of tracks as a function of radius, deprecated
154-
public SuperElevationStandard SuperElevation;
155+
public List<SuperElevationStandard> SuperElevation = new List<SuperElevationStandard>();
155156

156157
// Values for calculating Tunnel Resistance - will override default values.
157158
public float SingleTunnelAreaM2;
@@ -227,14 +228,15 @@ public string ENVFileName(SeasonType seasonType, WeatherType weatherType)
227228

228229
public class SuperElevationStandard
229230
{
230-
public float SuperElevationMaxFreightUnderbalanceM = 0.05f; // Default 5 cm ~ 2 inches
231-
public float SuperElevationMaxPaxUnderbalanceM = 0.075f; // Default 7.5 cm ~ 3 inches
232-
public float SuperElevationMinCantM = 0.0125f; // Default 1.25 cm ~ 0.5 inches
233-
public float SuperElevationMaxCantM; // Specified by user settings by default
234-
public float SuperElevationMinSpeedMpS = MpS.FromKpH(25.0f); // Default 25 kmh ~ 15 mph
235-
public float SuperElevationPrecisionM = 0.005f; // Default 5 mm ~ 0.2 inches
236-
public float SuperElevationRunoffSlope = 0.003f; // Maximum rate of change of superelevation per track length, default 0.3%
237-
public float SuperElevationRunoffSpeedMpS = 0.04f; // Maximum rate of change of superelevation per second, default 4 cm / sec ~ 1.5 inches / sec
231+
public float MaxFreightUnderbalanceM = 0.05f; // Default 5 cm ~ 2 inches
232+
public float MaxPaxUnderbalanceM = 0.075f; // Default 7.5 cm ~ 3 inches
233+
public float MinCantM = 0.0125f; // Default 1.25 cm ~ 0.5 inches
234+
public float MaxCantM = -1.0f; // Specified by user settings by default
235+
public float MinSpeedMpS = MpS.FromKpH(25.0f); // Default 25 kmh ~ 15 mph
236+
public float MaxSpeedMpS = float.PositiveInfinity; // Default unlimited
237+
public float PrecisionM = 0.005f; // Default 5 mm ~ 0.2 inches
238+
public float RunoffSlope = 0.003f; // Maximum rate of change of superelevation per track length, default 0.3%
239+
public float RunoffSpeedMpS = 0.04f; // Maximum rate of change of superelevation per second, default 4 cm / sec ~ 1.5 inches / sec
238240

239241
public SuperElevationStandard()
240242
{
@@ -244,16 +246,16 @@ public SuperElevationStandard(STFReader stf)
244246
{
245247
stf.MustMatch("(");
246248
stf.ParseBlock(new STFReader.TokenProcessor[] {
247-
new STFReader.TokenProcessor("maxfreightunderbalance", () => { SuperElevationMaxFreightUnderbalanceM = stf.ReadFloatBlock(STFReader.UNITS.Distance, null); }),
248-
new STFReader.TokenProcessor("maxpassengerunderbalance", () => { SuperElevationMaxPaxUnderbalanceM = stf.ReadFloatBlock(STFReader.UNITS.Distance, null); }),
249-
new STFReader.TokenProcessor("minimumcant", () => { SuperElevationMinCantM = stf.ReadFloatBlock(STFReader.UNITS.Distance, null); }),
250-
new STFReader.TokenProcessor("maximumcant", () => { SuperElevationMaxCantM = stf.ReadFloatBlock(STFReader.UNITS.Distance, null); }),
251-
new STFReader.TokenProcessor("minimumspeed", () => { SuperElevationMinSpeedMpS = stf.ReadFloatBlock(STFReader.UNITS.Speed, null); }),
252-
new STFReader.TokenProcessor("precision", () => { SuperElevationPrecisionM = stf.ReadFloatBlock(STFReader.UNITS.Distance, null); }),
253-
new STFReader.TokenProcessor("maxrunoffslope", () => { SuperElevationRunoffSlope = stf.ReadFloatBlock(STFReader.UNITS.None, null); }),
254-
new STFReader.TokenProcessor("maxrunoffspeed", () => { SuperElevationRunoffSpeedMpS = stf.ReadFloatBlock(STFReader.UNITS.Speed, null); }),
249+
new STFReader.TokenProcessor("maxfreightunderbalance", () => { MaxFreightUnderbalanceM = stf.ReadFloatBlock(STFReader.UNITS.Distance, null); }),
250+
new STFReader.TokenProcessor("maxpassengerunderbalance", () => { MaxPaxUnderbalanceM = stf.ReadFloatBlock(STFReader.UNITS.Distance, null); }),
251+
new STFReader.TokenProcessor("minimumcant", () => { MinCantM = stf.ReadFloatBlock(STFReader.UNITS.Distance, null); }),
252+
new STFReader.TokenProcessor("maximumcant", () => { MaxCantM = stf.ReadFloatBlock(STFReader.UNITS.Distance, null); }),
253+
new STFReader.TokenProcessor("minimumspeed", () => { MinSpeedMpS = stf.ReadFloatBlock(STFReader.UNITS.Speed, null); }),
254+
new STFReader.TokenProcessor("maximumspeed", () => { MaxSpeedMpS = stf.ReadFloatBlock(STFReader.UNITS.Speed, null); }),
255+
new STFReader.TokenProcessor("precision", () => { PrecisionM = stf.ReadFloatBlock(STFReader.UNITS.Distance, null); }),
256+
new STFReader.TokenProcessor("maxrunoffslope", () => { RunoffSlope = stf.ReadFloatBlock(STFReader.UNITS.None, null); }),
257+
new STFReader.TokenProcessor("maxrunoffspeed", () => { RunoffSpeedMpS = stf.ReadFloatBlock(STFReader.UNITS.Speed, null); }),
255258
});
256-
stf.SkipRestOfBlock();
257259
}
258260
}
259261

0 commit comments

Comments
 (0)