Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

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

added R85 RatedPower to JSON (if saved in declaration mode)

parent 8d0e2bac
No related branches found
No related tags found
No related merge requests found
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Newtonsoft.Json.Linq;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
......@@ -219,7 +220,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
public ElectricMachineType ElectricMachineType { get; }
public Watt R85RatedPower => null;
public Watt R85RatedPower => !SavedInDeclarationMode ? null : Body.GetEx<double>("R85RatedPower").SI<Watt>();
public virtual KilogramSquareMeter Inertia => Body.GetEx<double>("Inertia").SI<KilogramSquareMeter>();
//public virtual Joule OverloadBuffer => Body.GetValueOrDefault<double>("ThermalOverloadBuffer")?.SI(Unit.SI.Mega.Joule).Cast<Joule>() ?? 1e18.SI<Joule>();
......
......@@ -631,6 +631,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
public virtual IList<ElectricMachineEntry<IElectricMotorEngineeringInputData>> Entries =>
_entries;
}
// ###################################################################
......
......@@ -62,7 +62,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
#region Overrides of JSONVehicleDataV10_HEV_BEV
public override TableData BoostingLimitations => null;
public override ArchitectureID ArchitectureID { get => VehicleType.GetArchitectureID(PowertrainPosition.IEPC); }
#endregion
}
......@@ -120,27 +122,32 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
protected virtual JSONElectricMotors ReadMotors()
{
var retVal = new List<ElectricMachineEntry<IElectricMotorEngineeringInputData>>();
foreach (var entry in Body["ElectricMotors"]) {
var tmp = new ElectricMachineEntry<IElectricMotorEngineeringInputData> {
Position = PowertrainPositionHelper.Parse(entry.GetEx<string>("Position")),
RatioADC = entry.GetEx<double>("Ratio"),
RatioPerGear = entry["RatioPerGear"] != null
? entry["RatioPerGear"].Select(x => x.Value<double>()).ToArray()
: new double[] { },
MechanicalTransmissionEfficiency = entry["MechanicalEfficiency"] != null
? entry.GetEx<double>("MechanicalEfficiency")
: double.NaN,
MechanicalTransmissionLossMap = entry["MechanicalTransmissionLossMap"] != null
? ReadTableData(Path.Combine(BasePath, entry.GetEx<string>("MechanicalTransmissionLossMap")),
"EM ADC LossMap")
: null,
Count = entry.GetEx<int>("Count"),
ElectricMachine =
JSONInputDataFactory.ReadElectricMotorData(
Path.Combine(BasePath, entry.GetEx<string>("MotorFile")), false)
};
retVal.Add(tmp);
if (Body["ElectricMotors"] != null) {
foreach (var entry in Body["ElectricMotors"])
{
var tmp = new ElectricMachineEntry<IElectricMotorEngineeringInputData>
{
Position = PowertrainPositionHelper.Parse(entry.GetEx<string>("Position")),
RatioADC = entry.GetEx<double>("Ratio"),
RatioPerGear = entry["RatioPerGear"] != null
? entry["RatioPerGear"].Select(x => x.Value<double>()).ToArray()
: new double[] { },
MechanicalTransmissionEfficiency = entry["MechanicalEfficiency"] != null
? entry.GetEx<double>("MechanicalEfficiency")
: double.NaN,
MechanicalTransmissionLossMap = entry["MechanicalTransmissionLossMap"] != null
? ReadTableData(Path.Combine(BasePath, entry.GetEx<string>("MechanicalTransmissionLossMap")),
"EM ADC LossMap")
: null,
Count = entry.GetEx<int>("Count"),
ElectricMachine =
JSONInputDataFactory.ReadElectricMotorData(
Path.Combine(BasePath, entry.GetEx<string>("MotorFile")), false)
};
retVal.Add(tmp);
}
}
return new JSONElectricMotors(retVal);
}
......
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