Skip to content

Commit 081a947

Browse files
authored
Merge branch 'openrails:master' into multi_track_profiles
2 parents 5a6ec12 + e2338fd commit 081a947

File tree

71 files changed

+3652
-1503
lines changed

Some content is hidden

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

71 files changed

+3652
-1503
lines changed

Source/ContentChecker/ContentChecker.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
<TargetFramework Condition="'$(BuildDotNet)' == 'true'">net6-windows</TargetFramework>
44
<TargetFramework Condition="'$(TargetFramework)' == ''">net472</TargetFramework>
55
<OutputType>Exe</OutputType>
6-
<UseWindowsForms>true</UseWindowsForms>
7-
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
86
<IsPublishable>False</IsPublishable>
97
<AssemblyTitle>Open Rails Content Checker</AssemblyTitle>
108
<Description>Open Rails Transport Simulator</Description>

Source/ContentChecker/Loader.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
using System.Linq;
4444
using System.Text;
4545
using Microsoft.Xna.Framework.Graphics;
46-
using System.Windows.Forms;
4746

4847
namespace ContentChecker
4948
{
@@ -70,7 +69,7 @@ abstract class Loader
7069
/// <summary> The number of files that were actually loaded </summary>
7170
public int FilesLoaded { get; protected set; }
7271
/// <summary> The number of files that were not loaded but skipped </summary>
73-
public int FilesSkipped {get; protected set;}
72+
public int FilesSkipped { get; protected set; }
7473

7574
/// <summary> The action to take when an additonal file has been identified. This is intended to be set externally </summary>
7675
protected Action<string, Loader> AddAdditionalFileAction { get; set; }
@@ -158,17 +157,13 @@ protected static GraphicsDevice GetGraphicsDevice()
158157
{
159158
if (_graphicsDevice == null)
160159
{
161-
// We use a Windows.Forms Control instead of an xna GAME because it is much easier to use.
162-
var _c = new Control();
163-
164160
// Details probably do not matter too much
165161
PresentationParameters parameters = new PresentationParameters()
166162
{
167163
BackBufferWidth = 100,
168164
BackBufferHeight = 100,
169165
BackBufferFormat = SurfaceFormat.Color,
170166
//DepthStencilFormat = DepthFormat.Depth24,
171-
DeviceWindowHandle = _c.Handle,
172167
PresentationInterval = PresentInterval.Immediate,
173168
IsFullScreen = false,
174169
};

Source/ContentChecker/Program.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,10 @@ static bool OptionsContain(string[] args, IEnumerable<string> optionNames) {
7777
/// </summary>
7878
static void ShowHelp()
7979
{
80-
var version = FileVersionInfo.GetVersionInfo(typeof(Program).Assembly.Location);
81-
Console.WriteLine("{0} {1}", version.FileDescription, VersionInfo.VersionOrBuild);
80+
Console.WriteLine("{0} {1}", ApplicationInfo.ApplicationName, VersionInfo.VersionOrBuild);
8281
Console.WriteLine();
8382
Console.WriteLine("Usage:");
84-
Console.WriteLine(" {0} [options] <FILE> [...]", Path.GetFileNameWithoutExtension(version.FileName));
83+
Console.WriteLine(" {0} [options] <FILE> [...]", Path.GetFileNameWithoutExtension(ApplicationInfo.ProcessFile));
8584
Console.WriteLine();
8685
Console.WriteLine("Arguments:");
8786
Console.WriteLine(" <FILE> Data files to check; may contain wildcards");

Source/Contrib/DataCollector/Program.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
using ORTS.Common;
2020
using System;
2121
using System.Collections.Generic;
22-
using System.Diagnostics;
2322
using System.IO;
2423
using System.Linq;
2524

@@ -39,11 +38,10 @@ static void Main(string[] args)
3938

4039
static void ShowHelp()
4140
{
42-
var version = FileVersionInfo.GetVersionInfo(typeof(Program).Assembly.Location);
43-
Console.WriteLine("{0} {1}", version.FileDescription, VersionInfo.VersionOrBuild);
41+
Console.WriteLine("{0} {1}", ApplicationInfo.ApplicationName, VersionInfo.VersionOrBuild);
4442
Console.WriteLine();
4543
Console.WriteLine("Usage:");
46-
Console.WriteLine(" {0} [options] [<PATH> [...]]", Path.GetFileNameWithoutExtension(version.FileName));
44+
Console.WriteLine(" {0} [options] [<PATH> [...]]", Path.GetFileNameWithoutExtension(ApplicationInfo.ProcessFile));
4745
Console.WriteLine();
4846
Console.WriteLine("Arguments:");
4947
Console.WriteLine(" <PATH> Directories to scan for specific options");

Source/Contrib/DataConverter/Program.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
using System;
1919
using System.Collections.Generic;
20-
using System.Diagnostics;
2120
using System.IO;
2221
using System.Linq;
2322
using System.Runtime.Serialization;
@@ -87,11 +86,10 @@ static void Main(string[] args)
8786

8887
static void ShowHelp(List<IDataConverter> converters)
8988
{
90-
var version = FileVersionInfo.GetVersionInfo(typeof(Program).Assembly.Location);
91-
Console.WriteLine("{0} {1}", version.FileDescription, VersionInfo.VersionOrBuild);
89+
Console.WriteLine("{0} {1}", ApplicationInfo.ApplicationName, VersionInfo.VersionOrBuild);
9290
Console.WriteLine();
9391
Console.WriteLine("Usage:");
94-
Console.WriteLine(" {0} /input <INPUT> [/output] [<OUTPUT> [...]]", Path.GetFileNameWithoutExtension(version.FileName));
92+
Console.WriteLine(" {0} /input <INPUT> [/output] [<OUTPUT> [...]]", Path.GetFileNameWithoutExtension(ApplicationInfo.ProcessFile));
9593
Console.WriteLine();
9694
Console.WriteLine("Arguments:");
9795
Console.WriteLine(" <INPUT> Specifies the file to read");

Source/Contrib/DataValidator/Program.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,10 @@ static void Main(string[] args)
3939

4040
static void ShowHelp()
4141
{
42-
var version = FileVersionInfo.GetVersionInfo(typeof(Program).Assembly.Location);
43-
Console.WriteLine("{0} {1}", version.FileDescription, VersionInfo.VersionOrBuild);
42+
Console.WriteLine("{0} {1}", ApplicationInfo.ApplicationName, VersionInfo.VersionOrBuild);
4443
Console.WriteLine();
4544
Console.WriteLine("Usage:");
46-
Console.WriteLine(" {0} [options] <FILE> [...]", Path.GetFileNameWithoutExtension(version.FileName));
45+
Console.WriteLine(" {0} [options] <FILE> [...]", Path.GetFileNameWithoutExtension(ApplicationInfo.ProcessFile));
4746
Console.WriteLine();
4847
Console.WriteLine("Arguments:");
4948
Console.WriteLine(" <FILE> Data files to validate; may contain wildcards");

Source/Contrib/SimulatorTester/Program.cs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
using Orts.Simulation;
2222
using ORTS.Common;
2323
using System.IO;
24-
using System.Windows.Forms;
2524
using Orts.Common;
26-
using System.Diagnostics;
2725

2826
namespace SimulatorTester
2927
{
@@ -37,23 +35,22 @@ static void Main(string[] args)
3735

3836
if (files.Count != 1 || options.Contains("help", StringComparer.InvariantCultureIgnoreCase))
3937
{
40-
var version = FileVersionInfo.GetVersionInfo(Application.ExecutablePath);
41-
Console.WriteLine("{0} {1}", version.FileDescription, VersionInfo.VersionOrBuild);
38+
Console.WriteLine("{0} {1}", ApplicationInfo.ApplicationName, VersionInfo.VersionOrBuild);
4239
Console.WriteLine();
4340
Console.WriteLine("Usage:");
44-
Console.WriteLine(" {0} [options] <SAVE_FILE>", Path.GetFileNameWithoutExtension(Application.ExecutablePath));
41+
Console.WriteLine(" {0} [options] <SAVE_FILE>", Path.GetFileNameWithoutExtension(ApplicationInfo.ProcessFile));
4542
Console.WriteLine();
4643
Console.WriteLine("Arguments:");
47-
Console.WriteLine(" <SAVE_FILE> {0} save file to use", Application.ProductName);
44+
Console.WriteLine(" <SAVE_FILE> {0} save file to use", ApplicationInfo.ProductName);
4845
Console.WriteLine();
4946
Console.WriteLine("Options:");
5047
Console.WriteLine(" /quiet Do not show summary of simulation (only exit code is set)");
51-
Console.WriteLine(" /verbose Show version and settings (similar to a {0} log)", Application.ProductName);
48+
Console.WriteLine(" /verbose Show version and settings (similar to a {0} log)", ApplicationInfo.ProductName);
5249
Console.WriteLine(" /fps <FPS> Set the simulation frame-rate [default: 10]");
5350
Console.WriteLine(" /help Show help and usage information");
54-
Console.WriteLine(" ...and any standard {0} option", Application.ProductName);
51+
Console.WriteLine(" ...and any standard {0} option", ApplicationInfo.ProductName);
5552
Console.WriteLine();
56-
Console.WriteLine("The {0} takes a save file and:", version.FileDescription);
53+
Console.WriteLine("The {0} takes a save file and:", ApplicationInfo.ApplicationName);
5754
Console.WriteLine(" - Loads the same activity as contained in the save file");
5855
Console.WriteLine(" - Runs the simulation at the specified FPS for the same duration as the save file");
5956
Console.WriteLine(" - Compares the final position with that contained in the save file");
@@ -65,15 +62,15 @@ static void Main(string[] args)
6562

6663
if (settings.Verbose)
6764
{
68-
Console.WriteLine("This is a log file for {0}. Please include this file in bug reports.", Application.ProductName);
65+
Console.WriteLine("This is a log file for {0}. Please include this file in bug reports.", ApplicationInfo.ProductName);
6966
LogSeparator();
7067

7168
SystemInfo.WriteSystemDetails(Console.Out);
7269
LogSeparator();
7370

7471
Console.WriteLine("Version = {0}", VersionInfo.Version.Length > 0 ? VersionInfo.Version : "<none>");
7572
Console.WriteLine("Build = {0}", VersionInfo.Build);
76-
Console.WriteLine("Executable = {0}", Path.GetFileName(Application.ExecutablePath));
73+
Console.WriteLine("Executable = {0}", Path.GetFileName(ApplicationInfo.ProcessFile));
7774
foreach (var arg in args)
7875
Console.WriteLine("Argument = {0}", arg);
7976
LogSeparator();

Source/Contrib/SimulatorTester/SimulatorTester.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
<RootNamespace>Orts.SimulatorTester</RootNamespace>
77
<AssemblyName>Contrib.SimulatorTester</AssemblyName>
88
<ApplicationIcon>..\..\ORTS.ico</ApplicationIcon>
9-
<UseWindowsForms>true</UseWindowsForms>
10-
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
11-
<OutputPath>..\..\..\Program\</OutputPath>
129
<IsPublishable>False</IsPublishable>
1310
<AssemblyTitle>Open Rails Simulator Tester (Contributed)</AssemblyTitle>
1411
<Description>Open Rails Transport Simulator</Description>

Source/Documentation/Manual/cruisecontrol.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ A list of the available .eng file CC parameters follows here below.
138138
"ModeSwitchAllowedWithThrottleNotAtZero", "Switch from manual to auto and vice-versa can occur also when throttle lever is not at 0", "Boolean", "FALSE"
139139
"DisableManualSwitchToAutoWhenSetSpeedNotAtTop", "Manual Switch to Cruise Control Auto Mode can't occur when speed is not set at maximum value and at the same moment train speed is not 0", "Boolean", "FALSE"
140140
"UseTrainBrakeAndDynBrake", "CC uses train brake and dyn brake together", "Boolean", "FALSE"
141+
"UseDynBrake", "CC uses dyn brake", "Boolean", "TRUE"
142+
"TrainBrakeCommandHasPriorityOverCruiseControl", "A manual train braking inhibits Cruise Control to use both dynamic braking and tractive force", "Boolean", "TRUE"
143+
"TrainBrakeCommandHasPriorityOverAcceleratingCruiseControl", "A manual train braking inhibits Cruise Control to use tractive force", "Boolean", "TRUE"
141144
"SpeedDeltaToEnableTrainBrake", "This is the minimum speed delta between actual speed and desired speed for the CC to use also the train brake", "Float(speed)", "5m/s"
142145
"SpeedDeltaToEnableFullTrainBrake", "This is the minimum speed delta between actual speed and desired speed for the CC to use also the train brake with no reduced intensity", "Float(speed)", "10m/s"
143146
"TrainBrakeMinPercentValue", "This is the minimum train brake percent used by the CC. 0 means no braking, 100 means full service braking", "Float(percent)", "30"

Source/Documentation/Manual/driving.rst

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,8 @@ Changing the Train Driven by the Player
14111411
General
14121412
-------
14131413

1414-
This function only works in activity mode, and allows the player to select
1414+
This function works in activity mode as well as in timetable mode,
1415+
and allows the player to select
14151416
another (existing) train from a list and to start driving it.
14161417

14171418
This function can be called more than once. A new information window has
@@ -1453,17 +1454,20 @@ completely appeared on the screen - if it is far away from the player train
14531454
this can require several seconds to load the *world* around the train) the
14541455
switch of control occurs.
14551456

1456-
The AI train string now becomes red and is moved to the first position.The
1457-
train can be driven, or set to autopilot mode. The former player train
1458-
becomes an AI train.
1457+
The AI train string now becomes red and is moved to the first position.
1458+
In timetable mode the new player train is automatically set to autopilot mode,
1459+
while this does not apply to activity mode. However in both timetable and
1460+
activity mode the player can switch forth and back to autopilot mode.
1461+
The former player train becomes an AI train.
14591462

14601463
Here is the final situation:
14611464

14621465
.. image:: images/driving-train-list-3.png
14631466
:align: center
14641467
:scale: 80%
14651468

1466-
If the second left-click was performed with the Shift key down, the former
1469+
In activity mode only, if the second left-click was performed with the Shift
1470+
key down, the former
14671471
player train still becomes an AI train, but it is put in a suspended mode
14681472
(only if its speed is 0). It won't move until it becomes a player train
14691473
again. A suspended train is shown in orange color on the Train List window.
@@ -1472,7 +1476,8 @@ The new player train can can be switched to manual mode, can also request to
14721476
pass signals at danger with the ``<Tab>`` command, and can be moved outside
14731477
of its original path. However before switching control to still another train,
14741478
the new player train must be returned to the original path or put in suspend
1475-
mode; or else it will disappear, as occurs for AI trains running outside their
1479+
mode (last is possible only in activity mode); or else it will disappear,
1480+
as occurs for AI trains running outside their
14761481
path.
14771482

14781483
The sequence may be restarted to switch to a new train or to switch back to
@@ -1482,15 +1487,9 @@ Train switching also works in activity mode together with multiplayer mode,
14821487
in the sense that the dispatcher player can switch its played train, and
14831488
the related information is sent to the client players.
14841489

1485-
The Train List window is also available in
1486-
:ref:`Timetable mode <start-timetable>`. In this case the
1487-
names of all trains except the player train are shown in white (they can't
1488-
be driven), however with a single click on a train in the window the
1489-
external view cameras become linked to that train, as occurs with the Alt-9
1490-
command described :ref:`further below <driving-changing-view>`.
14911490

1492-
Switching to a static train
1493-
---------------------------
1491+
Switching to a static train (only activity mode)
1492+
------------------------------------------------
14941493

14951494
In the Train List window the drivable static consists (that is the ones
14961495
that have at least an engine provided with a cab) are also listed (in

0 commit comments

Comments
 (0)