Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e16930c

Browse files
committed
Automatic merge of T1.5.1-495-g55f992dcd and 11 pull requests
- Pull request #570 at 7269d24: Experimental glTF 2.0 support with PBR lighting - Pull request #757 at 98dd1a7: Unify RailDriver code implementations - Pull request #799 at dc03850: Consolidated wind simulation - Pull request #821 at cc3af66: Adds suppression of safety valves - Pull request #829 at 434af02: Improvements for air brakes #3 - Emergency valves - Pull request #831 at 19dc744: poor mans switch panel on tablet - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #842 at abe7adf: Set up ability for steam locomotives to have multiple engines - Pull request #846 at 98f1c45: Initialize cars before restore - Pull request #849 at 0d4e3da: Contributed projects and forking clarity - Pull request #850 at 1605667: Correct output of sound system info
13 parents 8b5298b + 55f992d + 7269d24 + 98dd1a7 + dc03850 + cc3af66 + 434af02 + 19dc744 + d00beb9 + abe7adf + 98f1c45 + 0d4e3da + 1605667 commit e16930c

File tree

18 files changed

+2394
-1073
lines changed

18 files changed

+2394
-1073
lines changed

Source/ORTS.Common/Input/UserCommand.cs

Lines changed: 221 additions & 219 deletions
Large diffs are not rendered by default.

Source/ORTS.Settings/InputSettings.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,8 @@ static void InitializeCommands(UserCommandInput[] Commands)
355355
Commands[(int)UserCommand.ControlBlowerIncrease] = new UserCommandKeyInput(0x31);
356356
Commands[(int)UserCommand.ControlSteamHeatDecrease] = new UserCommandKeyInput(0x20, KeyModifiers.Alt);
357357
Commands[(int)UserCommand.ControlSteamHeatIncrease] = new UserCommandKeyInput(0x16, KeyModifiers.Alt);
358+
Commands[(int)UserCommand.ControlSteamBoosterDecrease] = new UserCommandKeyInput(0x11, KeyModifiers.Shift);
359+
Commands[(int)UserCommand.ControlSteamBoosterIncrease] = new UserCommandKeyInput(0x11, KeyModifiers.Control);
358360
Commands[(int)UserCommand.ControlBrakeHoseConnect] = new UserCommandKeyInput(0x2B);
359361
Commands[(int)UserCommand.ControlBrakeHoseDisconnect] = new UserCommandKeyInput(0x2B, KeyModifiers.Shift);
360362
Commands[(int)UserCommand.ControlCabRadio] = new UserCommandKeyInput(0x13, KeyModifiers.Alt);

Source/Orts.Formats.Msts/CabViewFile.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ public enum CABViewControlTypes
130130
DAMPERS_FRONT,
131131
DAMPERS_BACK,
132132
STEAM_HEAT,
133+
STEAM_BOOSTER,
133134
WATER_INJECTOR1,
134135
WATER_INJECTOR2,
135136
SMALL_EJECTOR,

Source/Orts.Simulation/Common/Commands.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,6 +1532,29 @@ public override void Redo()
15321532

15331533

15341534
// Steam controls
1535+
// Steam booster command
1536+
[Serializable()]
1537+
public sealed class ContinuousSteamBoosterCommand : ContinuousCommand
1538+
{
1539+
public static MSTSSteamLocomotive Receiver { get; set; }
1540+
1541+
public ContinuousSteamBoosterCommand(CommandLog log, int injector, bool toState, float? target, double startTime)
1542+
: base(log, toState, target, startTime)
1543+
{
1544+
Redo();
1545+
}
1546+
1547+
public override void Redo()
1548+
{
1549+
if (Receiver == null) return;
1550+
{
1551+
Receiver.SteamBoosterChangeTo(ToState, Target);
1552+
}
1553+
// Report();
1554+
}
1555+
}
1556+
1557+
// Steam heat command
15351558
[Serializable()]
15361559
public sealed class ContinuousSteamHeatCommand : ContinuousCommand
15371560
{

Source/Orts.Simulation/Common/Events.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ public enum Event
268268

269269
MPCChangePosition,
270270

271+
SteamBoosterChange,
272+
271273
}
272274

273275
public static class Events
@@ -537,6 +539,8 @@ public static Event From(Source source, int eventID)
537539

538540
case 310: return Event.MPCChangePosition;
539541

542+
case 320: return Event.SteamBoosterChange;
543+
540544
default: return 0;
541545
}
542546
case Source.MSTSCrossing:

Source/Orts.Simulation/Simulation/Confirmer.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public enum CabControl {
6666
, FiringIsManual
6767
, FireShovelfull
6868
, CylinderCocks
69+
, SteamBooster
6970
, CylinderCompound
7071
, LargeEjector
7172
, SmallEjector
@@ -213,7 +214,8 @@ public Confirmer(Simulator simulator, double defaultDurationS)
213214
, new string [] { GetString("Firing Rate"), null, null, null, GetString("decrease"), GetString("increase") }
214215
, new string [] { GetString("Manual Firing"), GetString("off"), null, GetString("on") }
215216
, new string [] { GetString("Fire"), null, null, GetString("add shovel-full") }
216-
, new string [] { GetString("Cylinder Cocks"), GetString("close"), null, GetString("open") }
217+
, new string [] { GetString("Cylinder Cocks"), GetString("close"), null, GetString("open") }
218+
, new string [] { GetString("SteamBooster"), null, null, null, GetString("decrease"), GetString("increase") }
217219
, new string [] { GetString("Cylinder Compound"), GetString("close"), null, GetString("open") }
218220
, new string [] { GetString("LargeEjector"), null, null, null, GetString("decrease"), GetString("increase") }
219221
, 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 numberofengines)
229229
{
230230
}
231231

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ protected override void UpdateControllers(float elapsedClockSeconds)
615615
/// <summary>
616616
/// This function updates periodically the locomotive's motive force.
617617
/// </summary>
618-
protected override void UpdateTractiveForce(float elapsedClockSeconds, float t, float AbsSpeedMpS, float AbsWheelSpeedMpS)
618+
protected override void UpdateTractiveForce(float elapsedClockSeconds, float t, float AbsSpeedMpS, float AbsWheelSpeedMpS, int numberofengines)
619619
{
620620
// This section calculates the motive force of the locomotive as follows:
621621
// Basic configuration (no TF table) - uses P = F /speed relationship - requires power and force parameters to be set in the ENG file.
@@ -751,7 +751,7 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float t,
751751
DieselEngines.HandleEvent(PowerSupplyEvent.StopEngine);
752752
}
753753

754-
ApplyDirectionToTractiveForce();
754+
ApplyDirectionToTractiveForce(ref TractiveForceN);
755755

756756
// Calculate the total tractive force for the locomotive - ie Traction + Dynamic Braking force.
757757
// 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: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ public enum SlipControlType
222222
public SlipControlType SlipControlSystem;
223223
float BaseFrictionCoefficientFactor; // Factor used to adjust Curtius formula depending upon weather conditions
224224
float SlipFrictionCoefficientFactor;
225-
public float SteamStaticWheelForce;
226225
public float SteamTangentialWheelForce;
227226
public float SteamDrvWheelWeightLbs; // Weight on each drive axle
228227
public float PreviousThrottleSetting = 0.0f; // Holds the value of the previous throttle setting for calculating the correct antislip speed
@@ -1978,8 +1977,11 @@ public override void Update(float elapsedClockSeconds)
19781977
// Cruise Control
19791978
CruiseControl?.Update(elapsedClockSeconds);
19801979

1980+
if (EngineType == EngineTypes.Diesel || EngineType == EngineTypes.Electric)
1981+
{
19811982
// TODO this is a wild simplification for electric and diesel electric
1982-
UpdateTractiveForce(elapsedClockSeconds, ThrottlePercent / 100f, AbsSpeedMpS, AbsWheelSpeedMpS);
1983+
UpdateTractiveForce(elapsedClockSeconds, ThrottlePercent / 100f, AbsSpeedMpS, AbsWheelSpeedMpS, 0);
1984+
}
19831985

19841986
foreach (MultiPositionController mpc in MultiPositionControllers)
19851987
{
@@ -2043,7 +2045,7 @@ public override void Update(float elapsedClockSeconds)
20432045
DynamicBrakeController.CurrentValue * 100);
20442046
}
20452047

2046-
// SimpleControlPhysics and if locomotive is a control car advanced adhesion will be "disabled".
2048+
// Test to see whether to use SimpleControlPhysics, if locomotive is a control car advanced adhesion will be "disabled" as it has no drive wheels?
20472049
if (Simulator.UseAdvancedAdhesion && !Simulator.Settings.SimpleControlPhysics && EngineType != EngineTypes.Control)
20482050
{
20492051
AdvancedAdhesion(elapsedClockSeconds); // Use advanced adhesion model
@@ -2340,7 +2342,7 @@ protected virtual void UpdateControllers(float elapsedClockSeconds)
23402342
/// <summary>
23412343
/// This function updates periodically the locomotive's motive force.
23422344
/// </summary>
2343-
protected virtual void UpdateTractiveForce(float elapsedClockSeconds, float t, float AbsSpeedMpS, float AbsWheelSpeedMpS)
2345+
protected virtual void UpdateTractiveForce(float elapsedClockSeconds, float t, float AbsSpeedMpS, float AbsWheelSpeedMpS, int numberofengine)
23442346
{
23452347
// Method to set force and power info
23462348
// An alternative method in the steam locomotive will override this and input force and power info for it.
@@ -2406,7 +2408,7 @@ protected virtual void UpdateTractiveForce(float elapsedClockSeconds, float t, f
24062408
AverageForceN = w * AverageForceN + (1 - w) * TractiveForceN;
24072409
}
24082410

2409-
ApplyDirectionToTractiveForce();
2411+
ApplyDirectionToTractiveForce(ref TractiveForceN);
24102412

24112413
// Calculate the total tractive force for the locomotive - ie Traction + Dynamic Braking force.
24122414
// Note typically only one of the above will only ever be non-zero at the one time.
@@ -2461,21 +2463,21 @@ protected virtual void UpdateAxleDriveForce()
24612463
/// <summary>
24622464
/// This function applies a sign to the motive force as a function of the direction of the train.
24632465
/// </summary>
2464-
protected virtual void ApplyDirectionToTractiveForce()
2466+
protected virtual void ApplyDirectionToTractiveForce(ref float tractiveForceN)
24652467
{
24662468
if (Train.IsPlayerDriven)
24672469
{
24682470
switch (Direction)
24692471
{
24702472
case Direction.Forward:
2471-
//MotiveForceN *= 1; //Not necessary
2473+
//tractiveForceN *= 1; //Not necessary
24722474
break;
24732475
case Direction.Reverse:
2474-
TractiveForceN *= -1;
2476+
tractiveForceN *= -1;
24752477
break;
24762478
case Direction.N:
24772479
default:
2478-
TractiveForceN *= 0;
2480+
tractiveForceN *= 0;
24792481
break;
24802482
}
24812483
}
@@ -2484,7 +2486,7 @@ protected virtual void ApplyDirectionToTractiveForce()
24842486
switch (Direction)
24852487
{
24862488
case Direction.Reverse:
2487-
TractiveForceN *= -1;
2489+
tractiveForceN *= -1;
24882490
break;
24892491
default:
24902492
break;

0 commit comments

Comments
 (0)