diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs index 1e9f15c10656295dd7cf3016158587feb6e43091..c6b764db12e6f025f0e26bfec91969c581e71afd 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs @@ -318,6 +318,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON get { var retVal = new List<ICycleData>(); + if (Body[JsonKeys.Job_Cycles] == null) { + return retVal; + } foreach (var cycle in Body.GetEx(JsonKeys.Job_Cycles)) { //.Select(cycle => var cycleFile = Path.Combine(BasePath, cycle.Value<string>()); @@ -409,10 +412,13 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON ? ReadTableData(lac.GetEx<string>("Df_velocityDropLookup"), "Lookahead Coasting Decisionfactor - Velocity drop", false) : null; + var minSpeed = lac["MinSpeed"] != null + ? lac.GetEx<double>(JsonKeys.DriverData_Lookahead_MinSpeed).KMPHtoMeterPerSecond() + : DeclarationData.Driver.LookAhead.MinimumSpeed; return new LookAheadCoastingInputData() { Enabled = lac.GetEx<bool>(JsonKeys.DriverData_Lookahead_Enabled), //Deceleration = lac.GetEx<double>(JsonKeys.DriverData_Lookahead_Deceleration).SI<MeterPerSquareSecond>(), - MinSpeed = lac.GetEx<double>(JsonKeys.DriverData_Lookahead_MinSpeed).KMPHtoMeterPerSecond(), + MinSpeed = minSpeed, LookaheadDistanceFactor = distanceScalingFactor, CoastingDecisionFactorOffset = lacDfOffset, CoastingDecisionFactorScaling = lacDfScaling,