Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit db995d89 authored by Michael KRISPER's avatar Michael KRISPER
Browse files

PowertrainBuilder: Error Messages if Electric Motor count or GENset count is not correct

parent dec878aa
No related branches found
No related tags found
No related merge requests found
......@@ -417,6 +417,12 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
if (data.Cycle.CycleType != CycleType.DistanceBased) {
throw new VectoException("CycleType must be DistanceBased");
}
if (data.ElectricMachinesData.Any(x => x.Item1 == PowertrainPosition.GEN)) {
throw new VectoException("ParallelHybrid does not support GEN set.");
}
if (data.ElectricMachinesData.Count != 1) {
throw new VectoException("ParallelHybrid needs exactly one electric motor.");
}
var container = new VehicleContainer(data.ExecutionMode, _modData, _sumWriter) { RunData = data };
var es = new ElectricSystem(container);
......@@ -542,6 +548,12 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
if (data.Cycle.CycleType != CycleType.DistanceBased) {
throw new VectoException("CycleType must be DistanceBased");
}
if (data.ElectricMachinesData.Count(x => x.Item1 == PowertrainPosition.GEN) != 1) {
throw new VectoException("SerialHybrid needs exactly one GEN set.");
}
if (data.ElectricMachinesData.Count(x => x.Item1 != PowertrainPosition.GEN) != 1) {
throw new VectoException("SerialHybrid needs exactly one electric motor.");
}
var container = new VehicleContainer(data.ExecutionMode, _modData, _sumWriter) { RunData = data };
var es = new ElectricSystem(container);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment