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

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

Removed Special Retarder for BEV and added checks in BEV if retarder is not set.

parent 90410a92
No related branches found
No related tags found
No related merge requests found
......@@ -67,12 +67,23 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
public virtual RetarderType Type
{
get {
var retarderType = Body.GetEx(JsonKeys.Vehicle_Retarder).GetEx<string>(JsonKeys.Vehicle_Retarder_Type);
return RetarderTypeHelper.Parse(retarderType);
if (Body[JsonKeys.Vehicle_Retarder] != null) {
var retarderType = Body.GetEx(JsonKeys.Vehicle_Retarder).GetEx<string>(JsonKeys.Vehicle_Retarder_Type);
return RetarderTypeHelper.Parse(retarderType);
}
return RetarderType.None;
}
}
public virtual double Ratio => Body.GetEx(JsonKeys.Vehicle_Retarder).GetEx<double>(JsonKeys.Vehicle_Retarder_Ratio);
public virtual double Ratio
{
get {
if (Body[JsonKeys.Vehicle_Retarder] != null) {
return Body.GetEx(JsonKeys.Vehicle_Retarder).GetEx<double>(JsonKeys.Vehicle_Retarder_Ratio);
}
return 1;
}
}
public virtual TableData LossMap
{
......@@ -96,7 +107,6 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
DataSourceType.Missing);
}
}
return null;
}
}
......@@ -106,32 +116,6 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
}
internal class JSONRetarderInputDataBEV : JSONRetarderInputData
{
public JSONRetarderInputDataBEV(JSONVehicleDataV7 vehicle) : base(vehicle) { }
public override RetarderType Type
{
get {
if (Base.VehicleType == VectoSimulationJobType.BatteryElectricVehicle) {
return RetarderType.None;
}
return base.Type;
}
}
public override double Ratio
{
get {
if (Base.VehicleType == VectoSimulationJobType.BatteryElectricVehicle) {
return 0.0;
}
return base.Ratio;
}
}
}
// ###################################################################
// ###################################################################
......
......@@ -60,7 +60,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
public override double InitialSOC => Body.GetEx<double>("InitialSoC") / 100.0;
protected override IRetarderInputData GetRetarder => _retarderInputData ?? (_retarderInputData = new JSONRetarderInputDataBEV(this));
protected override IRetarderInputData GetRetarder => _retarderInputData ?? (_retarderInputData = new JSONRetarderInputData(this));
protected override IElectricMachinesEngineeringInputData GetElectricMachines()
{
......
......@@ -99,9 +99,9 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
var retarder = new RetarderData { Type = data.Type };
switch (retarder.Type) {
//case RetarderType.EngineRetarder:
case RetarderType.TransmissionInputRetarder:
case RetarderType.TransmissionOutputRetarder:
case RetarderType.AxlegearInputRetarder:
retarder.LossMap = RetarderLossMapReader.Create(data.LossMap);
retarder.Ratio = data.Ratio;
break;
......@@ -111,8 +111,6 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
retarder.Ratio = 1;
break;
default:
// ReSharper disable once NotResolvedInText
// ReSharper disable once LocalizableElement
throw new ArgumentOutOfRangeException("retarder", retarder.Type, "RetarderType unknown");
}
......
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