Skip to content

Commit 0fd8912

Browse files
committed
Automatic merge of T1.5.1-791-gffaeec028 and 13 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 #903 at c5f6638: 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
15 parents c9c39ea + ffaeec0 + 3539862 + d00beb9 + f92de76 + a055bca + d9ce84b + 6c0785b + 1f5ba4c + bf8876b + 5866028 + 0a9d939 + c5f6638 + 0e0aa8b + 9b0b04f commit 0fd8912

File tree

17 files changed

+1190
-2685
lines changed

17 files changed

+1190
-2685
lines changed

Source/ORTS.Common/Input/UserCommand.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,8 @@ 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 Air Valve")] ControlSteamBoosterAirValve,
200-
[GetString("Control Steam Booster Idle Valve")] ControlSteamBoosterIdleValve,
201-
[GetString("Control Steam Booster Latch")] ControlSteamBoosterLatch,
199+
[GetString("Control Steam Booster Increase")] ControlSteamBoosterIncrease,
200+
[GetString("Control Steam Booster Decrease")] ControlSteamBoosterDecrease,
202201
[GetString("Control Damper Increase")] ControlDamperIncrease,
203202
[GetString("Control Damper Decrease")] ControlDamperDecrease,
204203
[GetString("Control Firebox Open")] ControlFireboxOpen,

Source/ORTS.Settings/InputSettings.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,8 @@ 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.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);
359+
Commands[(int)UserCommand.ControlSteamBoosterDecrease] = new UserCommandKeyInput(0x11, KeyModifiers.Shift);
360+
Commands[(int)UserCommand.ControlSteamBoosterIncrease] = new UserCommandKeyInput(0x11, KeyModifiers.Alt);
362361
Commands[(int)UserCommand.ControlBrakeHoseConnect] = new UserCommandKeyInput(0x2B);
363362
Commands[(int)UserCommand.ControlBrakeHoseDisconnect] = new UserCommandKeyInput(0x2B, KeyModifiers.Shift);
364363
Commands[(int)UserCommand.ControlCabRadio] = new UserCommandKeyInput(0x13, KeyModifiers.Alt);

Source/Orts.Formats.Msts/CabViewFile.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,7 @@ public enum CABViewControlTypes
130130
DAMPERS_FRONT,
131131
DAMPERS_BACK,
132132
STEAM_HEAT,
133-
STEAM_BOOSTER_AIR,
134-
STEAM_BOOSTER_IDLE,
135-
STEAM_BOOSTER_LATCH,
133+
STEAM_BOOSTER,
136134
WATER_INJECTOR1,
137135
WATER_INJECTOR2,
138136
SMALL_EJECTOR,

Source/Orts.Formats.Msts/SoundManagmentFile.cs

Lines changed: 2 additions & 11 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, Variable2_1Controlled, Variable3_1Controlled, Variable4_1Controlled, Variable2Controlled, Variable3Controlled, BrakeCylControlled, CurveForceControlled };
201+
public enum Controls { None, DistanceControlled, SpeedControlled, Variable1Controlled, Variable2Controlled, Variable3Controlled, BrakeCylControlled, CurveForceControlled };
202202

203203
public Controls Control = Controls.None;
204204
public float Granularity = 1.0f;
@@ -214,9 +214,6 @@ 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;
220217
case "variable2controlled": Control = Controls.Variable2Controlled; break;
221218
case "variable3controlled": Control = Controls.Variable3Controlled; break;
222219
case "brakecylcontrolled": Control = Controls.BrakeCylControlled; break;
@@ -342,7 +339,7 @@ public Discrete_Trigger(STFReader f)
342339
public class Variable_Trigger : Trigger
343340
{
344341
public enum Events { Speed_Inc_Past, Speed_Dec_Past, Distance_Inc_Past, Distance_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
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
346343
};
347344

348345
public Events Event;
@@ -373,13 +370,7 @@ public Variable_Trigger(STFReader f)
373370
break;
374371
}
375372
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;
379373
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;
383374
case "variable2_inc_past": Event = Events.Variable2_Inc_Past; break;
384375
case "variable2_dec_past": Event = Events.Variable2_Dec_Past; break;
385376
case "variable3_inc_past": Event = Events.Variable3_Inc_Past; break;

Source/Orts.Simulation/Common/Commands.cs

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

16011601
// Steam booster command
1602-
16031602
[Serializable()]
1604-
public sealed class ToggleSteamBoosterAirCommand : Command
1603+
public sealed class ContinuousSteamBoosterCommand : ContinuousCommand
16051604
{
16061605
public static MSTSSteamLocomotive Receiver { get; set; }
16071606

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)
1607+
public ContinuousSteamBoosterCommand(CommandLog log, int injector, bool toState, float? target, double startTime)
1608+
: base(log, toState, target, startTime)
16521609
{
16531610
Redo();
16541611
}
16551612

16561613
public override void Redo()
16571614
{
16581615
if (Receiver == null) return;
1659-
Receiver.ToggleSteamBoosterLatch();
1616+
Receiver.SteamBoosterChangeTo(ToState, Target);
16601617
// Report();
16611618
}
16621619
}

Source/Orts.Simulation/Simulation/Confirmer.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ public enum CabControl {
6666
, FiringIsManual
6767
, FireShovelfull
6868
, CylinderCocks
69-
, SteamBoosterAir
70-
, SteamBoosterIdle
71-
, SteamBoosterLatch
69+
, SteamBooster
7270
, CylinderCompound
7371
, LargeEjector
7472
, SmallEjector
@@ -219,9 +217,7 @@ public Confirmer(Simulator simulator, double defaultDurationS)
219217
, new string [] { GetString("Manual Firing"), GetString("off"), null, GetString("on") }
220218
, new string [] { GetString("Fire"), null, null, GetString("add shovel-full") }
221219
, new string [] { GetString("Cylinder Cocks"), GetString("close"), null, GetString("open") }
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") }
220+
, new string [] { GetString("SteamBooster"), null, null, null, GetString("decrease"), GetString("increase") }
225221
, new string [] { GetString("Cylinder Compound"), GetString("close"), null, GetString("open") }
226222
, new string [] { GetString("LargeEjector"), null, null, null, GetString("decrease"), GetString("increase") }
227223
, 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(ref TractiveForceN);
763+
ApplyDirectionToTractiveForce();
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: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2011,10 +2011,7 @@ 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-
{
20162014
UpdateTractiveForce(elapsedClockSeconds, ThrottlePercent / 100f, AbsSpeedMpS, AbsWheelSpeedMpS);
2017-
}
20182015

20192016
foreach (MultiPositionController mpc in MultiPositionControllers)
20202017
{
@@ -2401,7 +2398,7 @@ protected virtual void UpdateTractiveForce(float elapsedClockSeconds, float t, f
24012398
AverageForceN = w * AverageForceN + (1 - w) * TractiveForceN;
24022399
}
24032400

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

24062403
// Calculate the total tractive force for the locomotive - ie Traction + Dynamic Braking force.
24072404
// Note typically only one of the above will only ever be non-zero at the one time.
@@ -2456,21 +2453,21 @@ protected virtual void UpdateAxleDriveForce()
24562453
/// <summary>
24572454
/// This function applies a sign to the motive force as a function of the direction of the train.
24582455
/// </summary>
2459-
protected virtual void ApplyDirectionToTractiveForce(ref float tractiveForceN)
2456+
protected virtual void ApplyDirectionToTractiveForce()
24602457
{
24612458
if (Train.IsPlayerDriven)
24622459
{
24632460
switch (Direction)
24642461
{
24652462
case Direction.Forward:
2466-
//tractiveForceN *= 1; //Not necessary
2463+
//MotiveForceN *= 1; //Not necessary
24672464
break;
24682465
case Direction.Reverse:
2469-
tractiveForceN *= -1;
2466+
TractiveForceN *= -1;
24702467
break;
24712468
case Direction.N:
24722469
default:
2473-
tractiveForceN *= 0;
2470+
TractiveForceN *= 0;
24742471
break;
24752472
}
24762473
}
@@ -2479,7 +2476,7 @@ protected virtual void ApplyDirectionToTractiveForce(ref float tractiveForceN)
24792476
switch (Direction)
24802477
{
24812478
case Direction.Reverse:
2482-
tractiveForceN *= -1;
2479+
TractiveForceN *= -1;
24832480
break;
24842481
default:
24852482
break;

0 commit comments

Comments
 (0)