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

Skip to content
Snippets Groups Projects
Commit e5fba516 authored by Harald Martini's avatar Harald Martini
Browse files

create fullload curve before voltage level data for iepc

parent 0bd0c359
No related branches found
No related tags found
No related merge requests found
......@@ -1186,14 +1186,16 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
var voltageLevels = new List<ElectricMotorVoltageLevelData>();
foreach (var entry in iepc.VoltageLevels.OrderBy(x => x.VoltageLevel)) {
var effMap = new Dictionary<uint, EfficiencyMap>();
var fldCurve =
IEPCFullLoadCurveReader.Create(entry.FullLoadCurve, count, gearRatioUsedForMeasurement.Ratio);
for (var i = 0u; i < entry.PowerMap.Count; i++) {
var ratio = iepc.Gears.First(x => x.GearNumber == i + 1).Ratio;
effMap.Add(i + 1, IEPCMapReader.Create(entry.PowerMap[(int)i].PowerMap, count, ratio));
effMap.Add(i + 1, IEPCMapReader.Create(entry.PowerMap[(int)i].PowerMap, count, ratio, fldCurve));
//fullLoadCurves.Add(i + 1, IEPCFullLoadCurveReader.Create(entry.FullLoadCurve, count, ratio));
}
voltageLevels.Add(new IEPCVoltageLevelData() {
Voltage = entry.VoltageLevel,
FullLoadCurve = IEPCFullLoadCurveReader.Create(entry.FullLoadCurve, count, gearRatioUsedForMeasurement.Ratio),
FullLoadCurve = fldCurve,
EfficiencyMaps = effMap,
});
}
......
......@@ -494,6 +494,47 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl.DeclarationMode.HeavyLorryRunDa
public PEV_E_IEPC(IDeclarationInputDataProvider dataProvider, IDeclarationReport report,
ILorryDeclarationDataAdapter declarationDataAdapter) : base(dataProvider, report, declarationDataAdapter) { }
#region Overrides of BatteryElectric
protected override VectoRunData CreateVectoRunData(IVehicleDeclarationInputData vehicle, Mission mission, KeyValuePair<LoadingType, Tuple<Kilogram, double?>> loading,
int? modeIdx = null, VectoRunData.OvcHevMode ovcMode = VectoRunData.OvcHevMode.NotApplicable)
{
AxleGearRequired();
return base.CreateVectoRunData(vehicle, mission, loading, modeIdx, ovcMode);
}
#endregion
private bool AxleGearRequired()
{
var vehicle = InputDataProvider.JobInputData.Vehicle;
var iepcInput = vehicle.Components.IEPC;
var axleGearRequired = !iepcInput.DifferentialIncluded && !iepcInput.DesignTypeWheelMotor;
if (axleGearRequired && vehicle.Components.AxleGearInputData == null)
{
throw new VectoException(
$"Axlegear reqhired for selected type of IEPC! DifferentialIncluded: {iepcInput.DifferentialIncluded}, DesignTypeWheelMotor: {iepcInput.DesignTypeWheelMotor}");
}
var numGearsPowermap =
iepcInput.VoltageLevels.Select(x => Tuple.Create(x.VoltageLevel, x.PowerMap.Count)).ToArray();
var gearCount = iepcInput.Gears.Count;
var numGearsDrag = iepcInput.DragCurves.Count;
if (numGearsPowermap.Any(x => x.Item2 != gearCount))
{
throw new VectoException(
$"Number of gears for voltage levels does not match! PowerMaps: {numGearsPowermap.Select(x => $"{x.Item1}: {x.Item2}").Join()}; Gear count: {gearCount}");
}
if (numGearsDrag > 1 && numGearsDrag != gearCount)
{
throw new VectoException(
$"Number of gears drag curve does not match gear count! DragCurve {numGearsDrag}; Gear count: {gearCount}");
}
return axleGearRequired;
}
protected override void CreateGearboxAndGearshiftData(IVehicleDeclarationInputData vehicle, VectoRunData runData)
{
......
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