From c35fccef4219dfec6af7e4a16475800c807e7313 Mon Sep 17 00:00:00 2001 From: Stefanos Doumpoulakis <dubulak@gmail.com> Date: Fri, 24 Feb 2023 13:05:12 +0200 Subject: [PATCH] commited forgotten fix for gear property in hybrid strategy --- .../Strategies/HybridStrategy.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs index 677e5c904c..15ddb06778 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs @@ -45,14 +45,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies protected override IResponse RequestDryRun(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, GearshiftPosition nextGear, HybridStrategyResponse cfg) { - if (DataBus.VehicleInfo.VehicleStopped) { - TestPowertrain.Gearbox.Gear = Controller.ShiftStrategy.NextGear; - } - else if (PreviousState.GearboxEngaged) { - TestPowertrain.Gearbox.Gear = DataBus.GearboxInfo.Gear; - } else { - TestPowertrain.Gearbox.Gear = Controller.ShiftStrategy.NextGear; - } + TestPowertrain.Gearbox.Gear = (DataBus.VehicleInfo.VehicleStopped) + ? NextGear + : (PreviousState.GearboxEngaged) + ? CurrentGear + : NextGear; TestPowertrain.Gearbox.Disengaged = !nextGear.Engaged; TestPowertrain.Gearbox.DisengageGearbox = !nextGear.Engaged; -- GitLab