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

Skip to content
Snippets Groups Projects
Commit 2c0d2938 authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

fix methods

parent 166dcc9c
No related branches found
No related tags found
No related merge requests found
......@@ -29,45 +29,45 @@
* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
*/
using System;
namespace TUGraz.VectoCommon.Models
{
public enum AngledriveType
{
None,
SeparateAngledrive,
LossesIncludedInGearbox,
}
public static class AngledriveTypeHelper
{
public static string GetLabel(this AngledriveType type)
{
switch (type) {
case AngledriveType.None:
return "None";
case AngledriveType.SeparateAngledrive:
return "Separate Angledrive";
case AngledriveType.LossesIncludedInGearbox:
return "Included in Transmission Loss Maps";
default:
throw new ArgumentOutOfRangeException("AngledriveType", type, null);
}
}
public static string ToXMLFormat(this AngledriveType type)
{
switch (type) {
case AngledriveType.None:
return "None";
case AngledriveType.SeparateAngledrive:
return "Separate Angledrive";
case AngledriveType.LossesIncludedInGearbox:
return "Losses included in Gearbox";
default:
throw new ArgumentOutOfRangeException("Angledrive Type", type, null);
}
}
}
using System;
namespace TUGraz.VectoCommon.Models
{
public enum AngledriveType
{
None,
SeparateAngledrive,
LossesIncludedInGearbox,
}
public static class AngledriveTypeHelper
{
public static string GetLabel(this AngledriveType type)
{
switch (type) {
case AngledriveType.None:
return "None";
case AngledriveType.SeparateAngledrive:
return "Separate Angledrive";
case AngledriveType.LossesIncludedInGearbox:
return "Included in Transmission Loss Maps";
default:
throw new ArgumentOutOfRangeException("AngledriveType", type, null);
}
}
public static string ToXMLFormat(this AngledriveType type)
{
switch (type) {
case AngledriveType.None:
return "None";
case AngledriveType.SeparateAngledrive:
return "Separate Angledrive";
case AngledriveType.LossesIncludedInGearbox:
return "Losses included in Gearbox";
default:
throw new ArgumentOutOfRangeException("Angledrive Type", type, null);
}
}
}
}
\ No newline at end of file
......@@ -254,7 +254,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
LossMap = lossMap,
};
CreateATGearData(gearbox, i, gearData, tcShiftPolygon, gearDifferenceRatio, gears);
CreateATGearData(gearbox, i, gearData, tcShiftPolygon, gearDifferenceRatio, gears, vehicleCategory);
gears.Add(i + 1, gearData);
}
retVal.Gears = gears;
......@@ -271,7 +271,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
}
private static void CreateATGearData(IGearboxDeclarationInputData gearbox, uint i, GearData gearData,
ShiftPolygon tcShiftPolygon, double gearDifferenceRatio, Dictionary<uint, GearData> gears)
ShiftPolygon tcShiftPolygon, double gearDifferenceRatio, Dictionary<uint, GearData> gears, VehicleCategory vehicleCategory)
{
if (gearbox.Type == GearboxType.ATPowerSplit && i == 0) {
// powersplit transmission: torque converter already contains ratio and losses
......
......@@ -82,8 +82,8 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
switch (airdragData.CrossWindCorrectionMode) {
case CrossWindCorrectionMode.NoCorrection:
retVal.CrossWindCorrectionCurve = new CrosswindCorrectionCdxALookup(airdragData.AirDragArea,
CrossWindCorrectionCurveReader.GetNoCorrectionCurve(airdragData.AirDragArea),
CrossWindCorrectionMode.NoCorrection);
CrossWindCorrectionCurveReader.GetNoCorrectionCurve(airdragData.AirDragArea),
CrossWindCorrectionMode.NoCorrection);
break;
case CrossWindCorrectionMode.SpeedDependentCorrectionFactor:
retVal.CrossWindCorrectionCurve = new CrosswindCorrectionCdxALookup(airdragData.AirDragArea,
......@@ -100,7 +100,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
var height = DeclarationData.Segments.LookupHeight(data.VehicleCategory, data.AxleConfiguration,
data.GrossVehicleMassRating);
retVal.CrossWindCorrectionCurve = new CrosswindCorrectionCdxALookup(airDragArea,
DeclarationDataAdapter.GetDeclarationAirResistanceCurve(
DeclarationDataAdapter.GetDeclarationAirResistanceCurve(
GetAirdragParameterSet(data.VehicleCategory, data.AxleConfiguration, data.Axles.Count), airDragArea, height),
CrossWindCorrectionMode.DeclarationModeCorrection);
break;
......@@ -200,7 +200,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
LossMap = lossMap,
};
CreateATGearData(gearbox, i, gearData, tcShiftPolygon, gearDifferenceRatio, gears);
CreateATGearData(gearbox, i, gearData, tcShiftPolygon, gearDifferenceRatio, gears, vehicleCategory);
gears.Add(i + 1, gearData);
}
retVal.Gears = gears;
......@@ -218,7 +218,8 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
}
private static void CreateATGearData(IGearboxEngineeringInputData gearbox, uint i, GearData gearData,
ShiftPolygon tcShiftPolygon, double gearDifferenceRatio, Dictionary<uint, GearData> gears)
ShiftPolygon tcShiftPolygon, double gearDifferenceRatio, Dictionary<uint, GearData> gears,
VehicleCategory vehicleCategory)
{
if (gearbox.Type == GearboxType.ATPowerSplit && i == 0) {
// powersplit transmission: torque converter already contains ratio and losses
......@@ -229,7 +230,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
// torqueconverter is active in first gear - duplicate ratio and lossmap for torque converter mode
CreateTCFirstGearATSerial(gearData, tcShiftPolygon);
}
if (i == 1 && gearDifferenceRatio >= DeclarationData.Gearbox.TorqueConverterSecondGearThreshold(vehicleCategory)) {
if (i == 1 && gearDifferenceRatio >= DeclarationData.Gearbox.TorqueConverterSecondGearThreshold(vehicleCategory)) {
// ratio between first and second gear is above threshold, torqueconverter is active in second gear as well
// -> duplicate ratio and lossmap for torque converter mode, remove locked transmission for previous gear
CreateTCSecondGearATSerial(gearData, tcShiftPolygon);
......
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