Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

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

added string constants for EngineOnlyDrivingCycle Fields

parent 44fb6308
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
/// </remarks>
public class EngineOnlyDrivingCycle
{
private static class Fields
{
public const string Pe = "Pe";
public const string Padd = "Padd";
public const string Me = "Me";
public const string n = "n";
}
/// <summary>
/// Engine Speed
/// </summary>
......@@ -56,15 +64,15 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
foreach (DataRow row in data.Rows)
{
var cycle = new EngineOnlyDrivingCycle();
cycle.EngineSpeed = row.GetDouble("n");
cycle.EngineSpeed = row.GetDouble(Fields.n);
if (data.Columns.Contains("Pe"))
cycle.PowerEngine = row.GetDouble("Pe");
if (data.Columns.Contains(Fields.Pe))
cycle.PowerEngine = row.GetDouble(Fields.Pe);
else
cycle.Torque = row.GetDouble("Me");
cycle.Torque = row.GetDouble(Fields.Me);
if (data.Columns.Contains("Padd"))
cycle.Padd = row.GetDouble("Padd");
if (data.Columns.Contains(Fields.Padd))
cycle.Padd = row.GetDouble(Fields.Padd);
cycles.Add(cycle);
}
......
......@@ -68,9 +68,7 @@
<Compile Include="Models\Connector\Ports\IOutShaft.cs" />
<Compile Include="Models\Connector\Ports\ITnPort.cs" />
<Compile Include="Models\SimulationComponent\Data\EngineOnlyDrivingCycle.cs" />
<Compile Include="Models\SimulationComponent\Data\ModalResultField.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Models\SimulationComponent\Data\ModalResult.cs" />
<Compile Include="Models\SimulationComponent\Data\CombustionEngineData.cs" />
<Compile Include="Models\SimulationComponent\Data\Engine\FuelConsumptionMap.cs" />
<Compile Include="Models\SimulationComponent\Data\Engine\FullLoadCurve.cs" />
......
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