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

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

handle the case that there is no next braketrigger speed

parent 60336af3
No related branches found
No related tags found
No related merge requests found
......@@ -1459,6 +1459,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
public PCCStates PCCState => DriverStrategy.PCCState;
public MeterPerSecond NextBrakeTriggerSpeed => DriverStrategy.BrakeTrigger.NextTargetSpeed;
public MeterPerSecond NextBrakeTriggerSpeed => DriverStrategy.BrakeTrigger?.NextTargetSpeed;
}
}
\ No newline at end of file
......@@ -1053,7 +1053,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
// hint: only check for halting speed if vehicle is actually braking to halt.
var vehiclespeedBelowThreshold = DataBus.VehicleInfo.VehicleSpeed.IsSmaller(disengageSpeedThreshold)
&& DataBus.DriverInfo.NextBrakeTriggerSpeed.IsEqual(0);
&& (DataBus.DriverInfo.NextBrakeTriggerSpeed?.IsEqual(0) ?? false);
if (ElectricMotorCanPropellDuringTractionInterruption || DataBus.GearboxInfo.GearEngaged(absTime)) {
......@@ -1378,7 +1378,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
// only disengage if we are actually braking for halting (meaning: next brake trigger speed is 0).
if (DataBus.GearboxInfo.GearboxType.ManualTransmission()
&& DataBus.DriverInfo.NextBrakeTriggerSpeed.IsEqual(0)
&& (DataBus.DriverInfo.NextBrakeTriggerSpeed?.IsEqual(0) ?? false)
&& endSpeed.IsSmallerOrEqual(ModelData.GearboxData.DisengageWhenHaltingSpeed, 0.1.KMPHtoMeterPerSecond())) {
return new GearshiftPosition(0);
}
......
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