From a2f674ca3dfafbd992d89269b74fb1cbfc32687f Mon Sep 17 00:00:00 2001 From: Markus Quaritsch <markus.quaritsch@tugraz.at> Date: Tue, 20 Dec 2016 13:07:10 +0100 Subject: [PATCH] adding constructor to gearinfo class --- .../SimulationComponent/IShiftStrategy.cs | 18 +++++++++++------- .../Impl/AMTShiftStrategy.cs | 2 +- .../Impl/ATShiftStrategy.cs | 2 +- .../SimulationComponent/Impl/CycleGearbox.cs | 5 +---- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/VectoCore/VectoCore/Models/SimulationComponent/IShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/IShiftStrategy.cs index 3257c65fce..4a30d7ac06 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/IShiftStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/IShiftStrategy.cs @@ -90,14 +90,18 @@ namespace TUGraz.VectoCore.Models.SimulationComponent /// </value> IGearbox Gearbox { get; set; } - GearInfo NextGear { get; } + GearInfo NextGear { get; } + } + public class GearInfo + { + public GearInfo(uint gear, bool tcLocked) + { + Gear = gear; + TorqueConverterLocked = tcLocked; + } + public uint Gear { get; private set; } + public bool TorqueConverterLocked { get; private set; } } - - public class GearInfo - { - public uint Gear; - public bool TorqueConverterLocked; - } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs index cde52fe32b..eba3292474 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs @@ -63,7 +63,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public override GearInfo NextGear { - get { return new GearInfo(){Gear = _nextGear, TorqueConverterLocked = false}; } + get { return new GearInfo( _nextGear, false); } } public override uint Engage(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity) diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategy.cs index 2450592d07..300c7d773e 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategy.cs @@ -285,7 +285,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public GearInfo NextGear { - get { return new GearInfo() { Gear = _nextGear.Gear, TorqueConverterLocked = _nextGear.TorqueConverterLocked }; } + get { return new GearInfo(_nextGear.Gear, _nextGear.TorqueConverterLocked ); } } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs index 1f04871d93..514a67e4cc 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs @@ -366,10 +366,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl { get { - return new GearInfo() { - Gear = DataBus.CycleData.RightSample.Gear, - TorqueConverterLocked = !DataBus.CycleData.RightSample.TorqueConverterActive ?? true - }; + return new GearInfo(DataBus.CycleData.RightSample.Gear, !DataBus.CycleData.RightSample.TorqueConverterActive ?? true); } } -- GitLab