diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategy.cs index 5773929f18fc1a9296c6bf8f2065e4de9b2a72cf..84585fab8fce943d575f3f721968ea78d494d8f8 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategy.cs @@ -140,10 +140,22 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl Log.Debug("engine speed would fall below idle speed - shift down"); return true; } - if (inAngularVelocity.IsGreater(DataBus.EngineRatedSpeed) && Data.Gears.ContainsKey(gear + 1)) { - NextGear.SetState(absTime, false, gear + 1, Data.Gears[gear + 1].HasLockedGear); + if (inAngularVelocity.IsGreaterOrEqual(DataBus.EngineRatedSpeed)) { Log.Debug("engine speed would be above rated speed - shift up"); - return true; + if (Data.Gears.ContainsKey(gear + 1) && (_gearbox.TorqueConverterLocked || Data.Gears[gear + 1].HasTorqueConverter)) { + // 1L -> 2C/L OR 1C -> 2C + NextGear.SetState(absTime, false, gear + 1, !Data.Gears[gear + 1].HasTorqueConverter); + return true; + } + if (Data.Gears[gear].HasLockedGear) { + // 1C -> 1L + NextGear.SetState(absTime, false, gear, true); + return true; + } + + // 1C -> ? + throw new VectoSimulationException( + "AngularVelocity is higher than EngineRatedSpeed, Current gear has active torque converter (1C) but no locked gear (no 1L) and shifting directly to 2L is not allowed."); } }