Skip to content

Commit d89c006

Browse files
committed
Automatic merge of T1.5.1-1197-g092fac25e3 and 15 pull requests
- Pull request #959 at 2452cb0: Fix TrackViewer crash on big zoom value - 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 #885 at 8f473ce: feat: Add notifications to Menu - Pull request #891 at 9a1d6b2: Auto save - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #952 at 8347095: Investigation - Pulsing graphics - Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes - Pull request #954 at e715fa4: Multiple Track Profiles & Superelevation Improvements - Pull request #962 at 46d0472: Fix pantographs on unpowered cars - Pull request #972 at e90a2aa: On Map window color changed switch or signal is not changed - Pull request #974 at 5faea6f: Bug fix for https://bugs.launchpad.net/or/+bug/2076034 Doors remain open in AI trains - Pull request #980 at a7406de: Downloading route content (Github, zip) second part - Pull request #900 at c27f32d: DMI updates - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder
17 parents 2fa51cb + 092fac2 + 2452cb0 + dfc715e + d00beb9 + 8f473ce + 9a1d6b2 + 1f5ba4c + 8347095 + a519452 + e715fa4 + 46d0472 + e90a2aa + 5faea6f + a7406de + c27f32d + f92de76 commit d89c006

File tree

11 files changed

+134
-149
lines changed

11 files changed

+134
-149
lines changed
Binary file not shown.

Source/Documentation/Manual/features-route.rst

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -952,20 +952,32 @@ and a third standard for 160 kph and up, the required Minimum/MaximumSpeed setti
952952
Note that the order of the ``ORTSSuperElevation`` blocks is important; they are read from top down
953953
so the slowest superelevation standard should be on top of all faster superelevation standards.
954954

955-
Open Rails also supports a simpler but less accurate way to define superelevation. It is
956-
recommended to not use this system as it does not follow the principles of real superelevation
957-
design, producing less accurate results. However, it has been retained to support prior routes.
955+
Open Rails also supports a simpler but less modern way to define superelevation based on curve
956+
radius only, without consideration for underbalance. This method may be appropriate for railroads
957+
built long in the past and will not produce the best results for modern routes.
958958
The parameter ``ORTSTrackSuperElevation`` can be added to the .trk file to define a table
959959
of superelevation values::
960960

961-
ORTSTrackSuperElevation ( x y .......... )
961+
ORTSTrackSuperElevation (
962+
x1 y1
963+
x2 y2
964+
........
965+
)
962966
963-
where x and y are a series of paired parameters specifying the curve radius in metres (x value),
964-
and the amount of superelevation in metres (y value). The statement will take as many paired
965-
values as desired. Each paired set of values must have an x and y value present. If it is desired
967+
where x and y are a series of paired parameters specifying the curve radius (default meters)
968+
(x value), and the amount of superelevation (default meters) (y value). The statement will take
969+
as many paired values as desired, as long as the radius values are in increasing order.
970+
Each paired set of values must have an x and y value present. If it is desired
966971
to 'hold' a certain value of SuperElevation for a number of different radii curves, then the same
967972
y value needs to be used for succeeding values of curve radius. Where the y value changes between
968-
curve radii, then Open Rails will extrapolate the y value between the two points.
973+
curve radii, then Open Rails will interpolate the y value between the two points.
974+
975+
Superelevation calculated using ``ORTSSuperElevation`` will generally override any values
976+
entered in ``ORTSTrackSuperElevation`` unless the ``ORTSSuperElevation`` block did not specify
977+
a value for ``MaxFreightUnderbalance`` or ``MaxPassengerUnderbalance``. If neither is given,
978+
superelevation will be replaced with the value given by ``ORTSTrackSuperElevation``, but will
979+
be adjusted to match the given values of minimum and maximum cant, precision, and runoff. This
980+
way, it is possible to represent a wide variety of superelevation configurations.
969981

970982

971983
Overhead (catenary) wire

Source/Menu/Options.Designer.cs

Lines changed: 14 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/Menu/Options.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ orderby folder.Key
345345
numericPerformanceTunerTarget.Enabled = checkPerformanceTuner.Checked;
346346

347347
// Experimental tab
348-
numericUseSuperElevation.Value = Settings.UseSuperElevation;
348+
checkUseSuperElevation.Checked = Settings.UseSuperElevation;
349349
numericSuperElevationGauge.Value = Settings.SuperElevationGauge;
350350
trackLODBias.Value = Settings.LODBias;
351351
trackLODBias_ValueChanged(null, null);
@@ -537,7 +537,7 @@ void buttonOK_Click(object sender, EventArgs e)
537537
Settings.PerformanceTunerTarget = (int)numericPerformanceTunerTarget.Value;
538538

539539
// Experimental tab
540-
Settings.UseSuperElevation = (int)numericUseSuperElevation.Value;
540+
Settings.UseSuperElevation = checkUseSuperElevation.Checked;
541541
Settings.SuperElevationGauge = (int)numericSuperElevationGauge.Value;
542542
Settings.LODBias = trackLODBias.Value;
543543
Settings.SignalLightGlow = checkSignalLightGlow.Checked;

Source/ORTS.Settings/UserSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ public enum DirectXFeature
290290

291291
// Experimental settings:
292292
[Default(0)]
293-
public int UseSuperElevation { get; set; }
293+
public bool UseSuperElevation { get; set; }
294294
[Default(1435)]
295295
public int SuperElevationGauge { get; set; }
296296
[Default(0)]

Source/Orts.Formats.Msts/RouteFile.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ public Tr_RouteFile(STFReader stf)
132132
if (RouteStart == null) throw new STFException(stf, "Missing RouteStart");
133133
if (ForestClearDistance == 0 && RemoveForestTreesFromRoads) Trace.TraceWarning("You must define also ORTSUserPreferenceForestClearDistance to avoid trees on roads");
134134
if (SuperElevation.Count <= 0) SuperElevation.Add(new SuperElevationStandard());
135-
else SuperElevationHgtpRadiusM = null; // Disable legacy superelevation system if newer system is defined
136135
}
137136

138137
public string RouteID; // ie JAPAN1 - used for TRK file and route folder name
@@ -232,12 +231,13 @@ public class SuperElevationStandard
232231
public float MaxFreightUnderbalanceM = float.PositiveInfinity;
233232
public float MaxPaxUnderbalanceM = float.PositiveInfinity;
234233
public float MinCantM = 0.0125f; // Default 1.25 cm ~ 0.5 inches
235-
public float MaxCantM = -1.0f; // Specified by user settings by default
234+
public float MaxCantM = 0.15f; // Default limit on superelevation is 15 cm ~ 6 inches
236235
public float MinSpeedMpS = MpS.FromKpH(25.0f); // Default 25 kmh ~ 15 mph
237236
public float MaxSpeedMpS = float.PositiveInfinity; // Default unlimited
238237
public float PrecisionM = 0.005f; // Default 5 mm ~ 0.2 inches
239238
public float RunoffSlope = 0.003f; // Maximum rate of change of superelevation per track length, default 0.3%
240239
public float RunoffSpeedMpS = 0.04f; // Maximum rate of change of superelevation per second, default 4 cm / sec ~ 1.5 inches / sec
240+
public bool UseLegacyCalculation = true; // Should ORTSTrackSuperElevation be used for superelevation calculations?
241241

242242
public SuperElevationStandard()
243243
{
@@ -260,6 +260,9 @@ public SuperElevationStandard(STFReader stf)
260260
new STFReader.TokenProcessor("maxrunoffspeed", () => { RunoffSpeedMpS = stf.ReadFloatBlock(STFReader.UNITS.Speed, null); }),
261261
});
262262

263+
// Disable legacy superelevation calculations if sufficient data is given
264+
if (MaxFreightUnderbalanceM <= 10.0f || MaxPaxUnderbalanceM <= 10.0f)
265+
UseLegacyCalculation = false;
263266
// Sanity check values of underbalance
264267
if (MaxFreightUnderbalanceM > 10.0f)
265268
{

0 commit comments

Comments
 (0)