Skip to content

Commit cf6e63b

Browse files
committed
Automatic merge of T1.6-rc2-41-gacd714487 and 8 pull requests
- Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc) - Pull request #1091 at 2391bc0: Automatic speed control - Pull request #1107 at f5eb3dc: Fix DPMode when last remote is moved to front. - Pull request #1110 at 387388e: Fix Activity Runner persists after loading exception - Pull request #1114 at 9a4a873: Fix color of DB in DrivingInfo when in setup with DPU fenced. - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1104 at f40920a: Handle simple adhesion within the axle module - Pull request #1081 at 689494b: Brake cuts power unification
10 parents 09d47c1 + acd7144 + e10390b + 2391bc0 + f5eb3dc + 387388e + 9a4a873 + 5845a1a + f40920a + 689494b commit cf6e63b

File tree

9 files changed

+120
-94
lines changed

9 files changed

+120
-94
lines changed

Source/Installer/Installer.iss

Lines changed: 16 additions & 10 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 "http://openrails.org" ; Not yet HTTPS
23+
#define MyAppURL "https://openrails.org"
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"
34+
#define NetRedist "ndp472-kb4054531-web.exe" ; Has to be lower-case to match download
3535

3636
[Setup]
3737
; NOTE: The value of AppId uniquely identifies this application.
@@ -50,20 +50,26 @@ 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-
; 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
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
5864

5965
Compression =lzma
6066
SolidCompression=yes
61-
WizardStyle=modern
67+
WizardStyle =modern
6268
Uninstallable =yes
63-
UninstallDisplayIcon={app}\{#MyAppExeName}
64-
OutputBaseFilename=OpenRailsSetup
69+
UninstallDisplayIcon ={app}\{#MyAppExeName}
70+
OutputBaseFilename =OpenRailsSetup
6571

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

6975
[Languages]
@@ -79,7 +85,7 @@ Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl"
7985
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
8086
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
8187
Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl"
82-
Name: "icelandic"; MessagesFile: "compiler:Languages\Icelandic.isl"
88+
;Name: "icelandic"; MessagesFile: "compiler:Languages\Icelandic.isl"
8389
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
8490
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
8591
Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl"

Source/Installer/Using the installer scripts.txt

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

4-
1. If you wish to update the version name from "1.5", then edit the line
5-
#define MyAppVersion "1.5"
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"
69
in the file
710
Source\Installer\Version.iss
811
and update the Release number and date in:
912
Source\RunActivity\Readme.txt
1013
and in
1114
Source\RunActivity\Prerequisites.txt
1215

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

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

2530
5. Repeat the following as often as required:
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
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"
2732

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

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

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.
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.
3641

3742
E. Copy contents into folder
38-
<A>\Open Rails\Program\Documentation\
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.
3947

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

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

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

4957
Arrange for the VM to have Internet access and a shared folder.
5058
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 "none"
1+
#define MyAppVersion "1.6"

Source/Orts.Simulation/Simulation/Activity.cs

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,8 @@ 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
887889
}
888890
else
889891
{
@@ -900,29 +902,30 @@ public override void NotifyEvent(ActivityEventType EventType)
900902
if (BoardingS > 0 || ((double)(SchDepart - SchArrive).TotalSeconds > 0 &&
901903
MyPlayerTrain.PassengerCarsNumber == 1 && MyPlayerTrain.Cars.Count > 10 ))
902904
{
903-
// accepted station stop because either freight train or passenger train or fake passenger train with passenger car on platform or fake passenger train
905+
// accepted station stop because either freight train or passenger train or fake passenger train with passenger car on platform or fake passenger train
904906
// with Scheduled Depart > Scheduled Arrive
905-
// ActArrive is usually same as ClockTime
906-
BoardingEndS = Simulator.ClockTime + BoardingS;
907+
// ActArrive is usually same as ClockTime
908+
BoardingEndS = Simulator.ClockTime + BoardingS;
907909

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

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);
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);
920922

921-
}
922923
}
924+
925+
ldbfevaldepartbeforeboarding = false; // reset flag. Debrief Eval
926+
}
923927
if (MyPlayerTrain.NextSignalObject[0] != null)
924928
distanceToNextSignal = MyPlayerTrain.NextSignalObject[0].DistanceTo(MyPlayerTrain.FrontTDBTraveller);
925-
926929
}
927930
}
928931
else if (EventType == ActivityEventType.TrainStart)
@@ -937,6 +940,15 @@ public override void NotifyEvent(ActivityEventType EventType)
937940
if (MyPlayerTrain.TrainType != Train.TRAINTYPE.AI_PLAYERHOSTING)
938941
MyPlayerTrain.ClearStation(PlatformEnd1.LinkedPlatformItemId, PlatformEnd2.LinkedPlatformItemId, true);
939942

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+
940952
if (LogStationStops)
941953
{
942954
StringBuilder stringBuild = new StringBuilder();
@@ -981,15 +993,6 @@ public override void NotifyEvent(ActivityEventType EventType)
981993
{
982994
DisplayMessage = Simulator.Catalog.GetStringFmt("Passenger boarding completes in {0:D2}:{1:D2}",
983995
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-
}
993996
}
994997
// May depart
995998
else if (!maydepart)
@@ -1008,8 +1011,6 @@ public override void NotifyEvent(ActivityEventType EventType)
10081011
if (MyPlayerTrain.IsActualPlayerTrain) Simulator.SoundNotify = Event.PermissionToDepart;
10091012
}
10101013

1011-
ldbfevaldepartbeforeboarding = false;//reset flag. Debrief Eval
1012-
10131014
// if last task, show closure window
10141015
// also set times in logfile
10151016

Source/RunActivity/Prerequisites.txt

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

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

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

Source/RunActivity/Readme.txt

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

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

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
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
86

97
OPERATION
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
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
119
- Help and Game Controls are available in-game using the Help key (F1).
1210
- Please read the operations manual in Open Rails > Documents > Manual.pdf
1311

1412
CONTENT
1513
This Open Rails download does not include any content - no routes, trains, activities - just the simulation program.
1614

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.
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.
1916

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.
17+
Use the Content button for some auto-install routes or visit the catalogue at www.openrails.org/download/explore-content
2318

2419
SUPPORT
2520
Please send bug reports and feature requests to our Bug Tracker at https://launchpad.net/or
2621

2722
UPDATES
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.
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.

Source/RunActivity/Viewer3D/Lights.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ bool UpdateState()
300300
Debug.Assert(Viewer.PlayerTrain.LeadLocomotive == Viewer.PlayerLocomotive ||Viewer.PlayerTrain.TrainType == Train.TRAINTYPE.AI_PLAYERHOSTING || Viewer.PlayerTrain.Autopilot ||
301301
Viewer.PlayerTrain.TrainType == Train.TRAINTYPE.REMOTE || Viewer.PlayerTrain.TrainType == Train.TRAINTYPE.STATIC, "PlayerTrain.LeadLocomotive must be PlayerLocomotive.");
302302
var leadLocomotiveCar = Car.Train?.LeadLocomotive; // Note: Will return null for AI trains, this is intended behavior
303-
var leadLocomotive = leadLocomotiveCar as MSTSLocomotive;
303+
var leadLocomotive = leadLocomotiveCar as MSTSLocomotive;
304304

305305
// There are a lot of conditions now! IgnoredConditions[] stores which conditions are ignored, allowing shortcutting of many of these calculations
306306
// Should prevent some unneeded computation, but is a little messy. May revise in the future
@@ -318,7 +318,7 @@ bool UpdateState()
318318
&& leadLocomotive != null && leadLocomotive.TrainBrakeController.EmergencyBraking;
319319
// Control
320320
bool newCarIsPlayer = !Car.Lights.IgnoredConditions[3] && Car.Train != null && (Car.Train == Viewer.PlayerTrain || Car.Train.TrainType == Train.TRAINTYPE.REMOTE);
321-
// Service - if a player or AI train, then will considered to be in servie, loose consists will not be considered to be in service.
321+
// Service - if a player or AI train, then will considered to be in service, loose consists will not be considered to be in service.
322322
bool newCarInService = !Car.Lights.IgnoredConditions[4] && Car.Train != null
323323
&& (Car.Train == Viewer.PlayerTrain || Car.Train.TrainType == Train.TRAINTYPE.REMOTE || Car.Train.TrainType == Train.TRAINTYPE.AI);
324324
// Time of day
@@ -346,6 +346,15 @@ bool UpdateState()
346346
// Passenger doors
347347
bool newLeftDoorOpen = !Car.Lights.IgnoredConditions[11] && Car.Train?.DoorState(DoorSide.Left) != DoorState.Closed;
348348
bool newRightDoorOpen = !Car.Lights.IgnoredConditions[11] && Car.Train?.DoorState(DoorSide.Right) != DoorState.Closed;
349+
// AI trains don't have a lead locomotive, but the upcoming lighting calculations want a lead locomotive, try to determine a lead locomotive to use
350+
if (leadLocomotive == null && Car.Train != null)
351+
{
352+
// If first car is flipped, the 'lead' vehicle is actually at the rear
353+
if (Car.Train.FirstCar.Flipped && Car.Train.LastCar is MSTSLocomotive)
354+
leadLocomotive = Car.Train.LastCar as MSTSLocomotive;
355+
else if (Car.Train.FirstCar is MSTSLocomotive)
356+
leadLocomotive = Car.Train.FirstCar as MSTSLocomotive;
357+
}
349358
// Horn and bell (for flashing ditch lights)
350359
bool newHornOn = !Car.Lights.IgnoredConditions[12] && leadLocomotive != null && leadLocomotive.HornRecent;
351360
bool newBellOn = !Car.Lights.IgnoredConditions[13] && leadLocomotive != null && leadLocomotive.BellRecent;

0 commit comments

Comments
 (0)