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

Skip to content
Snippets Groups Projects
Commit 355dba59 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

read em torque limits for each voltage level

parent d1b837b4
No related branches found
No related tags found
No related merge requests found
......@@ -211,10 +211,25 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
//public override Dictionary<PowertrainPosition, List<Tuple<Volt, TableData>>> ElectricMotorTorqueLimits =>
// throw new NotImplementedException();
public override IDictionary<PowertrainPosition, IList<Tuple<Volt, TableData>>> ElectricMotorTorqueLimits =>
Body["EMTorqueLimits"] == null
? null
: new Dictionary<PowertrainPosition, IList<Tuple<Volt, TableData>>>() {
public override IDictionary<PowertrainPosition, IList<Tuple<Volt, TableData>>> ElectricMotorTorqueLimits
{
get
{
if (Body["EMTorqueLimits"] == null) {
return null;
}
if (Body["EMTorqueLimits"].HasValues) {
var entries = Body["EMTorqueLimits"].Select(x => Tuple.Create((x as JProperty)?.Name.ToDouble().SI<Volt>(),
ReadTableData(
Path.Combine(BasePath, (x as JProperty)?.Value.Value<string>() ?? ""),
"ElectricMotorTorqueLimits")
)).ToList();
return new Dictionary<PowertrainPosition, IList<Tuple<Volt, TableData>>>()
{{ GetElectricMachines().Entries.First().Position, entries }};
}
return new Dictionary<PowertrainPosition, IList<Tuple<Volt, TableData>>>() {
{
GetElectricMachines().Entries.First().Position,
new List<Tuple<Volt, TableData>>() {
......@@ -224,6 +239,24 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
}
}
};
}
}
//=>
//Body["EMTorqueLimits"] == null
// ? null
// : Body["EMTorqueLimits"].HasValues ?
// Body["EMTorqueLimits"].Select(x => Tuple.Create(x.GetEx<double>("Voltage").SI<Volt>(), ReadTableData(Path.Combine(BasePath, x.GetEx<string>("EMTorqueLimits")),
// "ElectricMotorTorqueLimits"))))
// : new Dictionary<PowertrainPosition, IList<Tuple<Volt, TableData>>>() {
// {
// GetElectricMachines().Entries.First().Position,
// new List<Tuple<Volt, TableData>>() {
// Tuple.Create((Volt)null, ReadTableData(
// Path.Combine(BasePath, Body.GetEx<string>("EMTorqueLimits")),
// "ElectricMotorTorqueLimits"))
// }
// }
// };
public override TableData BoostingLimitations =>
Body["MaxPropulsionTorque"] == null
......
......@@ -186,8 +186,6 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
Container.RunStatus = Status.Success;
}
var runAgain = _followUpCreator?.RunAgain((data) => {
Container.ModalData.Reset(true);
......
......@@ -105,7 +105,7 @@ namespace TUGraz.VectoCore.Tests.FileIO
// var pwrLow = inputProvider.VoltageLevels.First().EfficiencyMap;
Assert.AreEqual("0", pwrLow.Rows[0][ElectricMotorMapReader.Fields.MotorSpeed]);
Assert.AreEqual("-800", pwrLow.Rows[0][ElectricMotorMapReader.Fields.Torque]);
Assert.AreEqual("9.8449", pwrLow.Rows[0][ElectricMotorMapReader.Fields.PowerElectrical]);
Assert.AreEqual("9844.9", pwrLow.Rows[0][ElectricMotorMapReader.Fields.PowerElectrical]);
var pwrMapLow = ElectricMotorMapReader.Create(pwrLow, 1);
Assert.AreEqual(-0, pwrMapLow.LookupElectricPower(-0.RPMtoRad(), -800.SI<NewtonMeter>()).ElectricalPower.Value(), 1e-3);
......
......@@ -59,13 +59,6 @@ public class HybridStrategyDataAdapterTest
}
};
HybridStrategyParameters parameters = null;
try {
parameters = dataAdapter.CreateHybridStrategyParameters(batterySystemData, null, mass,
......@@ -77,10 +70,6 @@ public class HybridStrategyDataAdapterTest
Assert.IsTrue(parameters!.TargetSoC.IsEqual(expected_target_soc));
Assert.IsTrue(parameters.MinSoC.IsEqual(expected_min_soc));
}
[TestCase(1000.00000000000000 ,10.00000000000000 ,1000.00000000000000 ,1.00000000000000 ,0.61496863314570 ,0.78861497592102 ,0.70714213564177 ,1.00000000000000 ,false)]
......
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