Skip to content

Commit

Permalink
Automatic merge of X1.3.1-189-gab83b4ca9 and 10 pull requests
Browse files Browse the repository at this point in the history
- Pull request #40 at e81861b: Monogame upgrade
- Pull request #79 at 7d9f14b: Update version calculation for new unstable versions
- Pull request #216 at 927a49c: Upgrade and replace web server with EmbedIO
- Pull request #221 at 13ba17f: Refactor try-catch blocks in RunActivity
- Pull request #225 at bb67fb6: Fix advanced adhesion wheelslip upon resuming from save: https://bugs.launchpad.net/or/+bug/1294410
- Pull request #226 at e66ced3: EmbedIO web server graphical track monitor
- Pull request #227 at a67c6dd: EmbedIO web server graphical train driving monitor
- Pull request #228 at 56db49c: adds links to OR on Elvas Tower
- Pull request #229 at e2aba9e: Fix MSTS-compatible physics reverting to Davis physics: https://bugs.launchpad.net/or/+bug/1886566
- Pull request #231 at dc59a40: Add each gear positions sound events
  • Loading branch information
openrails-bot committed Jul 12, 2020
12 parents 02a300c + ab83b4c + e81861b + 7d9f14b + 927a49c + 13ba17f + bb67fb6 + e66ced3 + a67c6dd + 56db49c + e2aba9e + dc59a40 commit 5f1ed45
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 5 deletions.
6 changes: 6 additions & 0 deletions Source/Documentation/Manual/sound.rst
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,12 @@ Trigger Function
200 GearPosition0
201 GearPosition1
202 GearPosition2
203 GearPosition3
204 GearPosition4
205 GearPosition5
206 GearPosition6
207 GearPosition7
208 GearPosition8
========= =====================================

Variable Triggers
Expand Down
14 changes: 14 additions & 0 deletions Source/Orts.Simulation/Common/Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,14 @@ public enum Event
GearPosition0,
GearPosition1,
GearPosition2,
GearPosition3,
GearPosition4,
GearPosition5,
GearPosition6,
GearPosition7,
GearPosition8,


}

public static class Events
Expand Down Expand Up @@ -395,6 +403,12 @@ public static Event From(bool mstsBinEnabled, Source source, int eventID)
case 200: return Event.GearPosition0;
case 201: return Event.GearPosition1;
case 202: return Event.GearPosition2;
case 203: return Event.GearPosition3;
case 204: return Event.GearPosition4;
case 205: return Event.GearPosition5;
case 206: return Event.GearPosition6;
case 207: return Event.GearPosition7;
case 208: return Event.GearPosition8;

default: return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3103,9 +3103,27 @@ private void SignalGearBoxChangeEvents()
case 1:
SignalEvent(Event.GearPosition1);
break;
default:
case 2:
SignalEvent(Event.GearPosition2);
break;
case 3:
SignalEvent(Event.GearPosition3);
break;
case 4:
SignalEvent(Event.GearPosition4);
break;
case 5:
SignalEvent(Event.GearPosition5);
break;
case 6:
SignalEvent(Event.GearPosition6);
break;
case 7:
SignalEvent(Event.GearPosition7);
break;
default:
SignalEvent(Event.GearPosition8);
break;
}
PreviousGearBoxNotch = GearBoxController.CurrentNotch; // Update previous value for next time around
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5453,10 +5453,8 @@ private void UpdateFiring(float absSpeedMpS)
Injector1Fraction = 0.0f;
Injector2IsOn = false;
Injector2Fraction = 0.0f;
SignalEvent(Event.WaterInjector1Off);
SignalEvent(Event.WaterInjector2Off);
Injector1SoundIsOn = false;
Injector2SoundIsOn = false;
StopInjector1Sound();
StopInjector2Sound();
}
else if (WaterGlassLevelIN <= 7.0 && WaterGlassLevelIN > 6.875 && !InjectorLockedOut) // turn injector 1 on 20% if water level in boiler drops below 7.0
{
Expand Down Expand Up @@ -5702,6 +5700,31 @@ private void PlayInjector2SoundIfStarting()
}
}

/// <summary>
/// Turn off the injector 1 sound only when the injector stops.
/// </summary>
private void StopInjector1Sound()
{
if (Injector1SoundIsOn)
{
Injector1SoundIsOn = false;
SignalEvent(Event.WaterInjector1Off);
}
}

/// <summary>
/// Turn off the injector 2 sound only when the injector stops.
/// </summary>
private void StopInjector2Sound()
{
if (Injector2SoundIsOn)
{
Injector2SoundIsOn = false;
SignalEvent(Event.WaterInjector2Off);
}
}


protected override void UpdateCarSteamHeat(float elapsedClockSeconds)
{
// Update Steam Heating System
Expand Down

0 comments on commit 5f1ed45

Please sign in to comment.