Skip to content

Commit cf1e593

Browse files
authored
Merge pull request #1062 from rwf-rr/train-forces-popup-window
Train Forces popup Window.
2 parents 9d945d0 + 9a76b26 commit cf1e593

File tree

10 files changed

+526
-0
lines changed

10 files changed

+526
-0
lines changed

Source/Documentation/Manual/driving.rst

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,77 @@ specified by the player:
470470

471471
.. image:: images/driving-train-names-multiplayer.png
472472

473+
Alt-F7 Train Forces
474+
-------------------
475+
476+
Pressing ``<Alt+F7>`` opens the Train Forces window.
477+
It shows the forces along the player's train in bar-graph form.
478+
The window is sized to fit the train (graph), with a minimum size for short trains,
479+
and a maximum size for very long trains.
480+
Scrolling may be required to see the end of the train, or the end of the text line.
481+
482+
.. image:: images/driving-trainforces.png
483+
:align: center
484+
:scale: 80%
485+
486+
The train is shown as a white line; locomotives are shown in blue.
487+
The front of the train is to the left.
488+
489+
``Coupler Force``
490+
'''''''''''''''''
491+
492+
Shows the length-wise pull or push force at each coupling, as a colored bar graph.
493+
Up (positive) is pull, down (negative) is push.
494+
The scale is determined by the weakest coupler in the train.
495+
The steps are non-linear, to provide more sensitivity near the breaking point.
496+
497+
Note: Because the graph is scaled by the weakest car,
498+
a red bar may not mean that the coupler will break.
499+
When the car has a higher coupler strength, it can tolerate higher forces than the weakest car.
500+
501+
``Derail Force``
502+
''''''''''''''''
503+
504+
Shows the sideway push or pull at the wheels as a colored bar graph.
505+
Up (positive) is pull to the inside (stringline), down (negative) is push to the outside (jackknife).
506+
The scale is determined by the car with the lowest axle-load (lowest vertical force).
507+
The steps are non-linear, to provide more sensitivity near the derailing point.
508+
But this is less effective for lateral forces, as the force is proportional to the curve radius,
509+
which changes in discrete steps (MSTS legacy).
510+
511+
Note: Because the graph is scaled by the most susceptible car,
512+
a red bar may not mean that the car will derail.
513+
When the car has a higher vertical force, it can tolerate higher lateral forces than the most susceptible car.
514+
515+
516+
``Brake Force``
517+
'''''''''''''''
518+
519+
Shows the braking force of each car as a bar graph.
520+
The scale is determined by the car with the smallest brake force (generally lowest weight).
521+
The steps are non-linear, to provide more sensitivity near the small brake applications.
522+
As the weight (and thus brake force varies greatly between cars (and especially engines),
523+
the graph can be quite jagged, even though all brake cylinders have the same pressure.
524+
Locomotives will show a full bar long before the brakes are fully applied.
525+
526+
Dynamic braking is shown in blue (unless there also is a greater force from the air-brakes).
527+
528+
``Text Line``
529+
'''''''''''''
530+
531+
The text line at the bottom shows the following information.
532+
533+
- Max Coupler: The current maximum coupler force within the train,
534+
and the car (count from front, including locomotives) where the maximum force is.
535+
- Max Derail: The current maximum derail force within the train,
536+
and the car (count from front, including locomotives) where the maximum force is.
537+
- Low Coupler: The lowest coupler strength within the train.
538+
- Low Derail: The lowest derail force within the train.
539+
This is an estimate, based on the vertical force.
540+
Dynamic factors also affect the force needed to derail.
541+
542+
It may be necessary to scroll to see the rightmost parts of the line.
543+
473544
F8 Switch Monitor
474545
-----------------
475546

Loading

Source/Orts.Common/Conversions.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,13 @@ public static string FormatForce(float forceN, bool isMetric)
782782
return String.Format(CultureInfo.CurrentCulture, kilo ? "{0:F1} {1}" : "{0:F0} {1}", force, unit);
783783
}
784784

785+
public static string FormatLargeForce(float forceN, bool isMetric)
786+
{
787+
var force = isMetric ? forceN : N.ToLbf(forceN);
788+
var unit = isMetric ? kN : klbf;
789+
return String.Format(CultureInfo.CurrentCulture, "{0:F1} {1}", force * 1e-3f, unit);
790+
}
791+
785792
public static string FormatTemperature(float temperatureC, bool isMetric, bool isDelta)
786793
{
787794
var temperature = isMetric ? temperatureC : isDelta ? C.ToDeltaF(temperatureC) : C.ToF(temperatureC);

Source/Orts.Common/Input/UserCommand.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public enum UserCommand
6464
[GetString("Display Train Car Operations Window")] DisplayTrainCarOperationsWindow,
6565
[GetString("Display Train Dpu Window")] DisplayTrainDpuWindow,
6666
[GetString("Display Next Station Window")] DisplayNextStationWindow,
67+
[GetString("Display Train Forces Window")] DisplayTrainForcesWindow,
6768
[GetString("Display Compass Window")] DisplayCompassWindow,
6869
[GetString("Display Train List Window")] DisplayTrainListWindow,
6970
[GetString("Display EOT List Window")] DisplayEOTListWindow,

Source/Orts.Settings/InputSettings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ static void InitializeCommands(UserCommandInput[] Commands)
518518
Commands[(int)UserCommand.DisplayTrainOperationsWindow] = new UserCommandKeyInput(0x43, KeyModifiers.Control | KeyModifiers.Alt);
519519
Commands[(int)UserCommand.DisplayTrainDpuWindow] = new UserCommandKeyInput(0x43, KeyModifiers.Shift);
520520
Commands[(int)UserCommand.DisplayEOTListWindow] = new UserCommandKeyInput(0x43, KeyModifiers.Control);
521+
Commands[(int)UserCommand.DisplayTrainForcesWindow] = new UserCommandKeyInput(0x41, KeyModifiers.Alt);
521522
Commands[(int)UserCommand.DisplayControlRectangle] = new UserCommandKeyInput(0x3F, KeyModifiers.Control);
522523

523524
Commands[(int)UserCommand.GameAutopilotMode] = new UserCommandKeyInput(0x1E, KeyModifiers.Alt);

Source/Orts.Settings/UserSettings.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,8 @@ public string DirectXFeatureLevel
386386
public int[] WindowPosition_ComposeMessage { get; set; }
387387
[Default(new[] { 100, 0 })]
388388
public int[] WindowPosition_TrainList { get; set; }
389+
[Default(new[] { 50, 50 })]
390+
public int[] WindowPosition_TrainForces { get; set; }
389391
[Default("")]
390392
public string LastViewNotificationDate { get; set; }
391393

807 Bytes
Loading

Source/RunActivity/RunActivity.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
<Link>Native\X64\OpenAL32.dll</Link>
4343
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
4444
</Content>
45+
<Content Include="Content\TrainForcesSprites.png">
46+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
47+
</Content>
4548
<Content Include="Content\blank.bmp">
4649
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
4750
</Content>

0 commit comments

Comments
 (0)