Skip to content

Commit d5294b7

Browse files
committed
Automatic merge of T1.6-rc2-41-gacd714487 and 8 pull requests
- Pull request #1104 at f15bb6b: Handle simple adhesion within the axle module - Pull request #1057 at 1c2bcb4: Switchable brake system - Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc) - Pull request #1091 at 2391bc0: Automatic speed control - Pull request #1110 at 387388e: Fix Activity Runner persists after loading exception - Pull request #1115 at 270f22f: Do not activate ETS switch if no suitable cars are attached - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1081 at 689494b: Brake cuts power unification
10 parents 372a5dc + acd7144 + f15bb6b + 1c2bcb4 + e10390b + 2391bc0 + 387388e + 270f22f + 5845a1a + 689494b commit d5294b7

File tree

9 files changed

+72
-111
lines changed

9 files changed

+72
-111
lines changed

Source/Installer/Installer.iss

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#define DotNETName "Microsoft .NET Framework 4.7.2"
2222

23-
#define MyAppURL "https://openrails.org"
23+
#define MyAppURL "http://openrails.org" ; Not yet HTTPS
2424
#define MyAppSourceURL "http://openrails.org/download/source/"
2525
#define MyAppSupportURL "https://launchpad.net/or"
2626

@@ -31,7 +31,7 @@
3131
#define MyAppDocPath "..\..\Program\Documentation"
3232

3333
#define NetRedistPath "..\..\.NET Framework 4.7.2 web installer"
34-
#define NetRedist "ndp472-kb4054531-web.exe" ; Has to be lower-case to match download
34+
#define NetRedist "NDP472-KB4054531-Web.exe"
3535

3636
[Setup]
3737
; NOTE: The value of AppId uniquely identifies this application.
@@ -50,26 +50,20 @@ DefaultDirName ={commonpf}\{#MyAppName}
5050
DefaultGroupName={#MyAppName}
5151
AllowNoIcons =yes
5252
LicenseFile ={#MyAppProgPath}\Copying.txt
53-
InfoBeforeFile ={#MyAppProgPath}\Prerequisites.txt
53+
InfoBeforeFile ={#MyAppProgPath}\Prerequisites.txt
5454
InfoAfterFile ={#MyAppProgPath}\Readme.txt
5555

56-
; Prompt for a destination folder
57-
DisableDirPage =no
58-
; 32-bit is the default, installing in "Program Files (x86)" on 64-bit Windows. "x64compatible" uses Program Files on 64-bit Windows
59-
ArchitecturesInstallIn64BitMode =x64compatible
60-
61-
; Default is admin install mode.
62-
; Comment in the following line to run in non-administrative install mode, but that cannot create the directory C:\Program Files\Open Rails
63-
; PrivilegesRequired=lowest
56+
; Remove the following line to run in administrative install mode (install for all users.)
57+
; PrivilegesRequired=lowest ; Cannot create the directory C:\Program Files\Open Rails
6458

6559
Compression =lzma
6660
SolidCompression=yes
67-
WizardStyle =modern
61+
WizardStyle=modern
6862
Uninstallable =yes
69-
UninstallDisplayIcon ={app}\{#MyAppExeName}
70-
OutputBaseFilename =OpenRailsSetup
63+
UninstallDisplayIcon={app}\{#MyAppExeName}
64+
OutputBaseFilename=OpenRailsSetup
7165

72-
; Windows 7 SP1 Correct value, so ignore final warning message from Build > Compile
66+
; Windows 7 SP1
7367
MinVersion =6.1sp1
7468

7569
[Languages]
@@ -85,7 +79,7 @@ Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl"
8579
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
8680
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
8781
Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl"
88-
;Name: "icelandic"; MessagesFile: "compiler:Languages\Icelandic.isl"
82+
Name: "icelandic"; MessagesFile: "compiler:Languages\Icelandic.isl"
8983
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
9084
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
9185
Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl"

Source/Installer/Using the installer scripts.txt

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
Using the installer scripts.txt
2-
Last updated: 2025-06-21 by Chris Jakeman
2+
Last updated: 2022-08-21 by Chris Jakeman
33

4-
Compiling the scripts and data files on your own PC and testing them there or on a virtual machine
5-
==================================================================================================
6-
7-
1. If you wish to update the version name from "1.6", then edit the line
8-
#define MyAppVersion "1.6"
4+
1. If you wish to update the version name from "1.5", then edit the line
5+
#define MyAppVersion "1.5"
96
in the file
107
Source\Installer\Version.iss
118
and update the Release number and date in:
129
Source\RunActivity\Readme.txt
1310
and in
1411
Source\RunActivity\Prerequisites.txt
1512

16-
The text in these documents is shown by the Installer to the user, so check this is still up to date.
17-
1813
2. Download and install Inno Setup from http://www.jrsoftware.org/isdl.php
19-
Initial trials (Apr 2014) used v5.5.4. Open Rails v1.6 uses 6.4.3
14+
Initial trials (Apr 2014) used v5.5.4. Open Rails v1.5 uses 6.1.2
2015

21-
3. Download Microsoft .NET Framework 4.7.2 web installer package for Windows from:
16+
3. Download Microsoft .NET Framework 4.7.2 web installer for Windows from:
2217
https://support.microsoft.com/en-us/topic/microsoft-net-framework-4-7-2-web-installer-for-windows-dda5cddc-b85e-545d-8d4a-d213349b7775
2318
and save in
2419
<A>\.NET Framework 4.7.2 web installer\ndp472-kb4054531-web.exe
@@ -28,31 +23,28 @@ Initial trials (Apr 2014) used v5.5.4. Open Rails v1.6 uses 6.4.3
2823
From Source\Installer, copy OpenRails.iss and Version.iss into <A>\Temp\Installer
2924

3025
5. Repeat the following as often as required:
31-
A. Download OR zip file from https://github.com/openrails/openrails/releases, choose the latest (i.e. pre-release) version, open the Assets concertina and pick Open Rails <version>.zip where <version> is something like "1.6-rc2"
26+
A. Download OR zip file from https://github.com/openrails/openrails/releases, choose the latest (i.e. pre-release) version, open the Assets concertina and pick OpenRails-Stable.zip
3227

3328
B. Unzip into folder
34-
<A>\Program\
29+
<A>\Open Rails\Program\
3530

3631
C. Remove
37-
<A>\Program\Updater.ini
32+
<A>\Open Rails\Program\Updater.ini
3833
as James Ross advises because the updater cannot update an installed version yet.
3934

40-
D. Download source from https://github.com/openrails/openrails/releases, choose the latest (i.e. pre-release) version, open the Assets concertina and pick Source code Open Rails <version> Source.zip where <version> is something like "1.6-rc2" and extract the folder Source\Documentation.
35+
D. Download source from https://github.com/openrails/openrails/releases, choose the latest (i.e. pre-release) version, open the Assets concertina and pick Source code (openrails-1.5-rc1.zip) and extract the folder Source\Documentation.
4136

4237
E. Copy contents into folder
43-
<A>\Program\Documentation\
44-
45-
F. If you made changes to Source\RunActivity\Readme.txt or Source\RunActivity\Prerequisites.txt in Step 1, then
46-
copy them to <A>\Program\ to overwrite the downloaded files.
38+
<A>\Open Rails\Program\Documentation\
4739

48-
G. Use Inno Setup Compiler > Build > Compile to compile the installer script
40+
F. Use Inno Setup > Build > Compile to compile the installer script
4941
<A>\Temp\Installer\Installer.iss
5042
and generate the Open Rails Installer
5143

52-
H. The generated file will be found in <A>\Temp\Installer\Output\OpenRailsSetup.exe
44+
G. The generated file will be found in <A>\Temp\Installer\Output\OpenRailsSetup.exe
5345

5446
6. Test the installer by building Virtual Machines with a fresh copy of Windows.
55-
Open Rails v1.6 is compatible with Windows from 7 (SP1) to 11 and, hopefully, beyond.
47+
Open Rails v1.5 is compatible with Windows from 7 (SP1) to 11 and, hopefully, beyond.
5648

5749
Arrange for the VM to have Internet access and a shared folder.
5850
Copy OpenRailsSetup.exe to the shared folder.

Source/Installer/Version.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#define MyAppVersion "1.6"
1+
#define MyAppVersion "none"

Source/Orts.Simulation/Simulation/Activity.cs

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -884,8 +884,6 @@ public override void NotifyEvent(ActivityEventType EventType)
884884
double sinceActArriveS = (new DateTime().Add(TimeSpan.FromSeconds(Simulator.ClockTime))
885885
- ActArrive).Value.TotalSeconds;
886886
BoardingEndS -= sinceActArriveS;
887-
888-
ldbfevaldepartbeforeboarding = false; // reset flag. Debrief Eval
889887
}
890888
else
891889
{
@@ -902,30 +900,29 @@ public override void NotifyEvent(ActivityEventType EventType)
902900
if (BoardingS > 0 || ((double)(SchDepart - SchArrive).TotalSeconds > 0 &&
903901
MyPlayerTrain.PassengerCarsNumber == 1 && MyPlayerTrain.Cars.Count > 10 ))
904902
{
905-
// accepted station stop because either freight train or passenger train or fake passenger train with passenger car on platform or fake passenger train
903+
// accepted station stop because either freight train or passenger train or fake passenger train with passenger car on platform or fake passenger train
906904
// with Scheduled Depart > Scheduled Arrive
907-
// ActArrive is usually same as ClockTime
908-
BoardingEndS = Simulator.ClockTime + BoardingS;
905+
// ActArrive is usually same as ClockTime
906+
BoardingEndS = Simulator.ClockTime + BoardingS;
909907

910-
if (ActArrive == null)
911-
{
912-
ActArrive = new DateTime().Add(TimeSpan.FromSeconds(Simulator.ClockTime));
913-
}
908+
if (ActArrive == null)
909+
{
910+
ActArrive = new DateTime().Add(TimeSpan.FromSeconds(Simulator.ClockTime));
911+
}
914912

915-
arrived = true;
916-
// But not if game starts after scheduled arrival. In which case actual arrival is assumed to be same as schedule arrival.
917-
double sinceActArriveS = (new DateTime().Add(TimeSpan.FromSeconds(Simulator.ClockTime))
918-
- ActArrive).Value.TotalSeconds;
919-
BoardingEndS -= sinceActArriveS;
920-
double SchDepartS = SchDepart.Subtract(new DateTime()).TotalSeconds;
921-
BoardingEndS = CompareTimes.LatestTime((int)SchDepartS, (int)BoardingEndS);
913+
arrived = true;
914+
// But not if game starts after scheduled arrival. In which case actual arrival is assumed to be same as schedule arrival.
915+
double sinceActArriveS = (new DateTime().Add(TimeSpan.FromSeconds(Simulator.ClockTime))
916+
- ActArrive).Value.TotalSeconds;
917+
BoardingEndS -= sinceActArriveS;
918+
double SchDepartS = SchDepart.Subtract(new DateTime()).TotalSeconds;
919+
BoardingEndS = CompareTimes.LatestTime((int)SchDepartS, (int)BoardingEndS);
922920

921+
}
923922
}
924-
925-
ldbfevaldepartbeforeboarding = false; // reset flag. Debrief Eval
926-
}
927923
if (MyPlayerTrain.NextSignalObject[0] != null)
928924
distanceToNextSignal = MyPlayerTrain.NextSignalObject[0].DistanceTo(MyPlayerTrain.FrontTDBTraveller);
925+
929926
}
930927
}
931928
else if (EventType == ActivityEventType.TrainStart)
@@ -940,15 +937,6 @@ public override void NotifyEvent(ActivityEventType EventType)
940937
if (MyPlayerTrain.TrainType != Train.TRAINTYPE.AI_PLAYERHOSTING)
941938
MyPlayerTrain.ClearStation(PlatformEnd1.LinkedPlatformItemId, PlatformEnd2.LinkedPlatformItemId, true);
942939

943-
// Debrief Eval: departure before boarding completed
944-
if (!maydepart && !ldbfevaldepartbeforeboarding)
945-
{
946-
var train = Simulator.PlayerLocomotive.Train;
947-
ldbfevaldepartbeforeboarding = true;
948-
DbfEvalDepartBeforeBoarding.Add(PlatformEnd1.Station);
949-
train.DbfEvalValueChanged = true;
950-
}
951-
952940
if (LogStationStops)
953941
{
954942
StringBuilder stringBuild = new StringBuilder();
@@ -993,6 +981,15 @@ public override void NotifyEvent(ActivityEventType EventType)
993981
{
994982
DisplayMessage = Simulator.Catalog.GetStringFmt("Passenger boarding completes in {0:D2}:{1:D2}",
995983
remaining / 60, remaining % 60);
984+
985+
//Debrief Eval
986+
if (Simulator.PlayerLocomotive.SpeedMpS > 0 && !ldbfevaldepartbeforeboarding)
987+
{
988+
var train = Simulator.PlayerLocomotive.Train;
989+
ldbfevaldepartbeforeboarding = true;
990+
DbfEvalDepartBeforeBoarding.Add(PlatformEnd1.Station);
991+
train.DbfEvalValueChanged = true;
992+
}
996993
}
997994
// May depart
998995
else if (!maydepart)
@@ -1011,6 +1008,8 @@ public override void NotifyEvent(ActivityEventType EventType)
10111008
if (MyPlayerTrain.IsActualPlayerTrain) Simulator.SoundNotify = Event.PermissionToDepart;
10121009
}
10131010

1011+
ldbfevaldepartbeforeboarding = false;//reset flag. Debrief Eval
1012+
10141013
// if last task, show closure window
10151014
// also set times in logfile
10161015

Source/Orts.Simulation/Simulation/Physics/Train.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1628,7 +1628,6 @@ public void DPMoveToFront()
16281628
if (LeadLocomotive == null || (LeadLocomotive as MSTSLocomotive).DPDynamicBrakeController == null)
16291629
return;
16301630
int idToMove = -1;
1631-
bool stillHasRemotes = false;
16321631
for (var i = 0; i < Cars.Count; i++)
16331632
{
16341633
if (!(Cars[i] is MSTSLocomotive))
@@ -1642,12 +1641,7 @@ public void DPMoveToFront()
16421641
Cars[i].RemoteControlGroup = 0;
16431642
else if (idToMove > -1 && Cars[i].RemoteControlGroup == 0)
16441643
Cars[i].RemoteControlGroup = 1;
1645-
1646-
if (Cars[i].RemoteControlGroup == 1)
1647-
stillHasRemotes = true;
16481644
}
1649-
if (!stillHasRemotes)
1650-
DPMode = 0;
16511645
}
16521646

16531647
/// <summary>
@@ -1662,7 +1656,6 @@ public void DPMoveToBack()
16621656
var dpDynamicBrakeCurrentNotch = MathHelper.Clamp((LeadLocomotive as MSTSLocomotive).DPDynamicBrakeController.GetNotch(dpDynamicBrakePercent/100), 0, 8);
16631657
var dpThrottleCurrentNotch = (LeadLocomotive as MSTSLocomotive).ThrottleController.CurrentNotch;
16641658
int idToMove = -1;
1665-
bool alreadyHasRemotes = false;
16661659
int idLead = LeadLocomotive != null ? (Cars[LeadLocomotiveIndex] as MSTSLocomotive).DPUnitID : -1;
16671660
for (var i = Cars.Count - 1; i >= 0; i--)
16681661
{
@@ -1674,7 +1667,6 @@ public void DPMoveToBack()
16741667
dpThrottlePercent = DPThrottlePercent;
16751668
dpDynamicBrakeCurrentNotch = (LeadLocomotive as MSTSLocomotive).DPDynamicBrakeController.CurrentNotch;
16761669
dpThrottleCurrentNotch = (LeadLocomotive as MSTSLocomotive).DPThrottleController.CurrentNotch;
1677-
alreadyHasRemotes = true;
16781670
continue;
16791671
}
16801672
if (idToMove == -1 && Cars[i].RemoteControlGroup == 0)
@@ -1694,13 +1686,6 @@ public void DPMoveToBack()
16941686
else if (idToMove > -1 && Cars[i].RemoteControlGroup == 1)
16951687
Cars[i].RemoteControlGroup = 0;
16961688
}
1697-
if (!alreadyHasRemotes)
1698-
{
1699-
if (LeadLocomotive.ThrottlePercent > 0)
1700-
DPMode = 1;
1701-
else if (LeadLocomotive.DynamicBrakePercent >= 0) // off is -1
1702-
DPMode = -1;
1703-
}
17041689
}
17051690

17061691
/// <summary>

Source/RunActivity/Prerequisites.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
Open Rails software Prerequisites.txt - Release v1.6 June 2025
1+
Open Rails software Prerequisites.txt - Release v1.5
2+
September 2022
23

3-
Visit our web-page at https://openrails.org for details and links.
4+
Visit our web-page at http://openrails.org for details and links.
45

56
Please note the distribution and use of Open Rails software is governed by the GNU License - see file Copying.txt.
67
Source code can be downloaded from https://github.com/openrails/openrails

Source/RunActivity/Readme.txt

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
1-
Open Rails software Readme.txt - Release v1.6 - June 2025
1+
Open Rails software Readme.txt - Release v1.5
2+
September 2022
23

3-
Visit our web-page at https://openrails.org for details and links.
4+
Visit our web-page at http://openrails.org for details and links.
45

5-
Please note the distribution and use of Open Rails software is governed by the GNU License - see file Copying.txt. Source code can be downloaded from https://github.com/openrails/openrails
6+
Please note the distribution and use of Open Rails software is governed by the GNU License - see file Copying.txt.
7+
Source code can be downloaded from https://github.com/openrails/openrails
68

79
OPERATION
8-
- You can run Open Rails by clicking on the Desktop icon or the Quick Launch icon or the Start Menu entry or C:\Program Files\Open Rails\OpenRails.exe
10+
- You can run Open Rails by clicking on the Desktop icon or the Quick Launch icon or the Start Menu entry or C:\Program Files (x86)\Open Rails\OpenRails.exe
911
- Help and Game Controls are available in-game using the Help key (F1).
1012
- Please read the operations manual in Open Rails > Documents > Manual.pdf
1113

1214
CONTENT
1315
This Open Rails download does not include any content - no routes, trains, activities - just the simulation program.
1416

15-
If you have content suitable for Open Rails or Microsoft Train Simulator already in place, then you can use the Open Rails program to operate those routes and drive those trains straight away. If not, then you will need to install some models bought from a vendor or free from the community before you can use Open Rails.
17+
If you have content suitable for Open Rails or Microsoft Train Simulator already in place, then you can use the
18+
Open Rails program to operate those routes and drive those trains straight away.
1619

17-
Use the Content button for some auto-install routes or visit the catalogue at www.openrails.org/download/explore-content
20+
If not, then you will need to install some models bought from a vendor or free from the community before you can use Open Rails.
21+
22+
Or you can try out the 2 self-installing models on our home page - both free of charge.
1823

1924
SUPPORT
2025
Please send bug reports and feature requests to our Bug Tracker at https://launchpad.net/or
2126

2227
UPDATES
23-
Open Rails checks once a day for new versions and, if found, adds a red marker to the notification icon in the top right of the menu form. Click on the notification to find the details of an update and install it.
28+
Open Rails checks once a day for new versions and, if found, adds an Update link in the top right of its main menu.
29+
Click this Update link to download and update your Open Rails.

Source/RunActivity/Viewer3D/AnimatedPart.cs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,9 @@ public void SetFrameCycle(float frame)
130130
public void SetFrameWrap(float frame)
131131
{
132132
// Wrap the frame around 0-MaxFrame without hanging when MaxFrame=0.
133-
if (MaxFrame > 0)
134-
{
135-
frame %= MaxFrame;
136-
// If frame was negative (eg: animation run in reverse), it will still be negative
137-
// and needs one additional offset by MaxFrame to be in the correct range
138-
if (frame < 0)
139-
frame += MaxFrame;
140-
}
141-
else if (frame < 0)
142-
frame = 0;
133+
while (MaxFrame > 0 && frame < 0) frame += MaxFrame;
134+
if (frame < 0) frame = 0;
135+
frame %= MaxFrame;
143136
SetFrame(frame);
144137
}
145138

0 commit comments

Comments
 (0)