Skip to content

Commit

Permalink
Automatic merge of T1.5-rc2-82-g5a8a93652 and 13 pull requests
Browse files Browse the repository at this point in the history
- Pull request #630 at 704731a: Sky Color Fix (Addresses Trello Roadmap Card #367 for More accurate sunrise and sunset)
- Pull request #652 at 918fdb1: Add button functions to Raildriver
- Pull request #677 at c1c417f: Correct double heading bug
- Pull request #706 at 265d33d: Extended door functionality
- Pull request #713 at 65741c7: https://blueprints.launchpad.net/or/+spec/cruise-control 
- Pull request #719 at fd9e47a: Upgraded to MonoGame 3.8.0 (+ small update for other libraries)
- Pull request #722 at fb9079e: Fix Windows Forms deprecations in ActivityEditor
- Pull request #731 at f1348a4: fix: Log first error during Viewer mark-sweep clean-up
- Pull request #732 at efbc397: Improvements for air brakes
- Pull request #733 at 72947b0: Fixed battery switch sound being repeted
- Pull request #734 at 8f8484c: Fixed battery switch timer not working properly
- Pull request #736 at a845085: Replaced truncated brake token table with lists
- Pull request #737 at 96d12f1: Fixed brake controller script not being loaded in timetable mode
  • Loading branch information
openrails-bot committed Oct 25, 2022
15 parents 2653410 + 5a8a936 + 704731a + 918fdb1 + c1c417f + 265d33d + 65741c7 + fd9e47a + fb9079e + f1348a4 + efbc397 + 72947b0 + 8f8484c + a845085 + 96d12f1 commit d7639c0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ public float OdometerM
public float TrainBrakePipeLeakPSIorInHgpS = 0.0f; // Air leakage from train brake pipe - should normally be no more then 5psi/min - default off
public float CompressorRestartPressurePSI = 110;
public float CompressorChargingRateM3pS = 0.075f;
public bool CompressorIsMUControlled = false;
public float MainResChargingRatePSIpS = 0.4f;
public float EngineBrakeReleaseRatePSIpS = 12.5f;
public float EngineBrakeApplyRatePSIpS = 12.5f;
Expand Down Expand Up @@ -983,6 +984,7 @@ public override void Parse(string lowercasetoken, STFReader stf)
CompressorIsMechanical = true;
}
break;
case "engine(ortscompressorismucontrolled": CompressorIsMUControlled = stf.ReadBoolBlock(false); break;
case "engine(trainpipeleakrate": TrainBrakePipeLeakPSIorInHgpS = stf.ReadFloatBlock(STFReader.UNITS.PressureRateDefaultPSIpS, null); break;
case "engine(vacuumbrakesvacuumpumpresistance": VacuumPumpResistanceN = stf.ReadFloatBlock(STFReader.UNITS.Force, null); break;

Expand Down Expand Up @@ -1171,6 +1173,7 @@ public override void Copy(MSTSWagon copy)

CompressorIsMechanical = locoCopy.CompressorIsMechanical;
CompressorRestartPressurePSI = locoCopy.CompressorRestartPressurePSI;
CompressorIsMUControlled = locoCopy.CompressorIsMUControlled;
TrainBrakePipeLeakPSIorInHgpS = locoCopy.TrainBrakePipeLeakPSIorInHgpS;
MaxMainResPressurePSI = locoCopy.MaxMainResPressurePSI;
MainResPressurePSI = locoCopy.MaxMainResPressurePSI;
Expand Down Expand Up @@ -2661,9 +2664,20 @@ protected virtual void UpdateCompressor(float elapsedClockSeconds)

// Turn compressor on and off
if (MainResPressurePSI < CompressorRestartPressurePSI && LocomotivePowerSupply.AuxiliaryPowerSupplyState == PowerSupplyState.PowerOn && !CompressorIsOn)
{
SignalEvent(Event.CompressorOn);
foreach (var loco in Train.Cars.OfType<MSTSLocomotive>())
{
if (loco.RemoteControlGroup == 0 && loco.LocomotivePowerSupply.AuxiliaryPowerSupplyOn && !loco.CompressorIsOn && loco.CompressorIsMUControlled)
{
loco.SignalEvent(Event.CompressorOn);
}
}
}
else if ((MainResPressurePSI >= MaxMainResPressurePSI || LocomotivePowerSupply.AuxiliaryPowerSupplyState != PowerSupplyState.PowerOn) && CompressorIsOn)
{
SignalEvent(Event.CompressorOff);
}

if (CompressorIsOn)
MainResPressurePSI += elapsedClockSeconds * reservoirChargingRate;
Expand Down

0 comments on commit d7639c0

Please sign in to comment.