diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponent/DriverTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponent/DriverTest.cs index f23aaf6d3462214c715cf70fb32569bef4315cae..7d235449c6bf5903930b35e34683be6f9d7b01a8 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponent/DriverTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponent/DriverTest.cs @@ -51,6 +51,7 @@ using TUGraz.VectoCore.Tests.Utils; using Wheels = TUGraz.VectoCore.Models.SimulationComponent.Impl.Wheels; using NUnit.Framework; using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox; namespace TUGraz.VectoCore.Tests.Models.SimulationComponent { @@ -105,6 +106,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent clutch.IdleController = engine.IdleController; var gbx = new MockGearbox(vehicleContainer) { Gear = new GearshiftPosition(1) }; + var axlegear = new MockAxlegear(vehicleContainer); var driverPort = driver.OutPort(); @@ -170,8 +172,8 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent AddComponent(tmp, engine); clutch.IdleController = engine.IdleController; - var gbx = new MockGearbox(vehicleContainer); - gbx.Gear = new GearshiftPosition(1); + var gbx = new MockGearbox(vehicleContainer) { Gear = new GearshiftPosition(1) }; + var axleGear = new MockAxlegear(vehicleContainer); var driverPort = driver.OutPort(); @@ -244,8 +246,8 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent tmp = AddComponent(tmp, clutch); AddComponent(tmp, engine); - var gbx = new MockGearbox(vehicleContainer); - gbx.Gear = new GearshiftPosition(1); + var gbx = new MockGearbox(vehicleContainer) { Gear = new GearshiftPosition(1) }; + var axleGear = new MockAxlegear(vehicleContainer); var driverPort = driver.OutPort(); diff --git a/VectoCore/VectoCoreTest/Utils/MockGearbox.cs b/VectoCore/VectoCoreTest/Utils/MockGearbox.cs index f599e8d2221e059f27a431c14fc35780f4538926..eedfc96df31bd72c6168c381c1c2d998ab63aa64 100644 --- a/VectoCore/VectoCoreTest/Utils/MockGearbox.cs +++ b/VectoCore/VectoCoreTest/Utils/MockGearbox.cs @@ -35,6 +35,7 @@ using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Models.Connector.Ports; using TUGraz.VectoCore.Models.Simulation; using TUGraz.VectoCore.Models.Simulation.DataBus; +using TUGraz.VectoCore.Models.Simulation.Impl; using TUGraz.VectoCore.Models.SimulationComponent; using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox; using TUGraz.VectoCore.Models.SimulationComponent.Impl; @@ -108,7 +109,7 @@ namespace TUGraz.VectoCore.Tests.Utils public GearData GetGearData(uint gear) { - return new GearData(); + return new GearData() { Ratio = 1.0 }; } public void Connect(ITnOutPort other) @@ -175,4 +176,43 @@ namespace TUGraz.VectoCore.Tests.Utils throw new NotImplementedException(); } } + + public class MockAxlegear : VectoSimulationComponent, IAxlegear + { + public MockAxlegear(VehicleContainer vehicleContainer) : base(vehicleContainer) + { + + } + + public ITnInPort InPort() + { + throw new NotImplementedException(); + } + + public ITnOutPort OutPort() + { + throw new NotImplementedException(); + } + + public Watt AxlegearLoss() + { + throw new NotImplementedException(); + } + + public Tuple<PerSecond, NewtonMeter> CurrentAxleDemand { get; } + public double Ratio + { + get { return 1; } + } + + protected override void DoWriteModalResults(Second time, Second simulationInterval, IModalDataContainer container) + { + + } + + protected override void DoCommitSimulationStep(Second time, Second simulationInterval) + { + + } + } } \ No newline at end of file