Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 809eab92 authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

avoid trying to removing the same disabled gears over and over again (which...

avoid trying to removing the same disabled gears over and over again (which leads to an error because an already disabled gear cannot be disabled twice).
remove disabled gears on a clone of the gear  list provided by the input provider
parent 861501b0
No related branches found
No related tags found
No related merge requests found
......@@ -236,7 +236,8 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
retVal.Inertia = DeclarationData.Engine.EngineInertia(retVal.Displacement, gearbox.Type);
retVal.EngineStartTime = DeclarationData.Engine.DefaultEngineStartTime;
var limits = vehicle.TorqueLimits.ToDictionary(e => e.Gear);
var gears = FilterDisabledGears(gearbox.Gears, limits);
var gearsCopy = new List<ITransmissionInputData>(gearbox.Gears);
var gears = FilterDisabledGears(gearsCopy, limits);
var numGears = gears.Count;
var fullLoadCurves = new Dictionary<uint, EngineFullLoadCurve>(numGears + 1);
fullLoadCurves[0] = FullLoadCurveReader.Create(mode.FullLoadCurve, true);
......@@ -336,7 +337,8 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
}
var limits = inputData.TorqueLimits?.ToDictionary(e => e.Gear) ?? new Dictionary<int, ITorqueLimitInputData>();
var gearsInput = FilterDisabledGears(gearbox.Gears, limits);
var gearscopy = new List<ITransmissionInputData>(gearbox.Gears);
var gearsInput = FilterDisabledGears(gearscopy, limits);
if (gearsInput.Count < 1) {
throw new VectoSimulationException(
"At least one Gear-Entry must be defined in Gearbox!");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment