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

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

gearbox: reset shift-lock (up/donw/up down/up/down) if drivingbehavior changes

at-gearbox: provide additional information in response
parent 4faafe2d
No related branches found
No related tags found
No related merge requests found
......@@ -458,6 +458,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
TorqueOutDemand = 0.SI<NewtonMeter>(), // outTorque,
PowerRequest = 0.SI<Watt>(), // outAngularVelocity;
DynamicFullLoadPower = 0.SI<Watt>(),
DynamicFullLoadTorque = 0.SI<NewtonMeter>(),
DragPower = 0.SI<Watt>(),
DragTorque = 0.SI<NewtonMeter>(),
EngineSpeed = 0.RPMtoRad(),
......@@ -480,6 +481,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
TorqueOutDemand = 0.SI<NewtonMeter>(), // outTorque,
PowerRequest = 0.SI<Watt>(), // outAngularVelocity;
DynamicFullLoadPower = 0.SI<Watt>(),
DynamicFullLoadTorque = 0.SI<NewtonMeter>(),
DragPower = 0.SI<Watt>(),
DragTorque = 0.SI<NewtonMeter>(),
EngineSpeed = 0.RPMtoRad(),
......
......@@ -281,6 +281,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return RequestGearDisengaged(absTime, dt, outTorque, outAngularVelocity, inTorque, dryRun);
}
if (!dryRun) {
CurrentState.DrivingBehavior = DataBus.DriverInfo.DriverBehavior;
}
return GearEngaged(absTime)
? RequestGearEngaged(absTime, dt, outTorque, outAngularVelocity, inTorque, inTorqueLossResult,
inertiaTorqueLossOut, dryRun)
......@@ -531,6 +535,20 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
_overrideDisengage = null;
}
if (PreviousState.DrivingBehavior != CurrentState.DrivingBehavior) {
Log.Debug("driving action changed...");
if (CurrentState.DrivingBehavior == DrivingBehavior.Driving ||
CurrentState.DrivingBehavior == DrivingBehavior.Braking) {
if (GearEngaged(time)) {
Log.Debug("resetting gearshift time interval");
LastDownshift = -double.MaxValue.SI<Second>();
LastUpshift = -double.MaxValue.SI<Second>();
} else {
CurrentState.DrivingBehavior = PreviousState.DrivingBehavior;
}
}
}
base.DoCommitSimulationStep(time, simulationInterval);
}
......
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