Skip to content

Commit b909926

Browse files
committed
Automatic merge of T1.5.1-791-gffaeec028 and 14 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 #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 d9ce84b: feat: Add notifications to Menu - Pull request #886 at 6c0785b: Scene viewer extension to TrackViewer - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #893 at bf8876b: Signal errors - 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 #899 at 234b167: Duplex steam engines - Booster Engine addition - Pull request #903 at d5b3639: Downloading route content from Github - Pull request #906 at 0e0aa8b: Bug fix for https://bugs.launchpad.net/or/+bug/2047299 Crash loading a 3Dcab-only loco - Pull request #907 at 9b0b04f: Bug fix for https://bugs.launchpad.net/or/+bug/2047300 Dynamic tracks disappear after long tunnel
16 parents db05b49 + ffaeec0 + 3539862 + d00beb9 + f92de76 + a055bca + d9ce84b + 6c0785b + 1f5ba4c + bf8876b + 5866028 + 0a9d939 + 234b167 + d5b3639 + 0e0aa8b + 9b0b04f commit b909926

File tree

17 files changed

+2686
-1191
lines changed

17 files changed

+2686
-1191
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.Formats.Msts/SoundManagmentFile.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public struct CurvePoint
198198

199199
public class VolumeCurve
200200
{
201-
public enum Controls { None, DistanceControlled, SpeedControlled, Variable1Controlled, Variable2Controlled, Variable3Controlled, BrakeCylControlled, CurveForceControlled };
201+
public enum Controls { None, DistanceControlled, SpeedControlled, Variable1Controlled, Variable2_1Controlled, Variable3_1Controlled, Variable4_1Controlled, Variable2Controlled, Variable3Controlled, BrakeCylControlled, CurveForceControlled };
202202

203203
public Controls Control = Controls.None;
204204
public float Granularity = 1.0f;
@@ -214,6 +214,9 @@ public VolumeCurve(STFReader stf)
214214
case "distancecontrolled": Control = Controls.DistanceControlled; break;
215215
case "speedcontrolled": Control = Controls.SpeedControlled; break;
216216
case "variable1controlled": Control = Controls.Variable1Controlled; break;
217+
case "variable2_1controlled": Control = Controls.Variable2_1Controlled; break;
218+
case "variable3_1controlled": Control = Controls.Variable3_1Controlled; break;
219+
case "variable4_1controlled": Control = Controls.Variable4_1Controlled; break;
217220
case "variable2controlled": Control = Controls.Variable2Controlled; break;
218221
case "variable3controlled": Control = Controls.Variable3Controlled; break;
219222
case "brakecylcontrolled": Control = Controls.BrakeCylControlled; break;
@@ -339,7 +342,7 @@ public Discrete_Trigger(STFReader f)
339342
public class Variable_Trigger : Trigger
340343
{
341344
public enum Events { Speed_Inc_Past, Speed_Dec_Past, Distance_Inc_Past, Distance_Dec_Past,
342-
Variable1_Inc_Past, Variable1_Dec_Past, Variable2_Inc_Past, Variable2_Dec_Past, Variable3_Inc_Past, Variable3_Dec_Past, BrakeCyl_Inc_Past, BrakeCyl_Dec_Past, CurveForce_Inc_Past, CurveForce_Dec_Past
345+
Variable1_Inc_Past, Variable2_1_Inc_Past, Variable3_1_Inc_Past, Variable4_1_Inc_Past, Variable1_Dec_Past, Variable2_1_Dec_Past, Variable3_1_Dec_Past, Variable4_1_Dec_Past, Variable2_Inc_Past, Variable2_Dec_Past, Variable3_Inc_Past, Variable3_Dec_Past, BrakeCyl_Inc_Past, BrakeCyl_Dec_Past, CurveForce_Inc_Past, CurveForce_Dec_Past
343346
};
344347

345348
public Events Event;
@@ -370,7 +373,13 @@ public Variable_Trigger(STFReader f)
370373
break;
371374
}
372375
case "variable1_inc_past": Event = Events.Variable1_Inc_Past; break;
376+
case "variable2_1_inc_past": Event = Events.Variable2_1_Inc_Past; break;
377+
case "variable3_1_inc_past": Event = Events.Variable3_1_Inc_Past; break;
378+
case "variable4_1_inc_past": Event = Events.Variable4_1_Inc_Past; break;
373379
case "variable1_dec_past": Event = Events.Variable1_Dec_Past; break;
380+
case "variable2_1_dec_past": Event = Events.Variable2_1_Dec_Past; break;
381+
case "variable3_1_dec_past": Event = Events.Variable3_1_Dec_Past; break;
382+
case "variable4_1_dec_past": Event = Events.Variable4_1_Dec_Past; break;
374383
case "variable2_inc_past": Event = Events.Variable2_Inc_Past; break;
375384
case "variable2_dec_past": Event = Events.Variable2_Dec_Past; break;
376385
case "variable3_inc_past": Event = Events.Variable3_Inc_Past; break;

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/MSTSDieselLocomotive.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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: 9 additions & 6 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+
if (EngineType == EngineTypes.Diesel || EngineType == EngineTypes.Electric)
2015+
{
20142016
UpdateTractiveForce(elapsedClockSeconds, ThrottlePercent / 100f, AbsSpeedMpS, AbsWheelSpeedMpS);
2017+
}
20152018

20162019
foreach (MultiPositionController mpc in MultiPositionControllers)
20172020
{
@@ -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)