Skip to content

Commit 4a5757f

Browse files
authored
Merge pull request #399 from Sharpe49/power-supply
Power supply package http://www.elvastower.com/forums/index.php?/topic/35071-version-14/page__view__findpost__p__271864
2 parents 5b55e3f + fd559af commit 4a5757f

File tree

78 files changed

+9311
-4364
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+9311
-4364
lines changed

Source/Documentation/Manual/cabs.rst

Lines changed: 87 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,91 @@ next paragraphs.
1919
OR adds support for the ETCS circular speed gauge, as described
2020
:ref:`here <options-etcs>`.
2121

22+
.. _cabs-battery-switch:
23+
24+
Battery switch
25+
--------------
26+
27+
.. index::
28+
single: ORTS_BATTERY_SWITCH_COMMAND_SWITCH
29+
single: ORTS_BATTERY_SWITCH_COMMAND_BUTTON_CLOSE
30+
single: ORTS_BATTERY_SWITCH_ON
31+
32+
The :ref:`battery switch <physics-battery-switch>` controls the low voltage power supply of the locomotive.
33+
34+
The following controls are available for the cabview:
35+
36+
- ``ORTS_BATTERY_SWITCH_COMMAND_SWITCH`` can be used if the switch is directly controlled from the cab
37+
- ``ORTS_BATTERY_SWITCH_COMMAND_BUTTON_CLOSE`` and ``ORTS_BATTERY_SWITCH_COMMAND_BUTTON_OPEN`` can be used if the switch is controlled with two pushbuttons (one to close the switch and the other to open it)
38+
- ``ORTS_BATTERY_SWITCH_ON`` can be used to control a light on the cab showing the state of the battery switch
39+
40+
Other controls can be hidden if the low voltage power supply is not available using the following parameter::
41+
42+
TwoState (
43+
Type ( ORTS_CIRCUIT_BREAKER_CLOSED TWO_STATE)
44+
...
45+
DisabledIfLowVoltagePowerSupplyOff ( 1 )
46+
)
47+
48+
.. _cabs-master-key:
49+
50+
Master key
51+
----------
52+
53+
.. index::
54+
single: ORTS_MASTER_KEY
55+
single: ORTS_CURRENT_CAB_IN_USE
56+
single: ORTS_OTHER_CAB_IN_USE
57+
58+
The :ref:`master key <physics-master-key>` controls the power supply of the cab.
59+
60+
The following controls are available for the cabview:
61+
62+
- ``ORTS_MASTER_KEY`` can be used in order to control the master key
63+
- ``ORTS_CURRENT_CAB_IN_USE`` can be used to indicate that the current cab is active
64+
- ``ORTS_OTHER_CAB_IN_USE`` can be used to indicate that another cab of the train is active
65+
66+
Other controls can be hidden if the cab power supply is not available using the following parameter::
67+
68+
TwoState (
69+
Type ( ORTS_CIRCUIT_BREAKER_CLOSED TWO_STATE)
70+
...
71+
DisabledIfCabPowerSupplyOff ( 1 )
72+
)
73+
74+
.. _cabs-service-retention:
75+
76+
Service retention
77+
-----------------
78+
79+
.. index::
80+
single: ORTS_SERVICE_RETENTION_BUTTON
81+
single: ORTS_SERVICE_RETENTION_CANCELLATION_BUTTON
82+
83+
The :ref:`service retention <physics-service-retention>` can be used to disable a cab without cutting the power on the train.
84+
It can only be used with a power supply script that uses this functionality.
85+
86+
The following controls are available for the cabview:
87+
88+
- ``ORTS_SERVICE_RETENTION_BUTTON`` can be used in order to enable the service retention
89+
- ``ORTS_SERVICE_RETENTION_CANCELLATION_BUTTON`` can be used in order to cancel the service retention
90+
91+
.. _cabs-electric-train-supply:
92+
93+
Electric train supply
94+
---------------------
95+
96+
.. index::
97+
single: ORTS_ELECTRIC_TRAIN_SUPPLY_COMMAND_SWITCH
98+
single: ORTS_ELECTRIC_TRAIN_SUPPLY_ON
99+
100+
The :ref:`electric train supply <physics-electric-train-supply>` controls the power line that supplies the passenger cars with electricity.
101+
102+
The following controls are available for the cabview:
103+
104+
- ``ORTS_ELECTRIC_TRAIN_SUPPLY_COMMAND_SWITCH`` can be used to control the electric train supply switch
105+
- ``ORTS_ELECTRIC_TRAIN_SUPPLY_ON`` can be used to indicate that the electric train supply line is powered on
106+
22107
.. _cabs-dieselenginesonoff:
23108

24109
Controls to switch on and off diesel engines
@@ -329,18 +414,15 @@ Further OR cab controls
329414
-----------------------
330415

331416
OR supports the cabview control to open/close the left doors, the right doors
332-
and the mirrors. Moreover it supports the controls for the battery state and for
333-
the key state; these two controls have no effect on the state of the locomotive.
417+
and the mirrors.
334418

335419
.. index::
336420
single: ORTS_LEFTDOOR
337421
single: ORTS_RIGHTDOOR
338422
single: ORTS_MIRRORS
339-
single: ORTS_BATTERY
340-
single: ORTS_POWERKEY
341423

342424
The control blocks are like the one shown for the cab light. The Type strings
343-
are ORTS_LEFTDOOR, ORTS_RIGHTDOOR, ORTS_MIRRORS, ORTS_BATTERY and ORTS_POWERKEY.
425+
are ORTS_LEFTDOOR, ORTS_RIGHTDOOR and ORTS_MIRRORS.
344426

345427

346428
High-resolution Cab Backgrounds and Controls

Source/Documentation/Manual/features-rollingstock.rst

Lines changed: 122 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,9 @@ Scripts will run if referenced by OR-specific fields in the .eng file.
619619

620620
.. index::
621621
single: ORTSTrainBrakeController
622+
single: ORTSEngineBrakeController
622623
single: ORTSCircuitBreaker
624+
single: ORTSTractionCutOffRelay
623625
single: ORTSPowerSupply
624626
single: ORTSTrainControlSystem
625627

@@ -630,15 +632,27 @@ Scripts will run if referenced by OR-specific fields in the .eng file.
630632
* - System
631633
- C# class
632634
- .eng block
633-
* - Brakes
635+
* - Train brake controller
634636
- ``ORTS.Scripting.Api.BrakeController``
635637
- ``Engine ( ORTSTrainBrakeController ( "DemoBrakes.cs" ) )``
638+
* - Engine brake controller
639+
- ``ORTS.Scripting.Api.BrakeController``
640+
- ``Engine ( ORTSEngineBrakeController ( "DemoBrakes.cs" ) )``
636641
* - Circuit breaker
637642
- ``ORTS.Scripting.Api.CircuitBreaker``
638643
- ``Engine ( ORTSCircuitBreaker ( "DemoBreaker.cs" ) )``
644+
* - Traction cut-off relay
645+
- ``ORTS.Scripting.Api.TractionCutOffRelay``
646+
- ``Engine ( ORTSTractionCutOffRelay ( "DemoRelay.cs" ) )``
647+
* - Diesel power supply
648+
- ``ORTS.Scripting.Api.DieselPowerSupply``
649+
- ``Engine ( ORTSPowerSupply ( "DemoPower.cs" ) )``
639650
* - Electric power supply
640651
- ``ORTS.Scripting.Api.ElectricPowerSupply``
641652
- ``Engine ( ORTSPowerSupply ( "DemoPower.cs" ) )``
653+
* - Passenger car power supply
654+
- ``ORTS.Scripting.Api.PassengerCarPowerSupply``
655+
- ``Wagon ( ORTSPowerSupply ( "DemoPower.cs" ) )``
642656
* - Train Control System
643657
- ``ORTS.Scripting.Api.TrainControlSystem``
644658
- ``Engine ( ORTSTrainControlSystem ( "DemoTCS.cs" ) )``
@@ -738,8 +752,6 @@ script, which will be caught by RunActivity.exe if run inside Visual Studio.
738752
Note that Visual Studio uses relative paths, so if you ever move any folders,
739753
you'll need to fix the references by hand.
740754

741-
.. _features-scripting-cb:
742-
743755
Brake controller
744756
----------------
745757

@@ -750,6 +762,7 @@ of the brake controls and set the air pressures of the brake reservoirs.
750762

751763
.. index::
752764
single: ORTSTrainBrakeController
765+
single: ORTSEngineBrakeController
753766

754767
Use the following .eng parameter to load a brake controller script::
755768

@@ -766,6 +779,8 @@ or::
766779
The .cs extension is optional. "MSTS" loads the default MSTS-compatible
767780
implementation, so do `not` use this name for your own script.
768781

782+
.. _features-scripting-cb:
783+
769784
Circuit breaker
770785
---------------
771786

@@ -780,32 +795,127 @@ Use the following .eng parameter to load a circuit breaker script::
780795

781796
Engine (
782797
ORTSCircuitBreaker ( "YourCB.cs" )
798+
ORTSCircuitBreakerClosingDelay ( 2s )
783799
)
784800

785-
The .cs extension is optional. "Automatic" and "Manual" load the generic OR
801+
``ORTSCircuitBreaker`` refers to the circuit breaker script in the engine's ``Script``
802+
subfolder. For this field, the .cs extension is optional. "Automatic" and "Manual" load the generic OR
786803
circuit breaker implementation, so do `not` use these names for your own script.
787804

788-
.. _features-scripting-eps:
805+
``ORTSCircuitBreakerClosingDelay`` refers to the delay between the closing command of the circuit breaker
806+
and the effective closing of the circuit breaker.
789807

790-
Electric power supply
791-
---------------------
808+
.. _features-scripting-tcor:
809+
810+
Traction cut-off relay
811+
----------------------
812+
813+
Available for diesel locomotives only. The traction cut-off relay script controls
814+
the behavior of the locomotive's
815+
:ref:`traction cut-off relay <physics-traction-cut-off-relay>`.
816+
817+
.. index::
818+
single: ORTSTractionCutOffRelay
792819

793-
Available for electric locomotives only. The power supply script determines
794-
whether or not the locomotive :ref:`is serviceable <physics-power-supply>` given
820+
Use the following .eng parameter to load a traction cut-off relay script::
821+
822+
Engine (
823+
ORTSTractionCutOffRelay ( "YourTCOR.cs" )
824+
ORTSTractionCutOffRelayClosingDelay ( 2s )
825+
)
826+
827+
``ORTSTractionCutOffRelay`` refers to the traction cut-off relay script in the engine's ``Script``
828+
subfolder. For this field, the .cs extension is optional. "Automatic" and "Manual" load the generic OR
829+
traction cut-off relay implementation, so do `not` use these names for your own script.
830+
831+
``ORTSTractionCutOffRelayClosingDelay`` refers to the delay between the closing command of the traction cut-off relay
832+
and the effective closing of the relay.
833+
834+
.. _features-scripting-powersupply:
835+
836+
Diesel and electric power supply
837+
--------------------------------
838+
839+
Available for diesel and electric locomotives only. The power supply script determines
840+
whether or not the locomotive is serviceable (see also the description of :ref:`the diesel power supply <physics-diesel-power-supply>`
841+
and :ref:`the electric power supply <physics-electric-power-supply>`) given
795842
the current line voltage, pantograph position, circuit breaker state, etc.
843+
It is also capable of forbidding some operations related to the power supply if some conditions
844+
are not met.
796845

797846
.. index::
798847
single: ORTSPowerSupply
848+
single: ORTSPowerOnDelay
849+
single: ORTSAuxPowerOnDelay
799850

800-
Use the following .eng paramater to load an electric power supply script::
851+
Use the following .eng parameter to load a power supply script::
801852

802853
Engine (
803854
ORTSPowerSupply ( "YourEPS.cs" )
855+
ORTSPowerOnDelay ( 5s )
856+
ORTSAuxPowerOnDelay ( 10s )
804857
)
805858

806-
The .cs extension is optional. "Default" will load the generic OR power supply
859+
``ORTSPowerSupply`` refers to the power supply script in the engine's ``Script``
860+
subfolder. For this field, the .cs extension is optional. "Default" will load the generic OR power supply
807861
implementation, so do `not` use this name for your own script.
808862

863+
``ORTSPowerOnDelay`` refers to the delay between the closing of the circuit breaker or the traction cut-off relay
864+
and the availability of the power for traction.
865+
866+
``ORTSAuxPowerOnDelay`` refers to the delay between the closing of the circuit breaker or the traction cut-off relay
867+
and the availability of the power for auxiliary systems.
868+
869+
.. _features-scripting-passenger-car-power-supply:
870+
871+
Passenger car power supply
872+
--------------------------
873+
874+
Available for passenger cars using electric heating. The power supply script determines
875+
whether or not the systems of the cars have power and calculates the power consumption
876+
on the :ref:`Electric Train Supply <physics-electric-train-supply>`.
877+
878+
.. index::
879+
single: ORTSPowerSupply
880+
single: ORTSPowerOnDelay
881+
single: ORTSPowerSupplyContinuousPower
882+
single: ORTSPowerSupplyHeatingPower
883+
single: ORTSPowerSupplyAirConditioningPower
884+
single: ORTSPowerSupplyAirConditioningYield
885+
single: ORTSHeatingCompartmentTemperatureSet
886+
887+
If the locomotive is a diesel locomotive, the power consumed by the cars is no longer available for traction.
888+
889+
Use the following .wag parameter to load a power supply script::
890+
891+
Wagon (
892+
ORTSPowerSupply ( "YourEPS.cs" )
893+
ORTSPowerOnDelay ( 5s )
894+
ORTSPowerSupplyContinuousPower ( 500W )
895+
ORTSPowerSupplyHeatingPower ( 2kW )
896+
ORTSPowerSupplyAirConditioningPower ( 3kW )
897+
ORTSPowerSupplyAirConditioningYield ( 0.9 )
898+
ORTSHeatingCompartmentTemperatureSet ( 20degC )
899+
)
900+
901+
``ORTSPowerSupply`` refers to the power supply script in the wagon's ``Script``
902+
subfolder. For this field, the .cs extension is optional. "Default" will load the generic OR power supply
903+
implementation, so do `not` use this name for your own script.
904+
905+
``ORTSPowerOnDelay`` refers to the delay between the availability of the power on the Electric Train Supply
906+
cable and the availability of the power for the systems (for example, start-up of the static power converter).
907+
908+
``ORTSPowerSupplyContinuousPower`` refers to the power which is consumed continuously (for example, battery chargers, lights, etc.).
909+
910+
``ORTSPowerSupplyHeatingPower`` refers to the power which is consumed when the heating is active.
911+
912+
``ORTSPowerSupplyAirConditioningPower`` refers to the power which is consumed when the air conditioning (cooling) is active.
913+
914+
``ORTSPowerSupplyAirConditioningYield`` refers to the yield of the air conditioning (ratio of the heat flow rate
915+
by the electric power of the air conditioning system).
916+
917+
``ORTSHeatingCompartmentTemperatureSet`` refers to the desired temperature inside the car.
918+
809919

810920
.. _features-scripting-tcs:
811921

@@ -1216,7 +1326,7 @@ The blinker ``On`` property will alternate between ``true`` and ``false`` at the
12161326

12171327
.. code-block:: csharp
12181328
1219-
SetCabDisplayControl(0, RSOBlinker.On ? 1 : 0);
1329+
SetCabDisplayControl(0, MyBlinker.On ? 1 : 0);
12201330
12211331
Please note that, when the blinker is stopped, the ``On`` property is ``false``.
12221332

0 commit comments

Comments
 (0)