Skip to content

Commit

Permalink
Automatic merge of T1.4-44-gf92b5fa09 and 8 pull requests
Browse files Browse the repository at this point in the history
- Pull request #480 at 7815b89: Blueprint https://blueprints.launchpad.net/or/+spec/digital-alignment-in-3dcabs
- Pull request #510 at 906f067: Add performance monitoring for diesel mechanic locomotives and new parameters
- Pull request #519 at 94c4637: Website changes for Release v1.4
- Pull request #522 at 78c046c: Correct issue with tender water mass
- Pull request #525 at 41d74e4: Add SignalTypeName and DrawStateName to SignalFeatures
- Pull request #526 at 2bfe684: Bug fix for https://bugs.launchpad.net/or/+bug/1949292 AI train disappears after coupling and reversing
- Pull request #527 at c786144: Brake cuts power refactor and new parameters
- Pull request #528 at 212eba1: Updated link to Siskiyou Route site
  • Loading branch information
openrails-bot committed Nov 3, 2021
10 parents 23eeaf8 + f92b5fa + 7815b89 + 906f067 + 94c4637 + 78c046c + 41d74e4 + 2bfe684 + c786144 + 212eba1 commit 0e4ffb8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ public void Update(float elapsedClockSeconds)
}

// Simulate stalled engine if RpM decreases too far, by stopping engine
if (RealRPM < 0.9f * IdleRPM)
if (RealRPM < 0.9f * IdleRPM && State == DieselEngineState.Running)
{
Trace.TraceInformation("Diesel Engine has stalled");
HandleEvent(PowerSupplyEvent.StopEngine);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void Parse(string lowercasetoken, STFReader stf)
{
case "engine(gearboxnumberofgears": GearBoxNumberOfGears = stf.ReadIntBlock(1); initLevel++; break;
case "engine(gearboxdirectdrivegear": GearBoxDirectDriveGear = stf.ReadIntBlock(1); break; // initLevel++; break;
case "engine(ortsgearboxtype": GearBoxType = stf.ReadIntBlock(1); break; // default = 1
case "engine(ortsgearboxtype": GearBoxType = stf.ReadIntBlock(1); initLevel++; break; // default = 1
case "engine(gearboxoperation":
temp = stf.ReadStringBlock("manual");
switch (temp)
Expand All @@ -66,7 +66,6 @@ public void Parse(string lowercasetoken, STFReader stf)
case "all_gears": GearBoxEngineBraking = GearBoxEngineBraking.AllGears; break;
case "direct_drive": GearBoxEngineBraking = GearBoxEngineBraking.DirectDrive; break;
}
initLevel++;
break;
case "engine(gearboxmaxspeedforgears":
temp = stf.ReadItem();
Expand Down Expand Up @@ -329,7 +328,7 @@ public float ShaftRPM
return DieselEngine.RealRPM;
else
{
if (Gears[0].TypeGearBox == 1)
if (Gears[0].TypeGearBox == 1 || GearBoxOperation == GearBoxOperation.Automatic)
{
return CurrentSpeedMpS / CurrentGear.Ratio;
}
Expand Down Expand Up @@ -636,12 +635,12 @@ public void Update(float elapsedClockSeconds)
switch (GearBoxOperation)
{
case GearBoxOperation.Manual:
if (DieselEngine.GearBox.Gears[1].TypeGearBox == 1 && DieselEngine.Locomotive.ThrottlePercent == 0)
if (DieselEngine.GearBox.Gears[1].TypeGearBox == 1 && DieselEngine.Locomotive.ThrottlePercent == 0)
{
clutchOn = false;
ClutchPercent = 0f;
}
else if (DieselEngine.Locomotive.ThrottlePercent == 0)
else if (DieselEngine.Locomotive.ThrottlePercent == 0) // Type 2 and 3 gear boxes
{
clutchOn = false;
ClutchPercent = 0f;
Expand Down Expand Up @@ -689,6 +688,19 @@ public void Update(float elapsedClockSeconds)
break;
}
}
// If diesel engine is stopped (potentially after a stall) on a manual gearbox then allow gears to be changed
else if (DieselEngine.State == DieselEngineState.Stopped)
{
switch (GearBoxOperation)
{
case GearBoxOperation.Manual:
clutchOn = false;
ClutchPercent = 0f;
break;


}
}
else
{
nextGearIndex = -1;
Expand Down

0 comments on commit 0e4ffb8

Please sign in to comment.