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

Skip to content
Snippets Groups Projects
Commit 455136a9 authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

fix null-reference exception in case a torque converter is used when the...

fix null-reference exception in case a torque converter is used when the engine speed is too high (set deltaEngineSpeed field)
parent fe12821d
No related branches found
No related tags found
No related merge requests found
......@@ -163,6 +163,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
// dry run request
var engineResponse = (ResponseDryRun)
NextComponent.Request(absTime, dt, inTorque, operatingPoint.InAngularVelocity, true);
var maxEngineSpeed = DataBus.EngineN95hSpeed;
var engineOK = engineResponse.DeltaDragLoad.IsGreaterOrEqual(0) && engineResponse.DeltaFullLoad.IsSmallerOrEqual(0);
if (DataBus.DriverBehavior != DrivingBehavior.Braking && engineOK && operatingPoint.Creeping) {
......@@ -172,6 +173,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
Source = this,
DeltaFullLoad = delta,
DeltaDragLoad = delta,
DeltaEngineSpeed = operatingPoint.InAngularVelocity - maxEngineSpeed,
TorqueConverterOperatingPoint = operatingPoint,
EngineTorqueDemand = inTorque,
EngineSpeed = engineResponse.EngineSpeed,
......@@ -201,6 +203,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
Source = this,
DeltaFullLoad = 10 * deltaMax,
DeltaDragLoad = 10 * deltaMin,
DeltaEngineSpeed = dryOperatingPointMax.InAngularVelocity - maxEngineSpeed,
TorqueConverterOperatingPoint = dryOperatingPointMax,
EngineTorqueDemand = inTorque,
EngineSpeed = dryOperatingPointMax?.InAngularVelocity ?? dryOperatingPointMin?.InAngularVelocity ?? 0.RPMtoRad(),
......
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