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

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

correcting powertrain builder: building simple parallel powertrain, connect...

correcting powertrain builder: building simple parallel powertrain, connect idle controller after powertrain is connected togehter
parent fd55cd6b
No related branches found
No related tags found
No related merge requests found
......@@ -470,6 +470,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
.AddAuxiliaries(container, data);
if (data.ElectricMachinesData.Any(x => x.Item1 == PowertrainPosition.HybridP1)) {
// this has to be done _after_ the powertrain is connected together so that the cluch already has its nextComponent set (necessary in the idle controlelr)
if (gearbox is ATGearbox atGbx) {
atGbx.IdleController = idleController;
} else {
......@@ -964,14 +965,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
var ctl = new SimpleHybridController(container, es) { Gearbox = gbx, Engine = engine };
var idleController = GetIdleController(data.PTO, engine, container);
var clutch = data.GearboxData.Type.ManualTransmission() ? new SwitchableClutch(container, data.EngineData) : null;
if (data.ElectricMachinesData.Any(x => x.Item1 == PowertrainPosition.HybridP1)) {
if (gearbox is ATGearbox atGbx) {
atGbx.IdleController = idleController;
new ATClutchInfo(container);
} else {
clutch.IdleController = idleController;
}
}
var vehicle = new Vehicle(container, data.VehicleData, data.AirdragData);
......@@ -1005,6 +999,16 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
.AddComponent(engine, idleController)
.AddAuxiliaries(container, data);
if (data.ElectricMachinesData.Any(x => x.Item1 == PowertrainPosition.HybridP1)) {
// this has to be done _after_ the powertrain is connected together so that the cluch already has its nextComponent set (necessary in the idle controlelr)
if (gearbox is ATGearbox atGbx) {
atGbx.IdleController = idleController;
new ATClutchInfo(container);
} else {
clutch.IdleController = idleController;
}
}
if (data.BusAuxiliaries != null) {
if (!(container.BusAux is BusAuxiliariesAdapter busAux)) {
throw new VectoException("BusAux data set but no BusAux component found!");
......
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