Skip to content

Commit 2ebd1f6

Browse files
authored
Merge pull request #615 from Csantucci/EOT-official
Management of EOT devices https://blueprints.launchpad.net/or/+spec/eot
2 parents 76abf4e + 1c5a0b2 commit 2ebd1f6

File tree

27 files changed

+1457
-179
lines changed

27 files changed

+1457
-179
lines changed

Source/Documentation/Manual/cabs.rst

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,156 @@ Here an example of use of one of the controls::
507507
ORTSScreenPage ( "2300-0" )
508508
)
509509

510+
.. _cabs-eot:
511+
512+
EOT (End of Train device)
513+
-------------------------
514+
515+
See :ref:`here <physics-eot>` for full description of EOT features.
516+
517+
Following EOT controls are available for EOT management:
518+
519+
- ORTS_EOT_BRAKE_PIPE : displays the value of the brake pipe pressure at last wagon.
520+
The display is always enabled (even if the EOT is disarmed), because this display
521+
could be available also in other ways; however it is possible to mask the display
522+
using a texture driven by the EOT state.
523+
- ORTS_EOT_STATE_DISPLAY : may have values from 0 to 5, corresponding to the states listed :ref:`here <physics-eot-states>`
524+
- ORTS_EOT_ID : the EOT ID is generated as a 5-digit random number and can be displayed
525+
in the cab using this control; entering the ID by the train driver is not supported,
526+
as the .cvf files don't support as of now digital data entry
527+
- ORTS_EOT_COMM_TEST : driver command that starts the communication test between locomotive and EOT
528+
- ORTS_EOT_ARM_TWO_WAY : driver command passes the EOT from ArmNow to ArmedTwoWay
529+
- ORTS_EOT_DISARM : passes the EOT to disarmed state
530+
- ORTS_EOT_EMERGENCY_BRAKE (on-off): lets the EOT venting the brake pipe from the last train car.
531+
532+
These controls are available only using the mouse; only The last one can also be operated by the
533+
``<Ctrl+Backspace>`` key combination.
534+
535+
An example of implementation of the above controls can be seen
536+
:ref:`in this picture <physics-eot-display>`
537+
538+
The ``ORTS_EOT_EMERGENCY_BRAKE`` control can be implemented in the cab by an ON-OFF switch.
539+
540+
An example of implementation of the above controls in a .cvf file follows::
541+
542+
TwoState (
543+
Type ( ORTS_EOT_COMM_TEST TWO_STATE )
544+
Position ( 474 385 16.25 10 )
545+
Graphic ( "..\\..\\Common.Cab\\ES44v3\\softkey5trans.ace" )
546+
NumFrames ( 2 2 1 )
547+
Style ( WHILE_PRESSED )
548+
MouseControl ( 1 )
549+
ORTSDisplay ( 0 )
550+
ORTSScreenPage ( "2100-0" )
551+
)
552+
TwoState (
553+
Type ( ORTS_EOT_DISARM TWO_STATE )
554+
Position ( 493 385 16.25 10 )
555+
Graphic ( "..\\..\\Common.Cab\\ES44v3\\softkey5trans.ace" )
556+
NumFrames ( 2 2 1 )
557+
Style ( WHILE_PRESSED )
558+
MouseControl ( 1 )
559+
ORTSDisplay ( 0 )
560+
ORTSScreenPage ( "2100-0" )
561+
)
562+
TwoState (
563+
Type ( ORTS_EOT_ARM_TWO_WAY TWO_STATE )
564+
Position ( 511.7 385.7 16.25 10 )
565+
Graphic ( "..\\..\\Common.Cab\\ES44v3\\softkey7trans.ace" )
566+
NumFrames ( 2 2 1 )
567+
Style ( WHILE_PRESSED )
568+
MouseControl ( 1 )
569+
ORTSDisplay ( 0 )
570+
ORTSScreenPage ( "2100-0" )
571+
)
572+
MultiStateDisplay (
573+
Type ( ORTS_EOT_STATE_DISPLAY MULTI_STATE_DISPLAY )
574+
Position ( 516 314.5 17 5.15 )
575+
Graphic ( "..\\..\\Common.Cab\\ES44v3\\CommTest.ace" )
576+
States ( 2 2 1
577+
State (
578+
Style ( 0 )
579+
SwitchVal ( 0 )
580+
)
581+
State (
582+
Style ( 0 )
583+
SwitchVal ( 2 )
584+
)
585+
)
586+
ORTSDisplay ( 0 )
587+
ORTSScreenPage ( "2100-0" )
588+
)
589+
Digital (
590+
Type ( ORTS_EOT_ID DIGITAL )
591+
Position ( 421 313 22 8 )
592+
ScaleRange ( 0 999999 )
593+
Accuracy ( 0 )
594+
AccuracySwitch ( 0 )
595+
LeadingZeros ( 0 )
596+
Justification ( 1 )
597+
PositiveColour ( 1
598+
ControlColour ( 255 255 255 )
599+
)
600+
NegativeColour ( 1
601+
ControlColour ( 255 255 0 )
602+
)
603+
DecreaseColour ( 0
604+
ControlColour ( 0 0 0 )
605+
)
606+
Units ( KILO_LBS )
607+
ORTSFont ( 6 0 "Arial" )
608+
ORTSDisplay ( 0 )
609+
ORTSScreenPage ( "2100-0" )
610+
)
611+
MultiStateDisplay (
612+
Type ( ORTS_EOT_STATE_DISPLAY MULTI_STATE_DISPLAY )
613+
Position ( 513.5 328 22.66 5.15 )
614+
Graphic ( "..\\..\\Common.Cab\\ES44v3\\EOTStatus2.ace" )
615+
States ( 4 4 1
616+
State (
617+
Style ( 0 )
618+
SwitchVal ( 0 )
619+
)
620+
State (
621+
Style ( 0 )
622+
SwitchVal ( 2 )
623+
)
624+
State (
625+
Style ( 0 )
626+
SwitchVal ( 4 )
627+
)
628+
State (
629+
Style ( 0 )
630+
SwitchVal ( 5 )
631+
)
632+
)
633+
ORTSDisplay ( 0 )
634+
ORTSScreenPage ( "2100-0" )
635+
)
636+
MultiStateDisplay (
637+
Type ( ORTS_EOT_STATE_DISPLAY MULTI_STATE_DISPLAY )
638+
Position ( 431.4 292.1 9 5 )
639+
Graphic ( "..\\..\\Common.Cab\\ES44v3\\MaskEOT.ace" )
640+
States ( 2 2 1
641+
State (
642+
Style ( 0 )
643+
SwitchVal ( 0 )
644+
)
645+
State (
646+
Style ( 0 )
647+
SwitchVal ( 2 )
648+
)
649+
)
650+
)
651+
TwoState (
652+
Type ( ORTS_EOT_EMERGENCY_BRAKE TWO_STATE )
653+
Position ( 53.5 344.2 21.4 42.8 )
654+
Graphic ( ..\\..\\Common.Cab\\ES44v3\\EOTEmergency.ace )
655+
NumFrames ( 2 2 1 )
656+
Style ( ONOFF )
657+
MouseControl ( 1 )
658+
)
659+
510660

511661
Animated 2D Wipers
512662
------------------
Loading
Loading

Source/Documentation/Manual/physics.rst

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4684,3 +4684,154 @@ UoM - Angle (deg, radians) - default is rad. Typically this value maybe between
46844684
- ``ORTSWheelFlangeLength`` - Wheel flange length is defined as the length of flange starting from the beginning of the maximum flange angle
46854685
to the point where flange angle reduces to 26.6 degrees. UoM - Distance (m, in, ft, etc) - default is m
46864686

4687+
.. _physics-eot:
4688+
4689+
EOT - End of train device
4690+
=========================
4691+
4692+
General
4693+
-------
4694+
4695+
See :ref:`here https://en.wikipedia.org/wiki/End-of-train_device` for basic info about EOTs.
4696+
4697+
EOTs in Open Rails may be of three different levels (types)::
4698+
4699+
- No communication: "dumb" EOTs, like flags or flashing lamps
4700+
- One way: the EOT is capable to transmit to the lead locomotive the brake pipe pressure at the end of the train
4701+
- Two way: the EOT is also capable to receive a command to vent the air brake pipe.
4702+
4703+
How to define an EOT
4704+
--------------------
4705+
4706+
EOTs must be defined within subfolders of the ``Trains\ORTS_EOT`` folder. These subfolders contain
4707+
the same file set present in a subfolder of the ``Trains\Trainset`` folder; the file defining an EOT
4708+
has the same format as a .wag file, but it must have an .eot extension. To define the level of the EOT
4709+
the following block must be added at the end of the .eot file (after the closing parenthesis of the
4710+
Wagon() block)::
4711+
4712+
ORTSEOT (
4713+
Level ( "level" )
4714+
)
4715+
4716+
4717+
level may assume following values: ``NoComm``, ``OneWay`` and ``TwoWay``.
4718+
4719+
Usually EOTs were provided as a very short wagon for simulation with MSTS or OR. To upgrade it to
4720+
a functioning EOT for OR following simple steps are needed::
4721+
4722+
- Create the ``Trains\ORTS_EOT`` folder
4723+
- copy the EOT subfolder present in the ``Trains\Trainset`` folder into the ``Trains\ORTS_EOT`` folder
4724+
- change the extension of the .wag file(s) to .eot
4725+
- add at the end of the .eot file the ORTSEOT block.
4726+
4727+
For Open Rails the EOT is a special type (a subclass) of wagon, with specific features. As
4728+
such it appears at the end of the train in the Train Operations window.
4729+
4730+
How to attach and detach an EOT at the end of a train
4731+
-----------------------------------------------------
4732+
4733+
An EOT may be attached at the end of a train (be it player train or AI train)
4734+
already at game start,
4735+
by inserting at the end of the .con file a block like the following one::
4736+
ORTSEot (
4737+
EOTData ( EOT_OR TrainSimulations_EOT )
4738+
UiD ( 203 )
4739+
)
4740+
4741+
where ``ORTSEot`` and ``EOTData`` are fixed keywords, EOT_OR is the name of the .eot file
4742+
and TrainSimulations_EOT is the folder where EOT_OR.eot resides. TrainSimulations_EOT is
4743+
a subfolder of ``Trains\ORTS_EOT``.
4744+
4745+
If an EOT is present at the end of the train since game start, it will be fully operating
4746+
from the beginning
4747+
(in one-way state if it is a one-way EOT, and in two-way state if it is a two-way EOT).
4748+
4749+
An EOT may also be attached at the end of the actual player train using the EOT list window
4750+
4751+
4752+
.. image:: images/physics-eot.png
4753+
:scale: 80 %
4754+
:align: center
4755+
4756+
which can be recalled by pressing ``<Ctrl+F9>``. Such window lists all .eot files present in
4757+
the subfolders of ``Trains\ORTS_EOT``. If the train has an EOT at the end of it, the related row
4758+
in the EOT list window will be red. If the train has no EOT at the end of it (no red row), it can
4759+
be attached at the end of the train with following sequence:
4760+
4761+
- within the EOT list window click on the row showing the desired EOT; the row will become red
4762+
and the EOT will physically appear at the end of the train
4763+
- if it is an One Way or Two Way EOT type, connect its brake hose with the Car Operations
4764+
Window (see :ref:`here <driving-car-operations>`)
4765+
- using the Car Operations Window on the wagon preceding the EOT, open the rear angle cock.
4766+
4767+
When an EOT is attached to the actual player train, a line indicating its presence will appear
4768+
in the Train Driving Window (F5). The EOT will be in Disarmed state (that is fully disabled).
4769+
4770+
To detach an EOT from the end of the actual player train, recall the EOT list window and click
4771+
on the red row. The EOT will disappear. Always remember to detach the EOT when this
4772+
would occur in reality (e.g. when rear coupling other wagons, when decoupling the rear of the train
4773+
and in general before shunting).
4774+
4775+
How to arm (enable) or disarm a one-way or two-way EOT
4776+
------------------------------------------------------
4777+
4778+
The arm and disarm procedure must be performed from the cabview, as the controls are available only
4779+
through mouse. So it requires an equipped cabview. See :ref:`here <cabs-eot>` for a list of the
4780+
available controls.
4781+
4782+
The procedure for a two-way EOT is explained basing on the picture below, which shows a
4783+
sample case based on a cab of Borislav Miletic.
4784+
4785+
.. _physics-eot-display:
4786+
4787+
.. image:: images/physics-eot-display.png
4788+
:scale: 100 %
4789+
:align: center
4790+
4791+
.. _physics-eot-states:
4792+
4793+
The possible states for a two-way EOT are following ones::
4794+
* Disarmed,
4795+
* CommTestOn,
4796+
* Armed,
4797+
* LocalTestOn,
4798+
* ArmNow,
4799+
* ArmedTwoWay
4800+
4801+
The EOT state is shown in the Train Driving window using above terminology,
4802+
while the latter is a bit different in the EOT setup display in the sample cab
4803+
following a real case (but it may be modified).
4804+
4805+
When the EOT is attached to the train with the EOT List window, the EOT is in
4806+
``Disarmed`` state. An EOT ID appears as a 5-digit random number. In the cab
4807+
the Comm Test field shows ``Failed``.
4808+
4809+
By clicking on the key below the ``Comm Test`` soft button, the state in the
4810+
Train Driving window passes to the ``CommTestOn`` state. When the ``CommTestOn`` is
4811+
terminated, the state in the Train Driving window passes to the ``Armed`` state for
4812+
the one-way EOTs, and to the ``LocalTestOn`` state for the two-way EOTs.
4813+
In the EOT setup display the Comm Test field shows ``Passed`` and the EOT
4814+
Status Field shows ``One Way``. Now the ``Rear`` field shows the brake pipe
4815+
pressure at the end of the train.
4816+
4817+
The LocalTestOn in two-way EOTs is about 25 seconds long. After such time
4818+
interval the state shown in the Train Driving window passes to the ``ArmNow`` state, and
4819+
the EOT status in the display shows ``Arm Now``.
4820+
4821+
At this point the train driver must click the key below the ``Arm Two-Way`` soft button.
4822+
The EOT Passes to the ``ArmedTwoWay`` state, that is shown as ``Armed`` in the
4823+
EOT status within the EOT Status display.
4824+
4825+
By clicking the key below the ``Request Disarm`` soft button, the EOT returns to
4826+
the ``Disarmed`` state.
4827+
4828+
Emergency brake through EOT
4829+
---------------------------
4830+
4831+
Two-way EOTs, when in the ``ArmedTwoWay`` state, can be requested to vent the brake pipe
4832+
and therefore to cause an emergency brake. This occurs automatically when an Emergency
4833+
brake is triggered, and also manually when the ``ORTS_EOT_EMERGENCY_BRAKE``
4834+
control is activated. The manual activation may also occur by pressing
4835+
``<Ctrl+Backspace>`` .
4836+
4837+

Source/ORTS.Common/Input/UserCommand.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public enum UserCommand
4747
[GetString("Display Next Station Window")] DisplayNextStationWindow,
4848
[GetString("Display Compass Window")] DisplayCompassWindow,
4949
[GetString("Display Train List Window")] DisplayTrainListWindow,
50+
[GetString("Display EOT List Window")] DisplayEOTListWindow,
5051

5152
[GetString("Debug Speed Up")] DebugSpeedUp,
5253
[GetString("Debug Speed Down")] DebugSpeedDown,
@@ -144,6 +145,7 @@ public enum UserCommand
144145
[GetString("Control Brake Hose Disconnect")] ControlBrakeHoseDisconnect,
145146
[GetString("Control Alerter")] ControlAlerter,
146147
[GetString("Control Emergency Push Button")] ControlEmergencyPushButton,
148+
[GetString("Control EOT Emergency Brake")] ControlEOTEmergencyBrake,
147149
[GetString("Control Sander")] ControlSander,
148150
[GetString("Control Sander Toggle")] ControlSanderToggle,
149151
[GetString("Control Wiper")] ControlWiper,

Source/ORTS.Settings/InputSettings.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ static void InitializeCommands(UserCommandInput[] Commands)
375375
Commands[(int)UserCommand.ControlDynamicBrakeIncrease] = new UserCommandKeyInput(0x34);
376376
Commands[(int)UserCommand.ControlElectricTrainSupply] = new UserCommandKeyInput(0x30, KeyModifiers.Alt);
377377
Commands[(int)UserCommand.ControlEmergencyPushButton] = new UserCommandKeyInput(0x0E);
378+
Commands[(int)UserCommand.ControlEOTEmergencyBrake] = new UserCommandKeyInput(0x0E, KeyModifiers.Control);
378379
Commands[(int)UserCommand.ControlEngineBrakeDecrease] = new UserCommandKeyInput(0x1A);
379380
Commands[(int)UserCommand.ControlEngineBrakeIncrease] = new UserCommandKeyInput(0x1B);
380381
Commands[(int)UserCommand.ControlBrakemanBrakeDecrease] = new UserCommandKeyInput(0x1A, KeyModifiers.Alt);
@@ -486,6 +487,7 @@ static void InitializeCommands(UserCommandInput[] Commands)
486487
Commands[(int)UserCommand.DisplayTrackMonitorWindow] = new UserCommandModifiableKeyInput(0x3E, Commands[(int)UserCommand.DisplayNextWindowTab]);
487488
Commands[(int)UserCommand.DisplayTrainOperationsWindow] = new UserCommandKeyInput(0x43);
488489
Commands[(int)UserCommand.DisplayTrainDpuWindow] = new UserCommandKeyInput(0x43, KeyModifiers.Shift);
490+
Commands[(int)UserCommand.DisplayEOTListWindow] = new UserCommandKeyInput(0x43, KeyModifiers.Control);
489491

490492
Commands[(int)UserCommand.GameAutopilotMode] = new UserCommandKeyInput(0x1E, KeyModifiers.Alt);
491493
Commands[(int)UserCommand.GameChangeCab] = new UserCommandKeyInput(0x12, KeyModifiers.Control);

Source/Orts.Formats.Msts/ActivityFile.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,6 +1300,7 @@ public TrainCfg(STFReader stf) {
13001300
new STFReader.TokenProcessor("durability", ()=>{ Durability = stf.ReadFloatBlock(STFReader.UNITS.None, null); }),
13011301
new STFReader.TokenProcessor("wagon", ()=>{ WagonList.Add(new Wagon(stf)); }),
13021302
new STFReader.TokenProcessor("engine", ()=>{ WagonList.Add(new Wagon(stf)); }),
1303+
new STFReader.TokenProcessor("ortseot", ()=>{ WagonList.Add(new Wagon(stf)); }),
13031304
new STFReader.TokenProcessor("ortstraincontrolsystemparameters", () => TcsParametersFileName = stf.ReadStringBlock(null)),
13041305
});
13051306
}
@@ -1310,6 +1311,7 @@ public class Wagon {
13101311
public string Name;
13111312
public int UiD;
13121313
public bool IsEngine;
1314+
public bool IsEOT;
13131315
public bool Flip;
13141316

13151317
public Wagon(STFReader stf) {
@@ -1319,6 +1321,7 @@ public Wagon(STFReader stf) {
13191321
new STFReader.TokenProcessor("flip", ()=>{ stf.MustMatch("("); stf.MustMatch(")"); Flip = true; }),
13201322
new STFReader.TokenProcessor("enginedata", ()=>{ stf.MustMatch("("); Name = stf.ReadString(); Folder = stf.ReadString(); stf.MustMatch(")"); IsEngine = true; }),
13211323
new STFReader.TokenProcessor("wagondata", ()=>{ stf.MustMatch("("); Name = stf.ReadString(); Folder = stf.ReadString(); stf.MustMatch(")"); }),
1324+
new STFReader.TokenProcessor("eotdata", ()=>{ stf.MustMatch("("); Name = stf.ReadString(); Folder = stf.ReadString(); stf.MustMatch(")"); IsEOT = true; }),
13221325
});
13231326
}
13241327

Source/Orts.Formats.Msts/CabViewFile.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,13 @@ public enum CABViewControlTypes
206206
ORTS_GENERIC_ITEM2,
207207
ORTS_SCREEN_SELECT,
208208
ORTS_STATIC_DISPLAY,
209+
ORTS_EOT_BRAKE_PIPE,
210+
ORTS_EOT_STATE_DISPLAY,
211+
ORTS_EOT_ID,
212+
ORTS_EOT_COMM_TEST,
213+
ORTS_EOT_DISARM,
214+
ORTS_EOT_ARM_TWO_WAY,
215+
ORTS_EOT_EMERGENCY_BRAKE,
209216

210217
// TCS Controls
211218
ORTS_TCS1,

0 commit comments

Comments
 (0)