Skip to content

Commit d21c233

Browse files
committed
Automatic merge of T1.5.1-757-gef6c1a8c8 and 17 pull requests
- Pull request #570 at 3539862: Experimental glTF 2.0 support with PBR lighting - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #874 at f8dbeab: Dynamic brake controller refactoring - Pull request #875 at 43bf33e: Bug fix for https://bugs.launchpad.net/or/+bug/2036346 Player train switching doesn't work with 3D cabs - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #882 at a055bca: Blueprint/train car operations UI window - Pull request #885 at c81447b: feat: Add notifications to Menu - Pull request #886 at 167e2e4: Scene viewer extension to TrackViewer - Pull request #888 at d7daf62: docs: Document player application model - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #893 at bf8876b: Signal errors - Pull request #894 at 5ff1e73: Correct Decrease Colour - Pull request #896 at 5866028: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains - Pull request #897 at 0a9d939: feat: Improved system information collection - Pull request #898 at e271395: Extra line with all the arguments for debugging purposes in logfile - Pull request #899 at be2319c: Duplex steam engines - Booster Engine addition - Pull request #900 at 42ea7ad: DMI updates
19 parents fd3338f + ef6c1a8 + 3539862 + d00beb9 + f8dbeab + 43bf33e + f92de76 + a055bca + c81447b + 167e2e4 + d7daf62 + 1f5ba4c + bf8876b + 5ff1e73 + 5866028 + 0a9d939 + e271395 + be2319c + 42ea7ad commit d21c233

File tree

15 files changed

+2142
-893
lines changed

15 files changed

+2142
-893
lines changed

Source/ORTS.Common/Input/UserCommand.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,9 @@ public enum UserCommand
196196
[GetString("Control Blower Decrease")] ControlBlowerDecrease,
197197
[GetString("Control Steam Heat Increase")] ControlSteamHeatIncrease,
198198
[GetString("Control Steam Heat Decrease")] ControlSteamHeatDecrease,
199-
[GetString("Control Steam Booster Increase")] ControlSteamBoosterIncrease,
200-
[GetString("Control Steam Booster Decrease")] ControlSteamBoosterDecrease,
199+
[GetString("Control Steam Booster Air Valve")] ControlSteamBoosterAirValve,
200+
[GetString("Control Steam Booster Idle Valve")] ControlSteamBoosterIdleValve,
201+
[GetString("Control Steam Booster Latch")] ControlSteamBoosterLatch,
201202
[GetString("Control Damper Increase")] ControlDamperIncrease,
202203
[GetString("Control Damper Decrease")] ControlDamperDecrease,
203204
[GetString("Control Firebox Open")] ControlFireboxOpen,

Source/ORTS.Settings/InputSettings.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,9 @@ static void InitializeCommands(UserCommandInput[] Commands)
356356
Commands[(int)UserCommand.ControlBlowerIncrease] = new UserCommandKeyInput(0x31);
357357
Commands[(int)UserCommand.ControlSteamHeatDecrease] = new UserCommandKeyInput(0x20, KeyModifiers.Alt);
358358
Commands[(int)UserCommand.ControlSteamHeatIncrease] = new UserCommandKeyInput(0x16, KeyModifiers.Alt);
359-
Commands[(int)UserCommand.ControlSteamBoosterDecrease] = new UserCommandKeyInput(0x11, KeyModifiers.Shift);
360-
Commands[(int)UserCommand.ControlSteamBoosterIncrease] = new UserCommandKeyInput(0x11, KeyModifiers.Alt);
359+
Commands[(int)UserCommand.ControlSteamBoosterAirValve] = new UserCommandKeyInput(0x11, KeyModifiers.Alt);
360+
Commands[(int)UserCommand.ControlSteamBoosterIdleValve] = new UserCommandKeyInput(0x25, KeyModifiers.Alt);
361+
Commands[(int)UserCommand.ControlSteamBoosterLatch] = new UserCommandKeyInput(0x25, KeyModifiers.Control);
361362
Commands[(int)UserCommand.ControlBrakeHoseConnect] = new UserCommandKeyInput(0x2B);
362363
Commands[(int)UserCommand.ControlBrakeHoseDisconnect] = new UserCommandKeyInput(0x2B, KeyModifiers.Shift);
363364
Commands[(int)UserCommand.ControlCabRadio] = new UserCommandKeyInput(0x13, KeyModifiers.Alt);

Source/Orts.Formats.Msts/CabViewFile.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ public enum CABViewControlTypes
130130
DAMPERS_FRONT,
131131
DAMPERS_BACK,
132132
STEAM_HEAT,
133-
STEAM_BOOSTER,
133+
STEAM_BOOSTER_AIR,
134+
STEAM_BOOSTER_IDLE,
135+
STEAM_BOOSTER_LATCH,
134136
WATER_INJECTOR1,
135137
WATER_INJECTOR2,
136138
SMALL_EJECTOR,

Source/Orts.Simulation/Common/Commands.cs

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,21 +1599,64 @@ public override void Redo()
15991599
// Steam controls
16001600

16011601
// Steam booster command
1602+
16021603
[Serializable()]
1603-
public sealed class ContinuousSteamBoosterCommand : ContinuousCommand
1604+
public sealed class ToggleSteamBoosterAirCommand : Command
16041605
{
16051606
public static MSTSSteamLocomotive Receiver { get; set; }
16061607

1607-
public ContinuousSteamBoosterCommand(CommandLog log, int injector, bool toState, float? target, double startTime)
1608-
: base(log, toState, target, startTime)
1608+
public ToggleSteamBoosterAirCommand(CommandLog log)
1609+
: base(log)
1610+
{
1611+
Redo();
1612+
}
1613+
1614+
public override void Redo()
1615+
{
1616+
if (Receiver == null) return;
1617+
Receiver.ToggleSteamBoosterAir();
1618+
// Report();
1619+
}
1620+
}
1621+
1622+
// Steam Booster Idle Valve
1623+
1624+
[Serializable()]
1625+
public sealed class ToggleSteamBoosterIdleCommand : Command
1626+
{
1627+
public static MSTSSteamLocomotive Receiver { get; set; }
1628+
1629+
public ToggleSteamBoosterIdleCommand(CommandLog log)
1630+
: base(log)
1631+
{
1632+
Redo();
1633+
}
1634+
1635+
public override void Redo()
1636+
{
1637+
if (Receiver == null) return;
1638+
Receiver.ToggleSteamBoosterIdle();
1639+
// Report();
1640+
}
1641+
}
1642+
1643+
// Steam Booster Latch
1644+
1645+
[Serializable()]
1646+
public sealed class ToggleSteamBoosterLatchCommand : Command
1647+
{
1648+
public static MSTSSteamLocomotive Receiver { get; set; }
1649+
1650+
public ToggleSteamBoosterLatchCommand(CommandLog log)
1651+
: base(log)
16091652
{
16101653
Redo();
16111654
}
16121655

16131656
public override void Redo()
16141657
{
16151658
if (Receiver == null) return;
1616-
Receiver.SteamBoosterChangeTo(ToState, Target);
1659+
Receiver.ToggleSteamBoosterLatch();
16171660
// Report();
16181661
}
16191662
}

Source/Orts.Simulation/Simulation/Confirmer.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ public enum CabControl {
6666
, FiringIsManual
6767
, FireShovelfull
6868
, CylinderCocks
69-
, SteamBooster
69+
, SteamBoosterAir
70+
, SteamBoosterIdle
71+
, SteamBoosterLatch
7072
, CylinderCompound
7173
, LargeEjector
7274
, SmallEjector
@@ -217,7 +219,9 @@ public Confirmer(Simulator simulator, double defaultDurationS)
217219
, new string [] { GetString("Manual Firing"), GetString("off"), null, GetString("on") }
218220
, new string [] { GetString("Fire"), null, null, GetString("add shovel-full") }
219221
, new string [] { GetString("Cylinder Cocks"), GetString("close"), null, GetString("open") }
220-
, new string [] { GetString("SteamBooster"), null, null, null, GetString("decrease"), GetString("increase") }
222+
, new string [] { GetString("Steam Booster Air Valve"), GetString("close"), null, GetString("open") }
223+
, new string [] { GetString("Steam Booster Idle Valve"), GetString("idle"), null, GetString("run") }
224+
, new string [] { GetString("Steam Booster Latch"), GetString("opened"), null, GetString("locked") }
221225
, new string [] { GetString("Cylinder Compound"), GetString("close"), null, GetString("open") }
222226
, new string [] { GetString("LargeEjector"), null, null, null, GetString("decrease"), GetString("increase") }
223227
, new string [] { GetString("SmallEjector"), null, null, null, GetString("decrease"), GetString("increase") }

Source/Orts.Simulation/Simulation/RollingStocks/MSTSControlTrailerCar.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public override string GetStatus()
225225
/// <summary>
226226
/// This function updates periodically the locomotive's motive force.
227227
/// </summary>
228-
protected override void UpdateTractiveForce(float elapsedClockSeconds, float t, float AbsSpeedMpS, float AbsWheelSpeedMpS)
228+
protected override void UpdateTractiveForce(float elapsedClockSeconds, float t, float AbsSpeedMpS, float AbsWheelSpeedMpS, int numberofengine)
229229
{
230230
}
231231

Source/Orts.Simulation/Simulation/RollingStocks/MSTSDieselLocomotive.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ protected override void UpdateControllers(float elapsedClockSeconds)
624624
/// <summary>
625625
/// This function updates periodically the locomotive's motive force.
626626
/// </summary>
627-
protected override void UpdateTractiveForce(float elapsedClockSeconds, float t, float AbsSpeedMpS, float AbsWheelSpeedMpS)
627+
protected override void UpdateTractiveForce(float elapsedClockSeconds, float t, float AbsSpeedMpS, float AbsWheelSpeedMpS, int numberofengine)
628628
{
629629
// This section calculates the motive force of the locomotive as follows:
630630
// Basic configuration (no TF table) - uses P = F /speed relationship - requires power and force parameters to be set in the ENG file.
@@ -760,7 +760,7 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float t,
760760
DieselEngines.HandleEvent(PowerSupplyEvent.StopEngine);
761761
}
762762

763-
ApplyDirectionToTractiveForce();
763+
ApplyDirectionToTractiveForce(ref TractiveForceN);
764764

765765
// Calculate the total tractive force for the locomotive - ie Traction + Dynamic Braking force.
766766
// Note typically only one of the above will only ever be non-zero at the one time.

Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2011,7 +2011,10 @@ public override void Update(float elapsedClockSeconds)
20112011
}
20122012

20132013
// TODO this is a wild simplification for electric and diesel electric
2014-
UpdateTractiveForce(elapsedClockSeconds, ThrottlePercent / 100f, AbsSpeedMpS, AbsWheelSpeedMpS);
2014+
if (EngineType == EngineTypes.Diesel || EngineType == EngineTypes.Electric)
2015+
{
2016+
UpdateTractiveForce(elapsedClockSeconds, ThrottlePercent / 100f, AbsSpeedMpS, AbsWheelSpeedMpS, 0);
2017+
}
20152018

20162019
foreach (MultiPositionController mpc in MultiPositionControllers)
20172020
{
@@ -2332,7 +2335,7 @@ protected virtual void UpdateControllers(float elapsedClockSeconds)
23322335
/// <summary>
23332336
/// This function updates periodically the locomotive's motive force.
23342337
/// </summary>
2335-
protected virtual void UpdateTractiveForce(float elapsedClockSeconds, float t, float AbsSpeedMpS, float AbsWheelSpeedMpS)
2338+
protected virtual void UpdateTractiveForce(float elapsedClockSeconds, float t, float AbsSpeedMpS, float AbsWheelSpeedMpS, int numberofengine)
23362339
{
23372340
// Method to set force and power info
23382341
// An alternative method in the steam locomotive will override this and input force and power info for it.
@@ -2398,7 +2401,7 @@ protected virtual void UpdateTractiveForce(float elapsedClockSeconds, float t, f
23982401
AverageForceN = w * AverageForceN + (1 - w) * TractiveForceN;
23992402
}
24002403

2401-
ApplyDirectionToTractiveForce();
2404+
ApplyDirectionToTractiveForce(ref TractiveForceN);
24022405

24032406
// Calculate the total tractive force for the locomotive - ie Traction + Dynamic Braking force.
24042407
// Note typically only one of the above will only ever be non-zero at the one time.
@@ -2453,21 +2456,21 @@ protected virtual void UpdateAxleDriveForce()
24532456
/// <summary>
24542457
/// This function applies a sign to the motive force as a function of the direction of the train.
24552458
/// </summary>
2456-
protected virtual void ApplyDirectionToTractiveForce()
2459+
protected virtual void ApplyDirectionToTractiveForce(ref float tractiveForceN)
24572460
{
24582461
if (Train.IsPlayerDriven)
24592462
{
24602463
switch (Direction)
24612464
{
24622465
case Direction.Forward:
2463-
//MotiveForceN *= 1; //Not necessary
2466+
//tractiveForceN *= 1; //Not necessary
24642467
break;
24652468
case Direction.Reverse:
2466-
TractiveForceN *= -1;
2469+
tractiveForceN *= -1;
24672470
break;
24682471
case Direction.N:
24692472
default:
2470-
TractiveForceN *= 0;
2473+
tractiveForceN *= 0;
24712474
break;
24722475
}
24732476
}
@@ -2476,7 +2479,7 @@ protected virtual void ApplyDirectionToTractiveForce()
24762479
switch (Direction)
24772480
{
24782481
case Direction.Reverse:
2479-
TractiveForceN *= -1;
2482+
tractiveForceN *= -1;
24802483
break;
24812484
default:
24822485
break;

0 commit comments

Comments
 (0)