From c7a3406dd1eeb61ae9fca99e5bffa7fda0c5fda5 Mon Sep 17 00:00:00 2001 From: Michael Krisper <michael.krisper@gmail.com> Date: Mon, 9 Mar 2015 11:10:22 +0100 Subject: [PATCH] added string constants for EngineOnlyDrivingCycle Fields --- .../Data/EngineOnlyDrivingCycle.cs | 20 +++++++++++++------ VectoCore/VectoCore.csproj | 4 +--- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/VectoCore/Models/SimulationComponent/Data/EngineOnlyDrivingCycle.cs b/VectoCore/Models/SimulationComponent/Data/EngineOnlyDrivingCycle.cs index 34493133b7..c52472262d 100644 --- a/VectoCore/Models/SimulationComponent/Data/EngineOnlyDrivingCycle.cs +++ b/VectoCore/Models/SimulationComponent/Data/EngineOnlyDrivingCycle.cs @@ -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); } diff --git a/VectoCore/VectoCore.csproj b/VectoCore/VectoCore.csproj index d71d5331d2..e423382077 100644 --- a/VectoCore/VectoCore.csproj +++ b/VectoCore/VectoCore.csproj @@ -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" /> -- GitLab