From 6369dac1d29a2cdeaaddbc15e5826e7fbc885e3c Mon Sep 17 00:00:00 2001 From: Markus Quaritsch <markus.quaritsch@tugraz.at> Date: Wed, 23 Jan 2019 15:30:42 +0100 Subject: [PATCH] fix: min gear for shifting during coasting or braking set to 1 --- .../Models/SimulationComponent/Impl/AMTShiftStrategyV2.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategyV2.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategyV2.cs index cebddf9124..c6e03415d2 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategyV2.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategyV2.cs @@ -460,7 +460,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl : CalcPredictionVelocity(currentVelocity, estimatedVelocityPostShift); if (inAngularVelocity < GetEngineSpeedLimitLow(false)) { - for (var i = Math.Max(0, gear - ShiftStrategyParameters.AllowedGearRangeDown); + for (var i = Math.Max(1, gear - ShiftStrategyParameters.AllowedGearRangeDown); i <= Math.Min(ModelData.Gears.Count, gear + ShiftStrategyParameters.AllowedGearRangeUp); i++) { var nextGear = (uint)i; @@ -476,7 +476,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl if (inAngularVelocity >= upperEngineSpeedLimit) { for (var i = Math.Min(ModelData.Gears.Count, gear + ShiftStrategyParameters.AllowedGearRangeUp); - i >= Math.Max(0, gear + ShiftStrategyParameters.AllowedGearRangeDown); + i >= Math.Max(1, gear + ShiftStrategyParameters.AllowedGearRangeDown); i--) { var nextGear = (uint)i; TestContainer.GearboxCtl.Gear = nextGear; -- GitLab