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

Skip to content
Snippets Groups Projects
Commit 33b0ac47 authored by Franz KOBER josef's avatar Franz KOBER josef
Browse files

remove unnecessary helper classes

parent c81d29c4
No related branches found
No related tags found
No related merge requests found
......@@ -1137,56 +1137,12 @@ namespace TUGraz.VectoCommon.InputData
RM
}
public static class ElectricMachineTypeHelper
{
public static ElectricMachineType Parse(string parse)
{
switch (parse) {
case nameof(ElectricMachineType.ASM):
return ElectricMachineType.ASM;
case nameof(ElectricMachineType.ESM):
return ElectricMachineType.ESM;
case nameof(ElectricMachineType.PSM):
return ElectricMachineType.PSM;
case nameof(ElectricMachineType.RM):
return ElectricMachineType.RM;
default:
throw new ArgumentOutOfRangeException();
}
}
public static string GetLabel(this ElectricMachineType type)
{
return nameof(type);
}
}
public enum BatteryType
{
HPBS,
HEBS
}
public static class BatteryTypeHelper
{
public static BatteryType Parse(string parse)
{
switch (parse) {
case nameof(BatteryType.HPBS):
return BatteryType.HPBS;
case nameof(BatteryType.HEBS):
return BatteryType.HEBS;
default:
throw new ArgumentOutOfRangeException();
}
}
public static string GetLabel(this BatteryType type)
{
return nameof(type);
}
}
public enum ArchitectureID
{
E2,
......
......@@ -52,8 +52,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
#region Implementation of IPowerRatingInputData
public virtual ElectricMachineType ElectricMachineType =>
ElectricMachineTypeHelper.Parse(GetString(XMLNames.ElectricMachine_ElectricMachineType));
public virtual ElectricMachineType ElectricMachineType =>
GetString(XMLNames.ElectricMachine_ElectricMachineType).ParseEnum<ElectricMachineType>();
public virtual Watt R85RatedPower =>
GetDouble(XMLNames.ElectricMachine_R85RatedPower).SI<Watt>();
......
......@@ -25,8 +25,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
}
#region Implementation of IPowerRatingInputData
public virtual ElectricMachineType ElectricMachineType =>
ElectricMachineTypeHelper.Parse(GetString(XMLNames.ElectricMachine_ElectricMachineType));
public virtual ElectricMachineType ElectricMachineType =>
GetString(XMLNames.ElectricMachine_ElectricMachineType).ParseEnum<ElectricMachineType>();
public virtual Watt R85RatedPower =>
GetDouble(XMLNames.ElectricMachine_R85RatedPower).SI<Watt>();
......
......@@ -111,7 +111,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
public virtual double? MaxSOC =>
ElementExists(XMLNames.Battery_SOCmax) ? GetDouble(XMLNames.Battery_SOCmax) : (double?)null;
public virtual BatteryType BatteryType => BatteryTypeHelper.Parse(GetString(XMLNames.REESS_BatteryType));
public virtual BatteryType BatteryType => GetString(XMLNames.REESS_BatteryType).ParseEnum<BatteryType>();
public virtual AmpereSecond Capacity => GetDouble(XMLNames.REESS_RatedCapacity).SI<AmpereSecond>() * 3600;
public virtual bool ConnectorsSubsystemsIncluded => GetBool(XMLNames.REESS_ConnectorsSubsystemsIncluded);
public virtual bool JunctionboxIncluded => GetBool(XMLNames.REESS_JunctionboxIncluded);
......
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