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 faef01e5 authored by Michael KRISPER's avatar Michael KRISPER
Browse files

added missing AuxiliaryTypeHelper

parent 01f7241a
Branches
Tags
No related merge requests found
using System;
using System.Collections.Generic;
using System.Linq;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCore.Configuration;
namespace TUGraz.VectoCore.Models.Declaration
{
public static class AuxiliaryTypeHelper
{
private static readonly Dictionary<AuxiliaryType, string> AuxToStr = new Dictionary<AuxiliaryType, string> {
{ AuxiliaryType.Fan, Constants.Auxiliaries.Names.Fan },
{ AuxiliaryType.SteeringPump, Constants.Auxiliaries.Names.SteeringPump },
{ AuxiliaryType.HVAC, Constants.Auxiliaries.Names.HeatingVentilationAirCondition },
{ AuxiliaryType.PneumaticSystem, Constants.Auxiliaries.Names.PneumaticSystem },
{ AuxiliaryType.ElectricSystem, Constants.Auxiliaries.Names.ElectricSystem },
};
private static readonly Dictionary<string, AuxiliaryType> StrToAux = AuxToStr.ToDictionary(kv => kv.Value,
kv => kv.Key);
public static AuxiliaryType Parse(string s)
{
AuxiliaryType aux;
if (StrToAux.TryGetValue(s, out aux))
return aux;
throw new ArgumentOutOfRangeException("s", s, "Could not parse auxiliary type string.");
}
public static string ToString(AuxiliaryType t)
{
return AuxToStr[t];
}
}
}
\ No newline at end of file
...@@ -132,6 +132,7 @@ ...@@ -132,6 +132,7 @@
<Compile Include="Models\Connector\Ports\IFvPort.cs" /> <Compile Include="Models\Connector\Ports\IFvPort.cs" />
<Compile Include="Models\Connector\Ports\ITnPort.cs" /> <Compile Include="Models\Connector\Ports\ITnPort.cs" />
<Compile Include="InputData\Reader\ComponentData\AccelerationCurveReader.cs" /> <Compile Include="InputData\Reader\ComponentData\AccelerationCurveReader.cs" />
<Compile Include="Models\Declaration\AuxiliaryTypeHelper.cs" />
<Compile Include="Models\SimulationComponent\Data\AngularGearData.cs" /> <Compile Include="Models\SimulationComponent\Data\AngularGearData.cs" />
<Compile Include="InputData\Reader\ComponentData\TransmissionLossMapReader.cs" /> <Compile Include="InputData\Reader\ComponentData\TransmissionLossMapReader.cs" />
<Compile Include="InputData\Reader\ComponentData\RetarderLossMapReader.cs" /> <Compile Include="InputData\Reader\ComponentData\RetarderLossMapReader.cs" />
...@@ -139,7 +140,6 @@ ...@@ -139,7 +140,6 @@
<Compile Include="InputData\Reader\ComponentData\AuxiliaryDataReader.cs" /> <Compile Include="InputData\Reader\ComponentData\AuxiliaryDataReader.cs" />
<Compile Include="Models\SimulationComponent\Data\Engine\FuelConsumptionMapReader.cs" /> <Compile Include="Models\SimulationComponent\Data\Engine\FuelConsumptionMapReader.cs" />
<Compile Include="Models\SimulationComponent\Impl\TorqueConverter.cs" /> <Compile Include="Models\SimulationComponent\Impl\TorqueConverter.cs" />
<Compile Include="Utils\AuxiliaryTypeHelper.cs" />
<Compile Include="Utils\ProviderExtensions.cs" /> <Compile Include="Utils\ProviderExtensions.cs" />
<Compile Include="Models\Declaration\AirDrag.cs" /> <Compile Include="Models\Declaration\AirDrag.cs" />
<Compile Include="Models\Declaration\Fan.cs" /> <Compile Include="Models\Declaration\Fan.cs" />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment