From 9ac6ddba99b9890f6f8bd68cb27494377324941c Mon Sep 17 00:00:00 2001 From: Michael Krisper <michael.krisper@tugraz.at> Date: Thu, 2 Sep 2021 19:01:24 +0200 Subject: [PATCH] Changed reading EcoRoll Attribute for HEV: Will always be EcoRollType None --- .../InputData/FileIO/JSON/JSONSubComponent.cs | 7 +++++++ .../InputData/FileIO/JSON/JSONVehicleData.cs | 15 ++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONSubComponent.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONSubComponent.cs index 891a9ce899..e553b31c7c 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONSubComponent.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONSubComponent.cs @@ -449,6 +449,13 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON // ------------------------------------------------------------------- + internal class JSONADASInputDataV10HEV : JSONADASInputDataV8 + { + public JSONADASInputDataV10HEV(JSONVehicleDataV7 vehicle) : base(vehicle) { } + + public override EcoRollType EcoRoll => EcoRollType.None; + } + internal class JSONADASInputDataV10BEV : JSONADASInputDataV8 { public JSONADASInputDataV10BEV(JSONVehicleDataV7 vehicle) : base(vehicle) { } diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs index be3210735e..c58fbedee6 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs @@ -113,9 +113,18 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON protected override IAdvancedDriverAssistantSystemsEngineering GetADS() { - return _adasInputData ?? (_adasInputData = (VehicleType == VectoSimulationJobType.BatteryElectricVehicle - ? new JSONADASInputDataV10BEV(this) - : base.GetADS())); + if (_adasInputData != null) + return _adasInputData; + + switch (VehicleType) { + case VectoSimulationJobType.BatteryElectricVehicle: + return _adasInputData = new JSONADASInputDataV10BEV(this); + case VectoSimulationJobType.ParallelHybridVehicle: + case VectoSimulationJobType.SerialHybridVehicle: + return _adasInputData = new JSONADASInputDataV10HEV(this); + default: + return base.GetADS(); + } } -- GitLab