diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATGearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATGearbox.cs index 6a03bfbc994d6e216054d6c87ec1ad9daec5cc64..cc0d2460aadc869b943a43eff59324cf19e81453 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATGearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATGearbox.cs @@ -52,7 +52,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl private IIdleController _idleController; protected bool _requestAfterGearshift; - public bool TorqueConverterLocked { + public bool TorqueConverterLocked + { get { return CurrentState.TorqueConverterLocked; } set { CurrentState.TorqueConverterLocked = value; } } @@ -68,7 +69,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl engineInertia); } - public IIdleController IdleController { + public IIdleController IdleController + { get { return _idleController; } set { _idleController = value; @@ -76,7 +78,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl } } - public bool Disengaged { + public bool Disengaged + { get { return CurrentState.Disengaged; } set { CurrentState.Disengaged = value; } } @@ -87,7 +90,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl TorqueConverter.NextComponent = other; } - public override GearInfo NextGear { + public override GearInfo NextGear + { get { return _strategy.NextGear; } } @@ -278,13 +282,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl if (!CurrentState.TorqueConverterLocked) { return TorqueConverter.Request(absTime, dt, inTorque, inAngularVelocity, dryRun); } - if (!dryRun && + var retVal = NextComponent.Request(absTime, dt, inTorque, inAngularVelocity, dryRun); + if (!dryRun && retVal is ResponseSuccess && _strategy.ShiftRequired(absTime, dt, outTorque, outAngularVelocity, inTorque, inAngularVelocity, Gear, LastShift)) { return new ResponseGearShift { Source = this }; } - return NextComponent.Request(absTime, dt, inTorque, inAngularVelocity, dryRun); + return retVal; } private IResponse RequestDisengaged(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs index 716a7d3ba243125436867c7717fcbbe65b7e8e1f..4c089544125cab152bfd18e4652b7fb8e3df72e3 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs @@ -129,11 +129,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl // normal request var ratio = Gearbox.GetGearData(Gearbox.Gear).TorqueConverterRatio; - // check if shift is required - if (ShiftStrategy.ShiftRequired(absTime, dt, outTorque * ratio, outAngularVelocity / ratio, inTorque, - operatingPoint.InAngularVelocity, Gearbox.Gear, Gearbox.LastShift)) { - return new ResponseGearShift { Source = this }; - } // check if out-side of the operating point is equal to requested values if (!outAngularVelocity.IsEqual(operatingPoint.OutAngularVelocity) || !outTorque.IsEqual(operatingPoint.OutTorque)) { @@ -152,6 +147,13 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl CurrentState.OperatingPoint = operatingPoint; var retVal = NextComponent.Request(absTime, dt, inTorque, operatingPoint.InAngularVelocity); + + // check if shift is required + if (retVal is ResponseSuccess && + ShiftStrategy.ShiftRequired(absTime, dt, outTorque * ratio, outAngularVelocity / ratio, inTorque, + operatingPoint.InAngularVelocity, Gearbox.Gear, Gearbox.LastShift)) { + return new ResponseGearShift { Source = this }; + } return retVal; }