Skip to content

Commit d05fd51

Browse files
authored
Merge branch 'openrails:master' into creation_automation
2 parents 5817d3d + ade0195 commit d05fd51

File tree

130 files changed

+12674
-5690
lines changed

Some content is hidden

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

130 files changed

+12674
-5690
lines changed

Build.cmd

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ FOR /F "usebackq tokens=1* delims==" %%A IN (`CALL GetVersion.cmd %Mode%`) DO SE
8383
REM Restore NuGet packages.
8484
nuget restore Source\ORTS.sln || GOTO :error
8585

86-
REM Recreate Program directory for output.
86+
REM Recreate Program directory for output and delete previous build files.
8787
CALL :recreate "Program" || GOTO :error
88+
CALL :delete "OpenRails-%Mode%*" || GOTO :error
8889

8990
REM Build main program.
9091
REM Disable warning CS1591 "Missing XML comment for publicly visible type or member".
@@ -126,11 +127,14 @@ IF NOT "%Mode%" == "Unstable" (
126127
NET stop ClickToRunSvc
127128
NET start ClickToRunSvc
128129

129-
REM Recreate Documentation folder for output.
130-
CALL :recreate "Program\Documentation" || GOTO :error
130+
REM Create the documentation folders for output.
131+
CALL :create "Program\Documentation" || GOTO :error
132+
CALL :create "Program\Documentation\Online" || GOTO :error
133+
CALL :create "Program\Documentation\es" || GOTO :error
131134

132135
REM Compile the documentation.
133136
FOR %%E IN (doc docx docm xls xlsx xlsm odt) DO FOR %%F IN ("Source\Documentation\*.%%E") DO ECHO %%~F && OfficeToPDF.exe /bookmarks /print "%%~F" "Program\Documentation\%%~nF.pdf" || GOTO :error
137+
FOR %%E IN (doc docx docm xls xlsx xlsm odt) DO FOR %%F IN ("Source\Documentation\Online\*.%%E") DO ECHO %%~F && OfficeToPDF.exe /bookmarks /print "%%~F" "Program\Documentation\Online\%%~nF.pdf" || GOTO :error
134138
>"Source\Documentation\Manual\version.py" ECHO version = '%OpenRails_Version%' || GOTO :error
135139
>>"Source\Documentation\Manual\version.py" ECHO release = '%OpenRails_Revision%' || GOTO :error
136140
PUSHD "Source\Documentation\Manual" && CALL make.bat clean & POPD || GOTO :error
@@ -139,13 +143,13 @@ IF NOT "%Mode%" == "Unstable" (
139143
REM Copy the documentation.
140144
FOR %%F IN ("Source\Documentation\*.pdf") DO CALL :copy "%%~F" "Program\Documentation\%%~nF.pdf" || GOTO :error
141145
CALL :copy "Source\Documentation\Manual\_build\latex\Manual.pdf" "Program\Documentation\Manual.pdf" || GOTO :error
142-
CALL :create "Program\Documentation\es"
143146
CALL :copy "Source\Documentation\Manual\es\Manual.pdf" "Program\Documentation\es\Manual.pdf" || GOTO :error
144147
ROBOCOPY /MIR /NJH /NJS "Source\Documentation\SampleFiles" "Program\Documentation\SampleFiles"
145148
IF %ERRORLEVEL% GEQ 8 GOTO :error
146149

147150
REM Copy the documentation separately.
148151
FOR %%F IN ("Program\Documentation\*.pdf") DO CALL :copy "%%~F" "OpenRails-%Mode%-%%~nxF" || GOTO :error
152+
FOR %%F IN ("Program\Documentation\Online\*.pdf") DO CALL :copy "%%~F" "OpenRails-%Mode%-%%~nxF" || GOTO :error
149153
)
150154

151155
IF "%Mode%" == "Stable" (
@@ -161,8 +165,7 @@ IF "%Mode%" == "Stable" (
161165
)
162166

163167
REM Create binary and source zips.
164-
CALL :delete "OpenRails-%Mode%*.zip" || GOTO :error
165-
PUSHD "Program" && 7za.exe a -r -tzip -x^^!*.xml "..\OpenRails-%Mode%.zip" . && POPD || GOTO :error
168+
PUSHD "Program" && 7za.exe a -r -tzip -x^^!*.xml -x^^!Online "..\OpenRails-%Mode%.zip" . && POPD || GOTO :error
166169
7za.exe a -r -tzip -x^^!.* -x^^!obj -x^^!lib -x^^!_build -x^^!*.bak "OpenRails-%Mode%-Source.zip" "Source" || GOTO :error
167170

168171
ENDLOCAL

Source/Documentation/Manual/appendices.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,19 @@ The value speed is the required speed value in dimension as set by the relevant
678678
Inclusion of speed definition is optional and need not be set if only approach control position functions
679679
are used.
680680

681+
Signal light parameters
682+
-----------------------
683+
684+
.. index::
685+
single: ORTSSignalLightTex
686+
687+
It is possible to have different light textures in the same signal, by inserting
688+
the following parameter in the signal light definition::
689+
690+
ORTSSignalLightTex ( "name" )
691+
692+
Where **name** is the name of the texture to be used for the signal light.
693+
681694
Signal aspect parameters
682695
------------------------
683696
The following parameters can be included in signal aspect definitions.

Source/Documentation/Manual/cabs.rst

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,25 @@ The following DMI size variants are available: FullSize (displays the whole DMI)
6161
The information displayed in the DMI is controlled via the TCS script. For more details,
6262
see :ref:`C# engine scripting - Train Control System <features-scripting-tcs>`.
6363

64-
.. _cabs-battery-switch:
64+
.. _cabs-battery:
6565

66-
Battery switch
67-
--------------
66+
Battery
67+
-------
6868

6969
.. index::
7070
single: ORTS_BATTERY_SWITCH_COMMAND_SWITCH
7171
single: ORTS_BATTERY_SWITCH_COMMAND_BUTTON_CLOSE
7272
single: ORTS_BATTERY_SWITCH_ON
73+
single: ORTS_BATTERY_VOLTAGE
7374

74-
The :ref:`battery switch <physics-battery-switch>` controls the low voltage power supply of the locomotive.
75+
The :ref:`battery subsystem <physics-battery>` controls the low voltage power supply of the locomotive.
7576

7677
The following controls are available for the cabview:
7778

78-
- ``ORTS_BATTERY_SWITCH_COMMAND_SWITCH`` can be used if the switch is directly controlled from the cab
79+
- ``ORTS_BATTERY_SWITCH_COMMAND_SWITCH`` can be used if the battery switch is directly controlled from the cab
7980
- ``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)
8081
- ``ORTS_BATTERY_SWITCH_ON`` can be used to control a light on the cab showing the state of the battery switch
82+
- ``ORTS_BATTERY_VOLTAGE`` monitors the battery voltage
8183

8284
Other controls can be disabled if the low voltage power supply is not available using the following parameter::
8385

@@ -166,6 +168,44 @@ The following controls are available for the cabview:
166168
- ``ORTS_ELECTRIC_TRAIN_SUPPLY_COMMAND_SWITCH`` can be used to control the electric train supply switch
167169
- ``ORTS_ELECTRIC_TRAIN_SUPPLY_ON`` can be used to indicate that the electric train supply line is powered on
168170

171+
.. _cabs-voltmeters:
172+
173+
Voltmeters
174+
----------
175+
176+
.. index::
177+
single: LINE_VOLTAGE
178+
single: ORTS_PANTOGRAPH_VOLTAGE_AC
179+
single: ORTS_PANTOGRAPH_VOLTAGE_DC
180+
single: ORTS_BATTERY_VOLTAGE
181+
182+
The following voltmeters are available for the cabview:
183+
184+
- ``LINE_VOLTAGE`` indicates the line voltage
185+
- ``ORTS_PANTOGRAPH_VOLTAGE_AC`` indicates the line voltage when operating on AC lines
186+
- ``ORTS_PANTOGRAPH_VOLTAGE_DC`` indicates the line voltage when operating on DC lines
187+
- ``ORTS_BATTERY_VOLTAGE`` indicates the vehicle's battery voltage
188+
189+
.. _cabs-electricselectors:
190+
191+
.. index::
192+
single: ORTS_PANTOGRAPH_SELECTOR
193+
single: ORTS_POWER_LIMITATION_SELECTOR
194+
single: ORTS_VOLTAGE_SELECTOR
195+
196+
There :ref:`pantograph selector <physics-pantograph-selector>`,
197+
:ref:`voltage selector <physics-voltage-selector>` and
198+
:ref:`power limitation selector <physics-power-limitation-selector>` can be used
199+
to switch the traction system for locomotives operating at different voltages.
200+
201+
They can be included in the cabview as follows:
202+
203+
- ``ORTS_PANTOGRAPH_SELECTOR`` allows selecting pre-defined pantograph arrangements
204+
(requires a custom script).
205+
- ``ORTS_VOLTAGE_SELECTOR`` configures the power supply for the voltage of the line
206+
(requires a custom script to raise the right pantograph).
207+
- ``ORTS_POWER_LIMITATION_SELECTOR`` limits the maximum power that the locomotive can draw.
208+
169209
.. _cabs-dieselenginesonoff:
170210

171211
Controls to switch on and off diesel engines

Source/Documentation/Manual/features-rollingstock.rst

Lines changed: 93 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,11 @@ block!
149149
.. index::
150150
single: Conditions(ORTSBattery
151151

152-
Battery Switch
153-
''''''''''''''
152+
Battery
153+
'''''''
154154

155155
The light condition ``ORTSBattery`` allows a light to respond to the state of
156-
the :ref:`battery switch subsystem <physics-battery-switch>`. The valid settings
156+
the :ref:`battery subsystem <physics-battery>`. The valid settings
157157
and associated conditions for the light to turn *on* are as follows:
158158

159159
- ``ORTSBattery ( 0 )`` Battery state is ignored (default)
@@ -2012,6 +2012,9 @@ Scripts will run if referenced by OR-specific fields in the .eng file.
20122012
single: ORTSEngineBrakeController
20132013
single: ORTSCircuitBreaker
20142014
single: ORTSTractionCutOffRelay
2015+
single: ORTSPantographSelector
2016+
single: ORTSVoltageSelector
2017+
single: ORTSPowerLimitationSelector
20152018
single: ORTSPowerSupply
20162019
single: ORTSTrainControlSystem
20172020

@@ -2043,6 +2046,15 @@ Scripts will run if referenced by OR-specific fields in the .eng file.
20432046
* - Passenger car power supply
20442047
- ``ORTS.Scripting.Api.PassengerCarPowerSupply``
20452048
- ``Wagon ( ORTSPowerSupply ( "DemoPower.cs" ) )``
2049+
* - Pantograph selector
2050+
- ``ORTS.Scripting.Api.PantographSelector``
2051+
- ``Engine ( ORTSPantographSelector ( Script ( "DemoPantographSelector.cs" ) ) )``
2052+
* - Voltage selector
2053+
- ``ORTS.Scripting.Api.VoltageSelector``
2054+
- ``Engine ( ORTSVoltageSelector ( Script ( "DemoVoltageSelector.cs" ) ) )``
2055+
* - Power limitation selector
2056+
- ``ORTS.Scripting.Api.PowerLimitationSelector``
2057+
- ``Engine ( ORTSPantographSelector ( Script ( "DemoPowerLimitator.cs" ) ) )``
20462058
* - Train Control System
20472059
- ``ORTS.Scripting.Api.TrainControlSystem``
20482060
- ``Engine ( ORTSTrainControlSystem ( "DemoTCS.cs" ) )``
@@ -2225,14 +2237,66 @@ Use the following .eng parameter to load a traction cut-off relay script::
22252237
)
22262238

22272239
``ORTSTractionCutOffRelay`` refers to the traction cut-off relay script in the engine's ``Script``
2228-
subfolder. For this field, the .cs extension is optional. "Automatic" and "Manual" load the generic OR
2229-
traction cut-off relay implementation, so do `not` use these names for your own script.
2240+
subfolder. For this field, the .cs extension is optional. Alternatively, there are several
2241+
built-in OR traction cut-off relay implementations:
2242+
2243+
- "Automatic": no driver intervention required, circuit breaker is closed when conditions are met.
2244+
- "Manual": a traction cut-off switch with open and closed positions.
2245+
- "PushButtons": a traction cut-off relay with dedicated open and close buttons.
2246+
2247+
Please do `not` use these names for your own script, since the generic implementation will
2248+
be loaded instead.
22302249

22312250
``ORTSTractionCutOffRelayClosingDelay`` refers to the delay between the closing command of the traction cut-off relay
22322251
and the effective closing of the relay.
22332252

2253+
.. _features-scripting-powerselectors
2254+
2255+
Pantograph, voltage and power limitation selectors
2256+
--------------------------------------------------
2257+
2258+
Available for electric locomotives only. The scripts control
2259+
the behavior of the locomotive's
2260+
:ref:`pantograph selector <physics-pantograph-selector>`,
2261+
:ref:`voltage selector <physics-voltage-selector>` and
2262+
:ref:`power limitation selector <physics-power-limitation-selector>` respectively.
2263+
2264+
.. index::
2265+
single: ORTSPantographSelector
2266+
single: ORTSVoltageSelector
2267+
single: ORTSPowerLimitationSelector
2268+
2269+
Use the following .eng parameters to load power selector scripts::
2270+
2271+
Engine (
2272+
ORTSPantographSelector (
2273+
Script ( "YourPSScript.cs" )
2274+
SelectorPositions ( ... )
2275+
)
2276+
ORTSVoltageSelector (
2277+
Script ( "YourVSScript.cs" )
2278+
SelectorPositions ( ... )
2279+
)
2280+
ORTSPowerLimitationSelector (
2281+
Script ( "YourPLSScript.cs" )
2282+
SelectorPositions ( ... )
2283+
)
2284+
)
2285+
2286+
``Script`` refers to the circuit breaker script in the engine's ``Script``
2287+
subfolder. For this field, the .cs extension is optional. Alternatively, there are several
2288+
built-in OR selector implementations which can be used if custom features such as interlocking
2289+
with other devices are not required:
2290+
2291+
- "Default": a selector with sequential positions.
2292+
- "Circular": same as above, but the first position follows again after the last one.
2293+
2294+
Please do `not` use these names for your own script, since the generic implementation will
2295+
be loaded instead.
2296+
22342297
.. _features-scripting-powersupply:
22352298

2299+
22362300
Diesel and electric power supply
22372301
--------------------------------
22382302

@@ -2252,6 +2316,7 @@ Use the following .eng parameter to load a power supply script::
22522316

22532317
Engine (
22542318
ORTSPowerSupply ( "YourEPS.cs" )
2319+
ORTSPowerSupplyParameters ( "YourEPS.ini" )
22552320
ORTSPowerOnDelay ( 5s )
22562321
ORTSAuxPowerOnDelay ( 10s )
22572322
)
@@ -2260,6 +2325,12 @@ Use the following .eng parameter to load a power supply script::
22602325
subfolder. For this field, the .cs extension is optional. "Default" will load the generic OR power supply
22612326
implementation, so do `not` use this name for your own script.
22622327

2328+
``ORTSPowerSupplyParameters``, an optional field, refers to an .ini file,
2329+
also in the ``Script`` subfolder, whose parameters will be made available to the
2330+
power supply script through the ``GetBoolParameter()``, ``GetIntParameter()``,
2331+
``GetFloatParameter()``, and ``GetStringParameter()`` methods. This .ini file provides for easy customization of
2332+
the behavior of the power supply script by end users.
2333+
22632334
``ORTSPowerOnDelay`` refers to the delay between the closing of the circuit breaker or the traction cut-off relay
22642335
and the availability of the power for traction.
22652336

@@ -2641,6 +2712,23 @@ which may be used this way within the script:
26412712
26422713
so that, instead of ORTS_TCSnn the related mnemonic string is displayed.
26432714

2715+
Generic cabview controls are also available for the Power Supply subsystem. They are named ORTS_POWER_SUPPLY1, ORTS_POWER_SUPPLY2
2716+
and so on in the cabview file. Their usage is the same as for the TCS controls.
2717+
2718+
Events related to power supply controls are made available to power supply scripts via ``TCSEvent.GenericTCSButtonPressed``,
2719+
``TCSEvent.GenericTCSButtonReleased``, ``TCSEvent.GenericTCSSwitchOff`` and ``TCSEvent.GenericTCSSwitchOn`` events,
2720+
received asynchronously by script through the method:
2721+
2722+
.. code-block:: csharp
2723+
2724+
public override void HandleEvent(PowerSupplyEvent evt, string message)
2725+
2726+
As for the TCS buttons, message is a string representing the control number with zero-base indexing
2727+
(e.g. "5" corresponds to ORTS_POWER_SUPPLY6).
2728+
2729+
SetCabDisplayControl and SetCustomizedCabviewControlName methods, which work in the same
2730+
way as their TCS counterparts, are accessible from all power supply scripts.
2731+
26442732
Helper classes
26452733
--------------
26462734
3 helper classes are available in the ``Orts.Scripting.Api`` namespace:
515 KB
Loading

Source/Documentation/Manual/multiplayer.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,27 @@ Additional info on using the Public Server
312312
time frame, it will re-enter the game in the position where he was at the
313313
moment of the crash.
314314

315+
.. _standalone-multiplayer-server:
316+
317+
Standalone multiplayer server
318+
=============================
319+
320+
If preferred, a standalone multiplayer server may be run on a local computer. It must be
321+
started before the players enter the game.
322+
To start it, click on the *Tools* button in the main menu window, and then select
323+
*MultiPlayer Server*. A window as shown below will appear.
324+
325+
.. image:: images/multiplayerserver.png
326+
:align: center
327+
:scale: 160%
328+
329+
First only the three first lines will be shown. As soon as the first player enters the game
330+
(he must select the URL and the port of the standalone multiplayer server; furthermore he must select
331+
the *Client* button, enter a User Name and click on *Start MP*) , he becomes appointed as the dispatcher,
332+
and the standalone multiplayer server starts displaying all messages sent and received.
333+
At this point all other players can enter the game.
334+
335+
315336
Save and resume
316337
===============
317338

0 commit comments

Comments
 (0)