Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

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

Pull request #870: Feature/VECTO-1547 upodate lh cycle remove reading declaration data from fs

Merge in VECTO/vecto-sim from VECTO/mq_vecto-sim:feature/VECTO-1547-upodate-lh-cycle-remove-reading-declaration-data-from-fs to develop

* commit '063b067e':
  adapt expected values in testcases due to changes in LH cycle
  remove reading pcc parametersd from filesystem, remove reading cycles from filesystem remove unused feature (serializing vectorundata)
  do not read effshift parameters from file system
  removing previous lh candidates
  update gradient profile in lh cycle
parents 219a2817 063b067e
Branches
Tags
No related merge requests found
Showing
with 92961 additions and 278969 deletions
...@@ -346,25 +346,6 @@ namespace TUGraz.VectoCore.Models.Declaration ...@@ -346,25 +346,6 @@ namespace TUGraz.VectoCore.Models.Declaration
public static class Driver public static class Driver
{ {
internal static JObject adasParams;
static Driver()
{
ReadAdasConfig();
}
// TODO: MQ 2019-11-26 remove, once the parameters are fixed! make fields above read-only or const
internal static void ReadAdasConfig()
{
var expectedFile = @"Declaration\ADASParameters.json";
if (!File.Exists(expectedFile)) {
return;
}
using (var reader = File.OpenText(expectedFile)) {
adasParams = (JObject)(JToken.ReadFrom(new JsonTextReader(reader)).GetEx(JsonKeys.JsonBody));
}
}
public static class LookAhead public static class LookAhead
{ {
public const bool Enabled = true; public const bool Enabled = true;
...@@ -400,34 +381,6 @@ namespace TUGraz.VectoCore.Models.Declaration ...@@ -400,34 +381,6 @@ namespace TUGraz.VectoCore.Models.Declaration
public static class PCC public static class PCC
{ {
// TODO: MQ 2019-11-26 remove, once the parameters are fixed! make fields above read-only or const
static PCC()
{
ReadAdasConfig();
if (adasParams == null) {
return;
}
if (adasParams["PCCEnableSpeed"] != null) {
PCCEnableSpeed = adasParams.GetEx<double>("PCCEnableSpeed").KMPHtoMeterPerSecond();
}
if (adasParams["MinSpeed"] != null) {
MinSpeed = adasParams.GetEx<double>("MinSpeed").KMPHtoMeterPerSecond();
}
if (adasParams["PreviewDistanceUseCase1"] != null) {
PreviewDistanceUseCase1 = adasParams.GetEx<double>("PreviewDistanceUseCase1").SI<Meter>();
}
if (adasParams["PreviewDistanceUseCase2"] != null) {
PreviewDistanceUseCase2 = adasParams.GetEx<double>("PreviewDistanceUseCase2").SI<Meter>();
}
if (adasParams["Underspeed"] != null) {
Underspeed = adasParams.GetEx<double>("Underspeed").KMPHtoMeterPerSecond();
}
if (adasParams["OverspeedUseCase3"] != null) {
OverspeedUseCase3 = adasParams.GetEx<double>("OverspeedUseCase3").KMPHtoMeterPerSecond();
}
}
public static readonly MeterPerSecond PCCEnableSpeed = 80.KMPHtoMeterPerSecond(); public static readonly MeterPerSecond PCCEnableSpeed = 80.KMPHtoMeterPerSecond();
public static readonly MeterPerSecond MinSpeed = 50.KMPHtoMeterPerSecond(); public static readonly MeterPerSecond MinSpeed = 50.KMPHtoMeterPerSecond();
public static readonly Meter PreviewDistanceUseCase1 = 1500.SI<Meter>(); public static readonly Meter PreviewDistanceUseCase1 = 1500.SI<Meter>();
...@@ -517,72 +470,6 @@ namespace TUGraz.VectoCore.Models.Declaration ...@@ -517,72 +470,6 @@ namespace TUGraz.VectoCore.Models.Declaration
public static bool Fallback_ATEcoRollReleaseLockupClutch = false; public static bool Fallback_ATEcoRollReleaseLockupClutch = false;
public static double DownshiftMaxAccelerationAT = 0.5; public static double DownshiftMaxAccelerationAT = 0.5;
// TODO: MQ 2019-11-26 remove, once the parameters are fixed! make fields above read-only or const
static GearboxTCU()
{
var expectedFile = @"Declaration\EffShiftParameters.vtcu";
if (!File.Exists(expectedFile)) {
return;
}
var tcuData = JSONInputDataFactory.ReadShiftParameters(expectedFile, true);
if (tcuData.RatingFactorCurrentGear.HasValue) {
RatingFactorCurrentGear = tcuData.RatingFactorCurrentGear.Value;
}
if (tcuData.RatioEarlyDownshiftFC.HasValue) {
RatioEarlyDownshiftFC = tcuData.RatioEarlyDownshiftFC.Value;
}
if (tcuData.RatioEarlyUpshiftFC.HasValue) {
RatioEarlyUpshiftFC = tcuData.RatioEarlyUpshiftFC.Value;
}
if (tcuData.AllowedGearRangeFC.HasValue) {
AllowedGearRangeFCAMT = tcuData.AllowedGearRangeFC.Value;
}
if (tcuData.VeloictyDropFactor.HasValue) {
VelocityDropFactor = tcuData.VeloictyDropFactor.Value;
}
if (tcuData.AccelerationFactor.HasValue) {
AccelerationFactor = tcuData.AccelerationFactor.Value;
}
if (tcuData.ATLookAheadTime != null) {
ATLookAheadTime = tcuData.ATLookAheadTime;
}
if (tcuData.LoadStageThresholdsDown != null && LoadStageThresoldsDown.Length > 0) {
LoadStageThresoldsDown = tcuData.LoadStageThresholdsDown.ToArray();
}
if (tcuData.LoadStageThresholdsUp != null && LoadStageThresholdsUp.Length > 0) {
LoadStageThresholdsUp = tcuData.LoadStageThresholdsUp.ToArray();
}
if (tcuData.ShiftSpeedsTCToLocked != null && ShiftSpeedsTCToLocked.Length > 0) {
ShiftSpeedsTCToLocked = tcuData.ShiftSpeedsTCToLocked;
}
if (tcuData.MinEngineSpeedPostUpshift != null) {
MinEngineSpeedPostUpshift = tcuData.MinEngineSpeedPostUpshift;
}
if (tcuData.EffshiftAccelerationFactorAT != null) {
DownshiftMaxAccelerationAT = tcuData.EffshiftAccelerationFactorAT.Value;
}
var raw = tcuData as JSONFile;
if (raw.Body["Rating_current_gear_APT"] != null) {
RatingFactorCurrentGearAPT = raw.Body.GetEx<double>("Rating_current_gear_APT");
}
if (raw.Body["AllowedGearRangeFCAPT"] != null) {
AllowedGearRangeFCAPT = raw.Body.GetEx<int>("AllowedGearRangeFCAPT");
}
if (raw.Body["AllowedGearRangeFCAPTSkipGear"] != null) {
AllowedGearRangeFCAPTSkipGear = raw.Body.GetEx<int>("AllowedGearRangeFCAPTSkipGear");
}
//var tmp = tcuData as JSONFile;
//if (tmp != null && tmp.Body["ShiftStrategy"] != null) {
// DefaultShiftStrategy = tmp.Body["ShiftStrategy"].Value<string>();
//}
}
} }
public static class Gearbox public static class Gearbox
......
...@@ -198,18 +198,10 @@ namespace TUGraz.VectoCore.Models.Declaration ...@@ -198,18 +198,10 @@ namespace TUGraz.VectoCore.Models.Declaration
var weight = grossVehicleWeight; var weight = grossVehicleWeight;
GetLoadings(out lowLoad, out refLoad, payloads, (p, l) => GetLoading(p, weight, vehicleWeight, trailers, l), maxLoad); GetLoadings(out lowLoad, out refLoad, payloads, (p, l) => GetLoading(p, weight, vehicleWeight, trailers, l), maxLoad);
// TODO: MQ 2021-11-15 REMOVE IN OFFICIAL VERSION! var cycleFile = RessourceHelper.ReadStream(DeclarationData.DeclarationDataResourcePrefix +
Stream cycleFile;
var cycleFileName = Path.Combine("DeclarationMissions",
missionType.ToString().Replace("EMS", "") + ".vdri");
if (File.Exists(cycleFileName)) {
cycleFile = File.OpenRead(cycleFileName);
} else {
cycleFile = RessourceHelper.ReadStream(DeclarationData.DeclarationDataResourcePrefix +
".MissionCycles." + ".MissionCycles." +
missionType.ToString().Replace("EMS", "") + missionType.ToString().Replace("EMS", "") +
Constants.FileExtensions.CycleFile); Constants.FileExtensions.CycleFile);
}
var mission = new Mission { var mission = new Mission {
MissionType = missionType, MissionType = missionType,
......
...@@ -137,8 +137,6 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl ...@@ -137,8 +137,6 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
public bool ModalResults1Hz { get; set; } public bool ModalResults1Hz { get; set; }
public bool ActualModalData { get; set; } public bool ActualModalData { get; set; }
public bool SerializeVectoRunData { get; set; }
/// <summary> /// <summary>
/// Creates powertrain and initializes it with the component's data. /// Creates powertrain and initializes it with the component's data.
/// </summary> /// </summary>
...@@ -184,14 +182,6 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl ...@@ -184,14 +182,6 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
WriteModalResults = _mode != ExecutionMode.Declaration || WriteModalResults WriteModalResults = _mode != ExecutionMode.Declaration || WriteModalResults
}; };
// TODO: MQ 20200410 - Remove for official release!
if (SerializeVectoRunData) {
File.WriteAllText(
Path.Combine(
(ModWriter as FileOutputWriter)?.BasePath ?? "", $"{data.JobName}_{data.Cycle.Name}{data.ModFileSuffix}.json"),
JsonConvert.SerializeObject(data, Formatting.Indented));
}
var builder = new PowertrainBuilder( var builder = new PowertrainBuilder(
modContainer, modData => { modContainer, modData => {
if (SumData != null) { if (SumData != null) {
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -66,10 +66,10 @@ namespace TUGraz.VectoCore.Tests.Integration.Declaration ...@@ -66,10 +66,10 @@ namespace TUGraz.VectoCore.Tests.Integration.Declaration
xmlInputReader = _kernel.Get<IXMLInputDataReader>(); xmlInputReader = _kernel.Get<IXMLInputDataReader>();
} }
[TestCase(null, 1.0, 45.7715457, TestName = "Engine CF - NONE"), [TestCase(null, 1.0, 44.9120687, TestName = "Engine CF - NONE"),
TestCase("CFRegPer", 1.2, 45.7715457 * 1.2, TestName = "Engine CF - CFRegPer"), TestCase("CFRegPer", 1.2, 44.9120687 * 1.2, TestName = "Engine CF - CFRegPer"),
TestCase("BFColdHot", 1.2, 45.7715457 * 1.2, TestName = "Engine CF - BFColdHod"), TestCase("BFColdHot", 1.2, 44.9120687 * 1.2, TestName = "Engine CF - BFColdHod"),
TestCase("CFNCV", 1.2, 45.7715457, TestName = "Engine CF - CFNCV") // has no influence - only for documentation purpose TestCase("CFNCV", 1.2, 44.9120687, TestName = "Engine CF - CFNCV") // has no influence - only for documentation purpose
] ]
public void TestEngineCorrectionFactors(string correctionFactor, double value, double expectedFc) public void TestEngineCorrectionFactors(string correctionFactor, double value, double expectedFc)
{ {
......
...@@ -71,10 +71,9 @@ namespace TUGraz.VectoCore.Tests.Integration.Declaration ...@@ -71,10 +71,9 @@ namespace TUGraz.VectoCore.Tests.Integration.Declaration
xmlInputReader = _kernel.Get<IXMLInputDataReader>(); xmlInputReader = _kernel.Get<IXMLInputDataReader>();
} }
[ [
TestCase(Class5NG, 2, TankSystem.Liquefied, 262.3, 726.64, TestName = "Class5 LNG 2"), TestCase(Class5NG, 2, TankSystem.Liquefied, 249.8, 692.01, TestName = "Class5 LNG 2"),
TestCase(Class5NG, 2, TankSystem.Compressed, 268.3, 721.82, TestName = "Class5 CNG 2"), TestCase(Class5NG, 2, TankSystem.Compressed, 255.5, 687.43, TestName = "Class5 CNG 2"),
TestCase(Class5NG, 6, TankSystem.Liquefied, 253.3, 701.63, TestName = "Class5 LNG 6"), TestCase(Class5NG, 6, TankSystem.Liquefied, 253.3, 701.63, TestName = "Class5 LNG 6"),
TestCase(Class5NG, 6, TankSystem.Compressed, 259.1, 696.98, TestName = "Class5 CNG 6"), TestCase(Class5NG, 6, TankSystem.Compressed, 259.1, 696.98, TestName = "Class5 CNG 6"),
] ]
......
...@@ -62,40 +62,40 @@ namespace TUGraz.VectoCore.Tests.Integration ...@@ -62,40 +62,40 @@ namespace TUGraz.VectoCore.Tests.Integration
[Category("Integration")] [Category("Integration")]
[TestCase(FuelType.DieselCI, null, [TestCase(FuelType.DieselCI, null,
@"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 0, @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 0,
0.000218492361921757, 0.000218492361921757, 26.1354499906408, 0.000683881092815101, 9329.62385405905, 0.000216752542154492, 0.000216752542154492, 25.9273375782886, 0.000678435456943561, 9255.33354999683,
TestName = "Diesel LH Low"), TestName = "Diesel LH Low"),
TestCase(FuelType.EthanolCI, null, TestCase(FuelType.EthanolCI, null,
@"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 0, @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 0,
0.000218492361921757, 0.000221072980369653, 26.9601195572747, 0.000400142094469071, 5615.25370138917, 0.000216752542154492, 0.000219312611550018, 26.7454404329291, 0.000396955826905533, 5570.54033337047,
TestName = "Ethanol/CI LH Low"), TestName = "Ethanol/CI LH Low"),
TestCase(FuelType.DieselCI, null, TestCase(FuelType.DieselCI, null,
@"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1, @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1,
0.000253200804935895, 0.000253200804935895, 30.2871776239108, 0.00079251851944935, 10811.6743707627, 0.000248197742331471, 0.000248197742331471, 29.6887251592669, 0.000776858933497505, 10598.0435975538,
TestName = "Diesel LH Ref"), TestName = "Diesel LH Ref"),
TestCase(FuelType.EthanolCI, null, TestCase(FuelType.EthanolCI, null,
@"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1, @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1,
0.000253200804935895, 0.000256191365624114, 31.2428494663554, 0.000463706371779646, 6507.2606868525, 0.000248197742331471, 0.000251129211729087, 30.6255136254984, 0.000454543873229647, 6378.68197791881,
TestName = "Ethanol/CI LH Ref"), TestName = "Ethanol/CI LH Ref"),
TestCase(FuelType.EthanolPI, null, TestCase(FuelType.EthanolPI, null,
@"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1, @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1,
0.000253200804935895, 0.000251472471796401, 31.9939531547584, 0.000528092190772442, 7368.14342363454, 0.000248197742331471, 0.000246503559789959, 31.3617760547022, 0.000517657475558915, 7222.55430184581,
TestName = "Ethanol/PI LH Ref"), TestName = "Ethanol/PI LH Ref"),
TestCase(FuelType.PetrolPI, null, TestCase(FuelType.PetrolPI, null,
@"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1, @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1,
0.000253200804935895, 0.000253200804935895, 33.8503749914298, 0.00076973044700512, 10507.8334048396, 0.000248197742331471, 0.000248197742331471, 33.1815163544747, 0.000754521136687672, 10300.2063067561,
TestName = "Petrol/PI LH Ref"), TestName = "Petrol/PI LH Ref"),
TestCase(FuelType.LPGPI, null, TestCase(FuelType.LPGPI, null,
@"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1, @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1,
0.000253200804935895, 0.000253200804935895, null, 0.000764666430906402, 11647.2370270512, 0.000248197742331471, 0.000248197742331471, null, 0.000749557181841043, 11417.0961472477,
TestName = "LPG/PI LH Ref"), TestName = "LPG/PI LH Ref"),
TestCase(FuelType.NGPI, TankSystem.Liquefied, TestCase(FuelType.NGPI, TankSystem.Liquefied,
@"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1, @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1,
0.000253200804935895, 0.000232573448118307, null, 0.00064422845128771, 11419.3563026089, 0.000248197742331471, 0.000227977966988786, null, 0.000631498968558938, 11193.7181791494,
TestName = "LNG/PI LH Ref"), TestName = "LNG/PI LH Ref"),
TestCase(FuelType.NGPI, TankSystem.Compressed, TestCase(FuelType.NGPI, TankSystem.Compressed,
@"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1, @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1,
0.000253200804935895, 0.000237903256304352, null, 0.000639959759458707, 11419.3563026089, 0.000248197742331471, 0.000233202462065613, null, 0.000627314622956498, 11193.7181791494,
TestName = "CNG/PI LH Ref"), TestName = "CNG/PI LH Ref"),
] ]
public void TestFuelTypesCO2(FuelType fuelType, TankSystem? tankSystem, string jobName, int runIdx, public void TestFuelTypesCO2(FuelType fuelType, TankSystem? tankSystem, string jobName, int runIdx,
......
...@@ -267,13 +267,13 @@ namespace TUGraz.VectoCore.Tests.Integration ...@@ -267,13 +267,13 @@ namespace TUGraz.VectoCore.Tests.Integration
var view = new DataView(sumData.Table, "", SummaryDataContainer.Fields.SORT, DataViewRowState.CurrentRows).ToTable(); var view = new DataView(sumData.Table, "", SummaryDataContainer.Fields.SORT, DataViewRowState.CurrentRows).ToTable();
Console.WriteLine(string.Join("; ", view.AsEnumerable().Select(x => x[string.Format(SummaryDataContainer.Fields.FCMAP_KM, "")].ToString().ToDouble()))); Console.WriteLine(string.Join("; ", view.AsEnumerable().Select(x => x[string.Format(SummaryDataContainer.Fields.FCMAP_KM, "")].ToString().ToDouble())));
// 203.250695482581; 244.501164243499; 169.943109853321; 182.880939697492; 221.727012960826; 251.838137183945 // 199.750225533639; 235.82213490632; 169.943109853321; 182.880939697492; 221.727012960826; 251.838137183945
Assert.AreEqual(203.25069, view.Rows[0][string.Format(SummaryDataContainer.Fields.FCMAP_KM, "")].ToString().ToDouble(), 1e-3); Assert.AreEqual(199.750225533639, view.Rows[0][string.Format(SummaryDataContainer.Fields.FCMAP_KM, "")].ToString().ToDouble(), 1e-3);
Assert.AreEqual(244.50116, view.Rows[1][string.Format(SummaryDataContainer.Fields.FCMAP_KM, "")].ToString().ToDouble(), 1e-3); Assert.AreEqual(235.82213490632, view.Rows[1][string.Format(SummaryDataContainer.Fields.FCMAP_KM, "")].ToString().ToDouble(), 1e-3);
Assert.AreEqual(169.94310, view.Rows[2][string.Format(SummaryDataContainer.Fields.FCMAP_KM, "")].ToString().ToDouble(), 1e-3); Assert.AreEqual(169.943109853321, view.Rows[2][string.Format(SummaryDataContainer.Fields.FCMAP_KM, "")].ToString().ToDouble(), 1e-3);
Assert.AreEqual(182.88093, view.Rows[3][string.Format(SummaryDataContainer.Fields.FCMAP_KM, "")].ToString().ToDouble(), 1e-3); Assert.AreEqual(182.880939697492, view.Rows[3][string.Format(SummaryDataContainer.Fields.FCMAP_KM, "")].ToString().ToDouble(), 1e-3);
Assert.AreEqual(221.72701, view.Rows[4][string.Format(SummaryDataContainer.Fields.FCMAP_KM, "")].ToString().ToDouble(), 1e-3); Assert.AreEqual(221.727012960826, view.Rows[4][string.Format(SummaryDataContainer.Fields.FCMAP_KM, "")].ToString().ToDouble(), 1e-3);
Assert.AreEqual(251.83813, view.Rows[5][string.Format(SummaryDataContainer.Fields.FCMAP_KM, "")].ToString().ToDouble(), 1e-3); Assert.AreEqual(251.838137183945, view.Rows[5][string.Format(SummaryDataContainer.Fields.FCMAP_KM, "")].ToString().ToDouble(), 1e-3);
} }
[TestCase(EngineSpeedLimitJobATDecl)] [TestCase(EngineSpeedLimitJobATDecl)]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment