From f13ef32463fc45202ab5d5721d967fdbd8e7107c Mon Sep 17 00:00:00 2001 From: Markus Quaritsch <markus.quaritsch@tugraz.at> Date: Mon, 16 Mar 2015 16:20:18 +0100 Subject: [PATCH] adding vehicle container with all simulation components and cockpit elements --- VectoCore/Models/Simulation/Cockpit/IEngineCockpit.cs | 2 +- VectoCore/Models/Simulation/Cockpit/IGearboxCockpit.cs | 2 +- VectoCore/Models/Simulation/Cockpit/IVehicleCockpit.cs | 2 +- VectoCore/Models/Simulation/IVehicleContainer.cs | 6 +----- VectoCore/Models/Simulation/Impl/VehicleContainer.cs | 2 +- .../Models/SimulationComponent/VectoSimulationComponent.cs | 2 +- VectoCore/VectoCore.csproj | 1 - 7 files changed, 6 insertions(+), 11 deletions(-) diff --git a/VectoCore/Models/Simulation/Cockpit/IEngineCockpit.cs b/VectoCore/Models/Simulation/Cockpit/IEngineCockpit.cs index 69f79efc64..1095e3123e 100644 --- a/VectoCore/Models/Simulation/Cockpit/IEngineCockpit.cs +++ b/VectoCore/Models/Simulation/Cockpit/IEngineCockpit.cs @@ -1,6 +1,6 @@ namespace TUGraz.VectoCore.Models.Simulation.Cockpit { - public interface IEngineCockpit : ICockpitComponent + public interface IEngineCockpit { double EngineSpeed(); } diff --git a/VectoCore/Models/Simulation/Cockpit/IGearboxCockpit.cs b/VectoCore/Models/Simulation/Cockpit/IGearboxCockpit.cs index 8def855cd4..da5f8711c2 100644 --- a/VectoCore/Models/Simulation/Cockpit/IGearboxCockpit.cs +++ b/VectoCore/Models/Simulation/Cockpit/IGearboxCockpit.cs @@ -1,6 +1,6 @@ namespace TUGraz.VectoCore.Models.Simulation.Cockpit { - public interface IGearboxCockpit : ICockpitComponent + public interface IGearboxCockpit { int Gear(); } diff --git a/VectoCore/Models/Simulation/Cockpit/IVehicleCockpit.cs b/VectoCore/Models/Simulation/Cockpit/IVehicleCockpit.cs index 71a2f85bfb..220847c5b4 100644 --- a/VectoCore/Models/Simulation/Cockpit/IVehicleCockpit.cs +++ b/VectoCore/Models/Simulation/Cockpit/IVehicleCockpit.cs @@ -1,6 +1,6 @@ namespace TUGraz.VectoCore.Models.Simulation.Cockpit { - public interface IVehicleCockpit : ICockpitComponent + public interface IVehicleCockpit { double VehicleSpeed(); } diff --git a/VectoCore/Models/Simulation/IVehicleContainer.cs b/VectoCore/Models/Simulation/IVehicleContainer.cs index 6444b94e45..58f827591a 100644 --- a/VectoCore/Models/Simulation/IVehicleContainer.cs +++ b/VectoCore/Models/Simulation/IVehicleContainer.cs @@ -5,11 +5,7 @@ namespace TUGraz.VectoCore.Models.Simulation { public interface IVehicleContainer : ICockpit { - void AddComponent<T>(T component) where T : VectoSimulationComponent, ICockpitComponent; - - //void AddComponent<T>(T component) where T : VectoSimulationComponent, IEngineCockpit; - - //void AddComponent<T>(T component) where T : VectoSimulationComponent, IGearboxCockpit; + void AddComponent(VectoSimulationComponent component); } } \ No newline at end of file diff --git a/VectoCore/Models/Simulation/Impl/VehicleContainer.cs b/VectoCore/Models/Simulation/Impl/VehicleContainer.cs index 00039ec93f..535aa6f156 100644 --- a/VectoCore/Models/Simulation/Impl/VehicleContainer.cs +++ b/VectoCore/Models/Simulation/Impl/VehicleContainer.cs @@ -15,7 +15,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl private IEngineCockpit _engine = null; private IGearboxCockpit _gearbox = null; - public virtual void AddComponent<T>(T component) where T : VectoSimulationComponent, ICockpitComponent + public virtual void AddComponent(VectoSimulationComponent component) { DoAddComponent(component); // TODO: refactor the following to use polymorphism? diff --git a/VectoCore/Models/SimulationComponent/VectoSimulationComponent.cs b/VectoCore/Models/SimulationComponent/VectoSimulationComponent.cs index 0ca9859a8d..a276fae477 100644 --- a/VectoCore/Models/SimulationComponent/VectoSimulationComponent.cs +++ b/VectoCore/Models/SimulationComponent/VectoSimulationComponent.cs @@ -5,7 +5,7 @@ using TUGraz.VectoCore.Models.Simulation.Data; namespace TUGraz.VectoCore.Models.SimulationComponent { - public abstract class VectoSimulationComponent : ICockpitComponent + public abstract class VectoSimulationComponent { protected ICockpit Cockpit; diff --git a/VectoCore/VectoCore.csproj b/VectoCore/VectoCore.csproj index c169ad23a9..fee6ae6194 100644 --- a/VectoCore/VectoCore.csproj +++ b/VectoCore/VectoCore.csproj @@ -80,7 +80,6 @@ <Compile Include="Models\Connector\Ports\IOutPort.cs" /> <Compile Include="Models\SimulationComponent\IWheels.cs" /> <Compile Include="Models\SimulationComponent\VectoSimulationComponent.cs" /> - <Compile Include="Models\Simulation\Cockpit\ICockpitComponent.cs" /> <Compile Include="Models\Simulation\Data\EngineOnlyDrivingCycle.cs" /> <Compile Include="Models\Simulation\Data\IModalDataWriter.cs" /> <Compile Include="Models\Simulation\Data\ModalResult.cs"> -- GitLab