Skip to content

Commit 8c7b4a7

Browse files
committed
Merge branch 'master' into gltf2
2 parents 3530778 + ade0195 commit 8c7b4a7

File tree

178 files changed

+18995
-9182
lines changed

Some content is hidden

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

178 files changed

+18995
-9182
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,4 +366,4 @@ healthchecksdb
366366

367367
# Backup folder for Package Reference Convert tool in Visual Studio 2017
368368
MigrationBackup/
369-
/Source/RunActivity/Properties/launchSettings.json
369+
/Source/**/Properties/launchSettings.json

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/Contrib/DataCollector/Program.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Program
2929
static void Main(string[] args)
3030
{
3131
if (args.Contains("/system", StringComparer.OrdinalIgnoreCase))
32-
SystemInfo.WriteSystemDetails(Console.Out);
32+
CollectSystem();
3333
else if (args.Contains("/tile-terrtex", StringComparer.OrdinalIgnoreCase))
3434
CollectTileTerrtex(args);
3535
else
@@ -53,6 +53,12 @@ static void ShowHelp()
5353
Console.WriteLine(" /help Show help and usage information");
5454
}
5555

56+
static void CollectSystem()
57+
{
58+
Console.Error.WriteLine("Collecting information...");
59+
SystemInfo.WriteSystemDetails(Console.Out);
60+
}
61+
5662
struct TileTerrtexDirectory
5763
{
5864
public string Path;

Source/Contrib/SimulatorTester/UserSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// along with Open Rails. If not, see <http://www.gnu.org/licenses/>.
1717

1818
using System.Collections.Generic;
19-
using ORTS.Settings;
19+
using ORTS.Common;
2020

2121
namespace SimulatorTester
2222
{

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: 46 additions & 6 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
@@ -908,7 +948,7 @@ Linked two-state animations (doors type) are named ``<ORTSITEM1TWOSTATE>`` and
908948
The default animation speed for stopped/moving type animations is 8 FPS.
909949
It may be modified with following parameter in the .sd file::
910950

911-
ESD_CustomAnimationSpeed ( 8 )
951+
ESD_ORTSCustomAnimationFPS ( 8 )
912952

913953
Examples of use are fan control, open/close of aerodynamic coverages of couplers
914954
in high speed trains, menu pages switching.

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)
@@ -1921,6 +1921,9 @@ Scripts will run if referenced by OR-specific fields in the .eng file.
19211921
single: ORTSEngineBrakeController
19221922
single: ORTSCircuitBreaker
19231923
single: ORTSTractionCutOffRelay
1924+
single: ORTSPantographSelector
1925+
single: ORTSVoltageSelector
1926+
single: ORTSPowerLimitationSelector
19241927
single: ORTSPowerSupply
19251928
single: ORTSTrainControlSystem
19261929

@@ -1952,6 +1955,15 @@ Scripts will run if referenced by OR-specific fields in the .eng file.
19521955
* - Passenger car power supply
19531956
- ``ORTS.Scripting.Api.PassengerCarPowerSupply``
19541957
- ``Wagon ( ORTSPowerSupply ( "DemoPower.cs" ) )``
1958+
* - Pantograph selector
1959+
- ``ORTS.Scripting.Api.PantographSelector``
1960+
- ``Engine ( ORTSPantographSelector ( Script ( "DemoPantographSelector.cs" ) ) )``
1961+
* - Voltage selector
1962+
- ``ORTS.Scripting.Api.VoltageSelector``
1963+
- ``Engine ( ORTSVoltageSelector ( Script ( "DemoVoltageSelector.cs" ) ) )``
1964+
* - Power limitation selector
1965+
- ``ORTS.Scripting.Api.PowerLimitationSelector``
1966+
- ``Engine ( ORTSPantographSelector ( Script ( "DemoPowerLimitator.cs" ) ) )``
19551967
* - Train Control System
19561968
- ``ORTS.Scripting.Api.TrainControlSystem``
19571969
- ``Engine ( ORTSTrainControlSystem ( "DemoTCS.cs" ) )``
@@ -2134,14 +2146,66 @@ Use the following .eng parameter to load a traction cut-off relay script::
21342146
)
21352147

21362148
``ORTSTractionCutOffRelay`` refers to the traction cut-off relay script in the engine's ``Script``
2137-
subfolder. For this field, the .cs extension is optional. "Automatic" and "Manual" load the generic OR
2138-
traction cut-off relay implementation, so do `not` use these names for your own script.
2149+
subfolder. For this field, the .cs extension is optional. Alternatively, there are several
2150+
built-in OR traction cut-off relay implementations:
2151+
2152+
- "Automatic": no driver intervention required, circuit breaker is closed when conditions are met.
2153+
- "Manual": a traction cut-off switch with open and closed positions.
2154+
- "PushButtons": a traction cut-off relay with dedicated open and close buttons.
2155+
2156+
Please do `not` use these names for your own script, since the generic implementation will
2157+
be loaded instead.
21392158

21402159
``ORTSTractionCutOffRelayClosingDelay`` refers to the delay between the closing command of the traction cut-off relay
21412160
and the effective closing of the relay.
21422161

2162+
.. _features-scripting-powerselectors
2163+
2164+
Pantograph, voltage and power limitation selectors
2165+
--------------------------------------------------
2166+
2167+
Available for electric locomotives only. The scripts control
2168+
the behavior of the locomotive's
2169+
:ref:`pantograph selector <physics-pantograph-selector>`,
2170+
:ref:`voltage selector <physics-voltage-selector>` and
2171+
:ref:`power limitation selector <physics-power-limitation-selector>` respectively.
2172+
2173+
.. index::
2174+
single: ORTSPantographSelector
2175+
single: ORTSVoltageSelector
2176+
single: ORTSPowerLimitationSelector
2177+
2178+
Use the following .eng parameters to load power selector scripts::
2179+
2180+
Engine (
2181+
ORTSPantographSelector (
2182+
Script ( "YourPSScript.cs" )
2183+
SelectorPositions ( ... )
2184+
)
2185+
ORTSVoltageSelector (
2186+
Script ( "YourVSScript.cs" )
2187+
SelectorPositions ( ... )
2188+
)
2189+
ORTSPowerLimitationSelector (
2190+
Script ( "YourPLSScript.cs" )
2191+
SelectorPositions ( ... )
2192+
)
2193+
)
2194+
2195+
``Script`` refers to the circuit breaker script in the engine's ``Script``
2196+
subfolder. For this field, the .cs extension is optional. Alternatively, there are several
2197+
built-in OR selector implementations which can be used if custom features such as interlocking
2198+
with other devices are not required:
2199+
2200+
- "Default": a selector with sequential positions.
2201+
- "Circular": same as above, but the first position follows again after the last one.
2202+
2203+
Please do `not` use these names for your own script, since the generic implementation will
2204+
be loaded instead.
2205+
21432206
.. _features-scripting-powersupply:
21442207

2208+
21452209
Diesel and electric power supply
21462210
--------------------------------
21472211

@@ -2161,6 +2225,7 @@ Use the following .eng parameter to load a power supply script::
21612225

21622226
Engine (
21632227
ORTSPowerSupply ( "YourEPS.cs" )
2228+
ORTSPowerSupplyParameters ( "YourEPS.ini" )
21642229
ORTSPowerOnDelay ( 5s )
21652230
ORTSAuxPowerOnDelay ( 10s )
21662231
)
@@ -2169,6 +2234,12 @@ Use the following .eng parameter to load a power supply script::
21692234
subfolder. For this field, the .cs extension is optional. "Default" will load the generic OR power supply
21702235
implementation, so do `not` use this name for your own script.
21712236

2237+
``ORTSPowerSupplyParameters``, an optional field, refers to an .ini file,
2238+
also in the ``Script`` subfolder, whose parameters will be made available to the
2239+
power supply script through the ``GetBoolParameter()``, ``GetIntParameter()``,
2240+
``GetFloatParameter()``, and ``GetStringParameter()`` methods. This .ini file provides for easy customization of
2241+
the behavior of the power supply script by end users.
2242+
21722243
``ORTSPowerOnDelay`` refers to the delay between the closing of the circuit breaker or the traction cut-off relay
21732244
and the availability of the power for traction.
21742245

@@ -2550,6 +2621,23 @@ which may be used this way within the script:
25502621
25512622
so that, instead of ORTS_TCSnn the related mnemonic string is displayed.
25522623

2624+
Generic cabview controls are also available for the Power Supply subsystem. They are named ORTS_POWER_SUPPLY1, ORTS_POWER_SUPPLY2
2625+
and so on in the cabview file. Their usage is the same as for the TCS controls.
2626+
2627+
Events related to power supply controls are made available to power supply scripts via ``TCSEvent.GenericTCSButtonPressed``,
2628+
``TCSEvent.GenericTCSButtonReleased``, ``TCSEvent.GenericTCSSwitchOff`` and ``TCSEvent.GenericTCSSwitchOn`` events,
2629+
received asynchronously by script through the method:
2630+
2631+
.. code-block:: csharp
2632+
2633+
public override void HandleEvent(PowerSupplyEvent evt, string message)
2634+
2635+
As for the TCS buttons, message is a string representing the control number with zero-base indexing
2636+
(e.g. "5" corresponds to ORTS_POWER_SUPPLY6).
2637+
2638+
SetCabDisplayControl and SetCustomizedCabviewControlName methods, which work in the same
2639+
way as their TCS counterparts, are accessible from all power supply scripts.
2640+
25532641
Helper classes
25542642
--------------
25552643
3 helper classes are available in the ``Orts.Scripting.Api`` namespace:
Loading
Loading
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)