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

Skip to content
Snippets Groups Projects
Commit 71756f7a authored by Harald Martini's avatar Harald Martini
Browse files

added GetIdleController override for BEVs

parent dce7e0d2
No related branches found
No related tags found
No related merge requests found
......@@ -699,6 +699,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
var cycle = new DistanceBasedDrivingCycle(container, data.Cycle);
var powertrain = cycle
.AddComponent(new Driver(container, data.DriverData, new DefaultDriverStrategy(container)))
.AddComponent(new Vehicle(container, data.VehicleData, data.AirdragData))
......@@ -752,6 +753,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
new DummyEngineInfo(container);
if (data.BusAuxiliaries != null) {
if (!data.BusAuxiliaries.ElectricalUserInputsConfig.ConnectESToREESS) {
throw new VectoException("BusAux must be supplied from REESS!");
......@@ -777,9 +779,24 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
}
dcdc.Connect(elAux);
if (data.PTO != null)
{
cycle.IdleController = GetIdleController(data.PTO, em, container) as IdleControllerSwitcher;
if (cycle.IdleController == null)
{
throw new VectoException("Could not assign IdleController to cycle");
}
elAux.AddAuxiliary(new EPTO());
}
dcdc.Initialize();
}
return container;
}
......@@ -1439,6 +1456,12 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
? engine.IdleController
: new IdleControllerSwitcher(engine.IdleController, new PTOCycleController(container, pto.PTOCycle));
private static IIdleController GetIdleController(PTOData pto, IElectricMotor electricMotor,
IVehicleContainer container) =>
pto?.PTOCycle is null
? electricMotor.IdleController
: new IdleControllerSwitcher(electricMotor.IdleController, new PTOCycleController(container, pto.PTOCycle));
internal static IAuxInProvider CreateAdvancedAuxiliaries(VectoRunData data, IVehicleContainer container)
{
var conventionalAux = CreateAuxiliaries(data, container);
......
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