Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit c92f64e4 authored by Michael KRISPER's avatar Michael KRISPER
Browse files

Correction when searching for gears: If no gear is valid, take the gear with the highest speed

parent ad486028
No related branches found
No related tags found
No related merge requests found
......@@ -453,8 +453,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return best.Key;
}
var retVal = candidates.Where(x => x.Value < VoltageLevels.MaxSpeed).MaxBy(x => x.Value).Key;
return retVal;
if (candidates.Any(x => x.Value < VoltageLevels.MaxSpeed))
return candidates.Where(x => x.Value < VoltageLevels.MaxSpeed).MaxBy(x => x.Value).Key;
else {
return candidates.MaxBy(x => x.Value).Key;
}
}
protected virtual GearshiftPosition CheckEarlyDownshift(Second absTime, Second dt, NewtonMeter outTorque,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment