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

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

gearbox: when halted: engage gear

parent ba1ea634
No related branches found
No related tags found
No related merge requests found
...@@ -138,7 +138,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -138,7 +138,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var dt = Constants.SimulationSettings.TargetTimeInterval; var dt = Constants.SimulationSettings.TargetTimeInterval;
// MK 2016-02-10: SI doesn't allow inifinity anymore -- therefore simply a very negative value is used. // MK 2016-02-10: SI doesn't allow inifinity anymore -- therefore simply a very negative value is used.
_engageTime = -1e10.SI<Second>(); //double.NegativeInfinity.SI<Second>(); _engageTime = -double.MaxValue.SI<Second>(); //double.NegativeInfinity.SI<Second>();
if (Disengaged) { if (Disengaged) {
Gear = _strategy.InitGear(absTime, dt, outTorque, outAngularVelocity); Gear = _strategy.InitGear(absTime, dt, outTorque, outAngularVelocity);
...@@ -326,7 +326,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -326,7 +326,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
if (dryRun) { if (dryRun) {
if ((DataBus.DriverBehavior == DrivingBehavior.Braking || DataBus.DriverBehavior == DrivingBehavior.Coasting) && if ((DataBus.DriverBehavior == DrivingBehavior.Braking || DataBus.DriverBehavior == DrivingBehavior.Coasting) &&
inAngularVelocity < DataBus.EngineIdleSpeed && DataBus.VehicleSpeed < Constants.SimulationSettings.VehicleStopClutchDisengageSpeed) { inAngularVelocity < DataBus.EngineIdleSpeed &&
DataBus.VehicleSpeed < Constants.SimulationSettings.VehicleStopClutchDisengageSpeed) {
Disengaged = true; Disengaged = true;
_engageTime = absTime + dt; _engageTime = absTime + dt;
_strategy.Disengage(absTime, dt, outTorque, outAngularVelocity); _strategy.Disengage(absTime, dt, outTorque, outAngularVelocity);
...@@ -347,7 +348,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -347,7 +348,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
if (shiftRequired) { if (shiftRequired) {
_engageTime = absTime + ModelData.TractionInterruption; _engageTime = absTime + ModelData.TractionInterruption;
Log.Debug("Gearbox is shifting. absTime: {0}, dt: {1}, interuptionTime: {2}, out: ({3}, {4}), in: ({5}, {6})", absTime, Log.Debug("Gearbox is shifting. absTime: {0}, dt: {1}, interuptionTime: {2}, out: ({3}, {4}), in: ({5}, {6})",
absTime,
dt, _engageTime, outTorque, outAngularVelocity, inTorque, inAngularVelocity); dt, _engageTime, outTorque, outAngularVelocity, inTorque, inAngularVelocity);
Disengaged = true; Disengaged = true;
...@@ -427,7 +429,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -427,7 +429,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
} }
} }
} }
if (DataBus.VehicleStopped) {
Disengaged = false;
_engageTime = -double.MaxValue.SI<Second>();
}
AdvanceState(); AdvanceState();
} }
......
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