Skip to content

Commit 89854d3

Browse files
committed
Add entries for the manual
1 parent 29eee68 commit 89854d3

File tree

3 files changed

+234
-2
lines changed

3 files changed

+234
-2
lines changed

Source/Documentation/Manual/cabs.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,24 @@ The following controls are available for the cabview:
166166
- ``ORTS_ELECTRIC_TRAIN_SUPPLY_COMMAND_SWITCH`` can be used to control the electric train supply switch
167167
- ``ORTS_ELECTRIC_TRAIN_SUPPLY_ON`` can be used to indicate that the electric train supply line is powered on
168168

169+
.. _cabs-voltmeters:
170+
171+
Voltmeters
172+
----------
173+
174+
.. index::
175+
single: LINE_VOLTAGE
176+
single: ORTS_PANTOGRAPH_VOLTAGE_AC
177+
single: ORTS_PANTOGRAPH_VOLTAGE_DC
178+
single: ORTS_BATTERY_VOLTAGE
179+
180+
The following voltmeters are available for the cabview:
181+
182+
- ``LINE_VOLTAGE`` indicates the line voltage
183+
- ``ORTS_PANTOGRAPH_VOLTAGE_AC`` indicates the line voltage when operating on AC lines
184+
- ``ORTS_PANTOGRAPH_VOLTAGE_DC`` indicates the line voltage when operating on DC lines
185+
- ``ORTS_BATTERY_VOLTAGE`` indicates the vehicle's battery voltage
186+
169187
.. _cabs-dieselenginesonoff:
170188

171189
Controls to switch on and off diesel engines

Source/Documentation/Manual/features-rollingstock.rst

Lines changed: 90 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1841,6 +1841,9 @@ Scripts will run if referenced by OR-specific fields in the .eng file.
18411841
single: ORTSEngineBrakeController
18421842
single: ORTSCircuitBreaker
18431843
single: ORTSTractionCutOffRelay
1844+
single: ORTSPantographSelector
1845+
single: ORTSVoltageSelector
1846+
single: ORTSPowerLimitationSelector
18441847
single: ORTSPowerSupply
18451848
single: ORTSTrainControlSystem
18461849

@@ -1872,6 +1875,15 @@ Scripts will run if referenced by OR-specific fields in the .eng file.
18721875
* - Passenger car power supply
18731876
- ``ORTS.Scripting.Api.PassengerCarPowerSupply``
18741877
- ``Wagon ( ORTSPowerSupply ( "DemoPower.cs" ) )``
1878+
* - Pantograph selector
1879+
- ``ORTS.Scripting.Api.PantographSelector``
1880+
- ``Engine ( ORTSPantographSelector ( Script ( "DemoPantographSelector.cs" ) ) )``
1881+
* - Voltage selector
1882+
- ``ORTS.Scripting.Api.VoltageSelector``
1883+
- ``Engine ( ORTSVoltageSelector ( Script ( "DemoVoltageSelector.cs" ) ) )``
1884+
* - Power limitation selector
1885+
- ``ORTS.Scripting.Api.PowerLimitationSelector``
1886+
- ``Engine ( ORTSPantographSelector ( Script ( "DemoPowerLimitator.cs" ) ) )``
18751887
* - Train Control System
18761888
- ``ORTS.Scripting.Api.TrainControlSystem``
18771889
- ``Engine ( ORTSTrainControlSystem ( "DemoTCS.cs" ) )``
@@ -2054,14 +2066,66 @@ Use the following .eng parameter to load a traction cut-off relay script::
20542066
)
20552067

20562068
``ORTSTractionCutOffRelay`` refers to the traction cut-off relay script in the engine's ``Script``
2057-
subfolder. For this field, the .cs extension is optional. "Automatic" and "Manual" load the generic OR
2058-
traction cut-off relay implementation, so do `not` use these names for your own script.
2069+
subfolder. For this field, the .cs extension is optional. Alternatively, there are several
2070+
built-in OR traction cut-off relay implementations:
2071+
2072+
- "Automatic": no driver intervention required, circuit breaker is closed when conditions are met.
2073+
- "Manual": a traction cut-off switch with open and closed positions.
2074+
- "PushButtons": a traction cut-off relay with dedicated open and close buttons.
2075+
2076+
Please do `not` use these names for your own script, since the generic implementation will
2077+
be loaded instead.
20592078

20602079
``ORTSTractionCutOffRelayClosingDelay`` refers to the delay between the closing command of the traction cut-off relay
20612080
and the effective closing of the relay.
20622081

2082+
.. _features-scripting-powerselectors
2083+
2084+
Pantograph, voltage and power limitation selectors
2085+
--------------------------------------------------
2086+
2087+
Available for electric locomotives only. The scripts control
2088+
the behavior of the locomotive's
2089+
:ref:`pantograph selector <physics-pantograph-selector>`,
2090+
:ref:`voltage selector <physics-voltage-selector>` and
2091+
:ref:`power limitation selector <physics-power-limitation-selector>` respectively.
2092+
2093+
.. index::
2094+
single: ORTSPantographSelector
2095+
single: ORTSVoltageSelector
2096+
single: ORTSPowerLimitationSelector
2097+
2098+
Use the following .eng parameters to load power selector scripts::
2099+
2100+
Engine (
2101+
ORTSPantographSelector (
2102+
Script ( "YourPSScript.cs" )
2103+
SelectorPositions ( ... )
2104+
)
2105+
ORTSVoltageSelector (
2106+
Script ( "YourVSScript.cs" )
2107+
SelectorPositions ( ... )
2108+
)
2109+
ORTSPowerLimitationSelector (
2110+
Script ( "YourPLSScript.cs" )
2111+
SelectorPositions ( ... )
2112+
)
2113+
)
2114+
2115+
``Script`` refers to the circuit breaker script in the engine's ``Script``
2116+
subfolder. For this field, the .cs extension is optional. Alternatively, there are several
2117+
built-in OR selector implementations which can be used if custom features such as interlocking
2118+
with other devices are not required:
2119+
2120+
- "Default": a selector with sequential positions.
2121+
- "Circular": same as above, but the first position follows again after the last one.
2122+
2123+
Please do `not` use these names for your own script, since the generic implementation will
2124+
be loaded instead.
2125+
20632126
.. _features-scripting-powersupply:
20642127

2128+
20652129
Diesel and electric power supply
20662130
--------------------------------
20672131

@@ -2081,6 +2145,7 @@ Use the following .eng parameter to load a power supply script::
20812145

20822146
Engine (
20832147
ORTSPowerSupply ( "YourEPS.cs" )
2148+
ORTSPowerSupplyParameters ( "YourEPS.ini" )
20842149
ORTSPowerOnDelay ( 5s )
20852150
ORTSAuxPowerOnDelay ( 10s )
20862151
)
@@ -2089,6 +2154,12 @@ Use the following .eng parameter to load a power supply script::
20892154
subfolder. For this field, the .cs extension is optional. "Default" will load the generic OR power supply
20902155
implementation, so do `not` use this name for your own script.
20912156

2157+
``ORTSPowerSupplyParameters``, an optional field, refers to an .ini file,
2158+
also in the ``Script`` subfolder, whose parameters will be made available to the
2159+
power supply script through the ``GetBoolParameter()``, ``GetIntParameter()``,
2160+
``GetFloatParameter()``, and ``GetStringParameter()`` methods. This .ini file provides for easy customization of
2161+
the behavior of the power supply script by end users.
2162+
20922163
``ORTSPowerOnDelay`` refers to the delay between the closing of the circuit breaker or the traction cut-off relay
20932164
and the availability of the power for traction.
20942165

@@ -2470,6 +2541,23 @@ which may be used this way within the script:
24702541
24712542
so that, instead of ORTS_TCSnn the related mnemonic string is displayed.
24722543

2544+
Generic cabview controls are also available for the Power Supply subsystem. They are named ORTS_POWER_SUPPLY1, ORTS_POWER_SUPPLY2
2545+
and so on in the cabview file. Their usage is the same as for the TCS controls.
2546+
2547+
Events related to power supply controls are made available to power supply scripts via ``TCSEvent.GenericTCSButtonPressed``,
2548+
``TCSEvent.GenericTCSButtonReleased``, ``TCSEvent.GenericTCSSwitchOff`` and ``TCSEvent.GenericTCSSwitchOn`` events,
2549+
received asynchronously by script through the method:
2550+
2551+
.. code-block:: csharp
2552+
2553+
public override void HandleEvent(PowerSupplyEvent evt, string message)
2554+
2555+
As for the TCS buttons, message is a string representing the control number with zero-base indexing
2556+
(e.g. "5" corresponds to ORTS_POWER_SUPPLY6).
2557+
2558+
SetCabDisplayControl and SetCustomizedCabviewControlName methods, which work in the same
2559+
way as their TCS counterparts, are accessible from all power supply scripts.
2560+
24732561
Helper classes
24742562
--------------
24752563
3 helper classes are available in the ``Orts.Scripting.Api`` namespace:

Source/Documentation/Manual/physics.rst

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,132 @@ for Pantograph 2 (replacing 2 with 3 and 4).
947947
The third panto is moved with Ctrl-P, while the fourth panto is moved with Ctrl-Shift-P.
948948
The cabview controls must be named ORTS_PANTOGRAPH3 and ORTS_PANTOGRAPH4.
949949

950+
.. _physics-pantograph-selector:
951+
952+
Pantograph selector
953+
'''''''''''''''''''
954+
955+
.. index::
956+
single: ORTSPantographSelector
957+
single: SelectorPositions
958+
single: SelectorPosition
959+
960+
When using customized :ref:`power supply scripts:<features-scripting-powersupply>`,
961+
it is possible to implement a pantograph selector that selects a specific pantograph
962+
combination direcly, without operating every pantograph control individually.
963+
964+
Example::
965+
966+
Engine (
967+
ORTSPowerSupply ( "YourEPSScript.cs" )
968+
ORTSPantographSelector (
969+
Script ( Default )
970+
SelectorPositions (
971+
SelectorPosition (
972+
Name ( "Zero" )
973+
Default ()
974+
)
975+
SelectorPosition (
976+
Name ( "Local" )
977+
)
978+
SelectorPosition (
979+
Name ( "Rear" )
980+
)
981+
SelectorPosition (
982+
Name ( "Front" )
983+
)
984+
SelectorPosition (
985+
Name ( "All" )
986+
)
987+
)
988+
)
989+
)
990+
991+
In combination with a customized power supply script, you can use the pantograph selector
992+
to achieve different pantograph combinations, for example:
993+
994+
- Position "Zero" would keep all pantographs down
995+
- Position "Local" would only raise the pantograph from the lead locomotive
996+
- Position "Rear" would raise the pantograph only of rear-facing locomotives (this is the usually
997+
the standard position for EMUs, with only the rear pantograph being raised, and the front power head
998+
is powered through the roof line)
999+
- Position "Front" would raise the pantograph only of front-facing locomotives
1000+
- Position "All" would raise all pantographs
1001+
1002+
Please note that this only works with custom scripts.
1003+
1004+
.. _physics-voltage-selector:
1005+
1006+
Voltage selector
1007+
''''''''''''''''
1008+
1009+
.. index::
1010+
single: ORTSVoltageSelector
1011+
single: SelectorPositions
1012+
single: SelectorPosition
1013+
1014+
When using customized :ref:`power supply scripts:<features-scripting-powersupply>`,
1015+
it is possible to implement a voltage selector that automatically raises the pantograph
1016+
associated to the selected voltage.
1017+
1018+
Example::
1019+
1020+
Engine (
1021+
ORTSPowerSupply ( "YourEPSScript.cs" )
1022+
ORTSVoltageSelector (
1023+
Script ( Default )
1024+
SelectorPositions (
1025+
SelectorPosition (
1026+
Name ( "AC" )
1027+
Voltage ( 25000 )
1028+
)
1029+
SelectorPosition (
1030+
Name ( "DC" )
1031+
Voltage ( 1500 )
1032+
)
1033+
)
1034+
)
1035+
)
1036+
1037+
Please note that this only works with custom scripts.
1038+
1039+
.. _physics-power-limitation-selector:
1040+
1041+
Power limitation selector
1042+
'''''''''''''''''''''''''
1043+
1044+
.. index::
1045+
single: ORTSPowerLimitationSelector
1046+
single: SelectorPositions
1047+
single: SelectorPosition
1048+
1049+
The power limitation selector allows limiting the total current drawn from
1050+
the overhead wire.
1051+
1052+
Example::
1053+
1054+
Engine (
1055+
ORTSPowerLimitationSelector (
1056+
Script ( Default )
1057+
SelectorPositions (
1058+
SelectorPosition (
1059+
Name ( "Conventional line" )
1060+
MaxPower ( 1200kW )
1061+
Default()
1062+
)
1063+
SelectorPosition (
1064+
Name ( "High speed line" )
1065+
MaxPower ( 1800kW )
1066+
)
1067+
)
1068+
)
1069+
)
1070+
1071+
Depending on the controller position, the power consumption of every locomotive will be limited.
1072+
1073+
In combination with customized :ref:`power supply scripts:<features-scripting-powersupply>`, more
1074+
advanced power limits can be imposed, e.g. depending on the number of locomotives in the trainset.
1075+
9501076
.. _physics-circuit-breaker:
9511077

9521078
Circuit breaker

0 commit comments

Comments
 (0)