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 6c3dbc5b authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

allow empty list of cycles

parent ef51a7b2
No related branches found
No related tags found
No related merge requests found
...@@ -318,6 +318,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON ...@@ -318,6 +318,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
get get
{ {
var retVal = new List<ICycleData>(); var retVal = new List<ICycleData>();
if (Body[JsonKeys.Job_Cycles] == null) {
return retVal;
}
foreach (var cycle in Body.GetEx(JsonKeys.Job_Cycles)) { foreach (var cycle in Body.GetEx(JsonKeys.Job_Cycles)) {
//.Select(cycle => //.Select(cycle =>
var cycleFile = Path.Combine(BasePath, cycle.Value<string>()); var cycleFile = Path.Combine(BasePath, cycle.Value<string>());
...@@ -409,10 +412,13 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON ...@@ -409,10 +412,13 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
? ReadTableData(lac.GetEx<string>("Df_velocityDropLookup"), ? ReadTableData(lac.GetEx<string>("Df_velocityDropLookup"),
"Lookahead Coasting Decisionfactor - Velocity drop", false) "Lookahead Coasting Decisionfactor - Velocity drop", false)
: null; : null;
var minSpeed = lac["MinSpeed"] != null
? lac.GetEx<double>(JsonKeys.DriverData_Lookahead_MinSpeed).KMPHtoMeterPerSecond()
: DeclarationData.Driver.LookAhead.MinimumSpeed;
return new LookAheadCoastingInputData() { return new LookAheadCoastingInputData() {
Enabled = lac.GetEx<bool>(JsonKeys.DriverData_Lookahead_Enabled), Enabled = lac.GetEx<bool>(JsonKeys.DriverData_Lookahead_Enabled),
//Deceleration = lac.GetEx<double>(JsonKeys.DriverData_Lookahead_Deceleration).SI<MeterPerSquareSecond>(), //Deceleration = lac.GetEx<double>(JsonKeys.DriverData_Lookahead_Deceleration).SI<MeterPerSquareSecond>(),
MinSpeed = lac.GetEx<double>(JsonKeys.DriverData_Lookahead_MinSpeed).KMPHtoMeterPerSecond(), MinSpeed = minSpeed,
LookaheadDistanceFactor = distanceScalingFactor, LookaheadDistanceFactor = distanceScalingFactor,
CoastingDecisionFactorOffset = lacDfOffset, CoastingDecisionFactorOffset = lacDfOffset,
CoastingDecisionFactorScaling = lacDfScaling, CoastingDecisionFactorScaling = lacDfScaling,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment