diff --git a/VectoCommon/VectoCommon/Models/AxleConfiguration.cs b/VectoCommon/VectoCommon/Models/AxleConfiguration.cs index b57948c2c5eb5a3655566b3b3dbaab32a9fe0905..031f88e587ce326875103705f7417bb873d91e4f 100644 --- a/VectoCommon/VectoCommon/Models/AxleConfiguration.cs +++ b/VectoCommon/VectoCommon/Models/AxleConfiguration.cs @@ -29,10 +29,12 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ +using System.Diagnostics.CodeAnalysis; using TUGraz.VectoCommon.Utils; namespace TUGraz.VectoCommon.Models { + [SuppressMessage("ReSharper", "InconsistentNaming")] public enum AxleConfiguration { AxleConfig_4x2, diff --git a/VectoCore/VectoCore/JsonKeys.Designer.cs b/VectoCore/VectoCore/JsonKeys.Designer.cs index 469bbc503d3f66b6bad53999a73fb09849bc0f6d..9b10854902046f67300cba39b5cadb7dd04720c1 100644 --- a/VectoCore/VectoCore/JsonKeys.Designer.cs +++ b/VectoCore/VectoCore/JsonKeys.Designer.cs @@ -1,33 +1,12 @@ -/* -* This file is part of VECTO. -* -* Copyright © 2012-2016 European Union -* -* Developed by Graz University of Technology, -* Institute of Internal Combustion Engines and Thermodynamics, -* Institute of Technical Informatics -* -* VECTO is licensed under the EUPL, Version 1.1 or - as soon they will be approved -* by the European Commission - subsequent versions of the EUPL (the "Licence"); -* You may not use VECTO except in compliance with the Licence. -* You may obtain a copy of the Licence at: -* -* https://joinup.ec.europa.eu/community/eupl/og_page/eupl -* -* Unless required by applicable law or agreed to in writing, VECTO -* distributed under the Licence is distributed on an "AS IS" basis, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the Licence for the specific language governing permissions and -* limitations under the Licence. -* -* Authors: -* Stefan Hausberger, hausberger@ivt.tugraz.at, IVT, Graz University of Technology -* Christian Kreiner, christian.kreiner@tugraz.at, ITI, Graz University of Technology -* Michael Krisper, michael.krisper@tugraz.at, ITI, Graz University of Technology -* Raphael Luz, luz@ivt.tugraz.at, IVT, Graz University of Technology -* Markus Quaritsch, markus.quaritsch@tugraz.at, IVT, Graz University of Technology -* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology -*/ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ namespace TUGraz.VectoCore { using System; @@ -306,6 +285,15 @@ namespace TUGraz.VectoCore { } } + /// <summary> + /// Looks up a localized string similar to Efficiency. + /// </summary> + internal static string Gearbox_Gear_Efficiency { + get { + return ResourceManager.GetString("Gearbox_Gear_Efficiency", resourceCulture); + } + } + /// <summary> /// Looks up a localized string similar to FullLoadCurve. /// </summary> diff --git a/VectoCore/VectoCore/JsonKeys.resx b/VectoCore/VectoCore/JsonKeys.resx index c20e96b0ed7c1987e836833e67c2e17df46be54c..c48f74a6bab08d2a851597a2acddd4628a1dc28e 100644 --- a/VectoCore/VectoCore/JsonKeys.resx +++ b/VectoCore/VectoCore/JsonKeys.resx @@ -205,6 +205,9 @@ </data> <data name="Gearbox_Gear_LossMapFile" xml:space="preserve"> <value>LossMap</value> + </data> + <data name="Gearbox_Gear_Efficiency" xml:space="preserve"> + <value>Efficiency</value> </data> <data name="Gearbox_ModelName" xml:space="preserve"> <value>ModelName</value> diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TransmissionLossMap.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TransmissionLossMap.cs index 99c6052f8810ffbadfea2f6def5b22892dcaea29..26fb4c888b72002d38f44fcf8bb9a9af3d30f70b 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TransmissionLossMap.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TransmissionLossMap.cs @@ -75,6 +75,13 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox } } + /// <summary> + /// Create a TransmissionLoss Map from a DataTable. + /// </summary> + /// <param name="data"></param> + /// <param name="gearRatio"></param> + /// <param name="gearName"></param> + /// <returns></returns> public static TransmissionLossMap Create(DataTable data, double gearRatio, string gearName) { if (data.Columns.Count < 3) { @@ -101,6 +108,29 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox return new TransmissionLossMap(entries, gearRatio, gearName); } + /// <summary> + /// Create a DataTable from an efficiency value. + /// </summary> + /// <param name="efficiency"></param> + /// <param name="gearRatio"></param> + /// <param name="gearName"></param> + /// <returns></returns> + public static DataTable CreateDataTableFromEfficiency(double efficiency) + { + var table = new DataTable(); + table.Columns.Add("Input Speed"); + table.Columns.Add("Input Torque"); + table.Columns.Add("Torque Loss"); + table.Rows.Add(new[] { -1e5, -1e5, (1 - efficiency) * 1e5 }); + table.Rows.Add(new[] { 1e5, -1e5, (1 - efficiency) * 1e5 }); + table.Rows.Add(new[] { 0, 1e5, 0 }); + table.Rows.Add(new[] { 0, -1e5, 0 }); + table.Rows.Add(new[] { 1e5, 1e5, (1 - efficiency) * 1e5 }); + table.Rows.Add(new[] { -1e5, 1e5, (1 - efficiency) * 1e5 }); + + return table; + } + private static bool HeaderIsValid(DataColumnCollection columns) { return columns.Contains(Fields.InputSpeed) && columns.Contains(Fields.InputTorque) &&