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

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

LossMap CreateDataTableFromEfficiency

parent 47faead4
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
/*
* 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>
......
......@@ -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>
......
......@@ -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) &&
......
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