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

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

PowertrainBuilder and GUI: Removed P0 in Dropdown and throw exception if P0 is defined in file.

parent 036ab56d
No related tags found
No related merge requests found
...@@ -122,7 +122,8 @@ Public Class VehicleForm ...@@ -122,7 +122,8 @@ Public Class VehicleForm
_changed = False _changed = False
cbEmPos.DataSource = EnumHelper.GetKeyValuePairs(Of PowertrainPosition)(Function(t) t.GetLabel(), cbEmPos.DataSource = EnumHelper.GetKeyValuePairs(Of PowertrainPosition)(Function(t) t.GetLabel(),
Function(x) x <> PowertrainPosition.GEN) Function(x) x <> PowertrainPosition.GEN _
AndAlso x <> PowertrainPosition.HybridP0)
NewVehicle() NewVehicle()
End Sub End Sub
......
...@@ -72,14 +72,20 @@ namespace TUGraz.VectoCommon.InputData ...@@ -72,14 +72,20 @@ namespace TUGraz.VectoCommon.InputData
public static bool IsBatteryElectric(this PowertrainPosition pos) public static bool IsBatteryElectric(this PowertrainPosition pos)
{ {
return pos == PowertrainPosition.BatteryElectricE2 || pos == PowertrainPosition.BatteryElectricE3 || switch (pos) {
pos == PowertrainPosition.BatteryElectricE4; case PowertrainPosition.BatteryElectricE2:
case PowertrainPosition.BatteryElectricE3:
case PowertrainPosition.BatteryElectricE4:
return true;
default:
return false;
}
} }
public static bool IsParallelHybrid(this PowertrainPosition pos) public static bool IsParallelHybrid(this PowertrainPosition pos)
{ {
switch (pos) { switch (pos) {
case PowertrainPosition.HybridP0: //case PowertrainPosition.HybridP0: // special case, currently not considered in VECTO
case PowertrainPosition.HybridP1: case PowertrainPosition.HybridP1:
case PowertrainPosition.HybridP2: case PowertrainPosition.HybridP2:
case PowertrainPosition.HybridP2_5: case PowertrainPosition.HybridP2_5:
......
...@@ -235,6 +235,10 @@ namespace TUGraz.VectoCore.Models.Simulation.Data ...@@ -235,6 +235,10 @@ namespace TUGraz.VectoCore.Models.Simulation.Data
} }
} }
if (runData.ElectricMachinesData?.Any(e => e.Item1 == PowertrainPosition.HybridP0) ?? false){
return new ValidationResult("PowertrainPosition P0 is currently not supported.");
}
return ValidationResult.Success; return ValidationResult.Success;
} }
......
...@@ -412,6 +412,9 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl ...@@ -412,6 +412,9 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
if (data.ElectricMachinesData.Count != 1) { if (data.ElectricMachinesData.Count != 1) {
throw new VectoException("ParallelHybrid needs exactly one electric motor."); throw new VectoException("ParallelHybrid needs exactly one electric motor.");
} }
if (data.ElectricMachinesData.Any(e => e.Item1 == PowertrainPosition.HybridP0)) {
throw new VectoException("PowertrainPosition P0 is currently not supported.");
}
var container = new VehicleContainer(data.ExecutionMode, _modData, _sumWriter) { RunData = data }; var container = new VehicleContainer(data.ExecutionMode, _modData, _sumWriter) { RunData = data };
var es = ConnectREESS(data, container); var es = ConnectREESS(data, container);
...@@ -665,7 +668,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl ...@@ -665,7 +668,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
if (data.ElectricMachinesData.Count != 1) { if (data.ElectricMachinesData.Count != 1) {
throw new VectoException("Battery electric vehicle needs exactly one electric motor."); throw new VectoException("Battery electric vehicle needs exactly one electric motor.");
} }
var container = new VehicleContainer(data.ExecutionMode, _modData, _sumWriter) { RunData = data }; var container = new VehicleContainer(data.ExecutionMode, _modData, _sumWriter) { RunData = data };
var es = ConnectREESS(data, container); var es = ConnectREESS(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