Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 3ebefe8b authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

fix testcase after driver refacoring (max speed calculation)

parent b878194d
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment