diff --git a/VectoCore/VectoCore/Models/Simulation/DataBus/IGearboxInfo.cs b/VectoCore/VectoCore/Models/Simulation/DataBus/IGearboxInfo.cs index 696f0a97976c9c4817f098fd54f0d1255afbb29c..729ba79c92c770c54d0a8540820250eda37b61de 100644 --- a/VectoCore/VectoCore/Models/Simulation/DataBus/IGearboxInfo.cs +++ b/VectoCore/VectoCore/Models/Simulation/DataBus/IGearboxInfo.cs @@ -70,6 +70,8 @@ namespace TUGraz.VectoCore.Models.Simulation.DataBus uint NumGears { get; } bool DisengageGearbox { get; } + + bool GearEngaged(Second absTime); } public interface IGearboxControl diff --git a/VectoCore/VectoCore/Models/SimulationComponent/IGearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/IGearbox.cs index f5ad30ef34cb2c5f6b16d1071632f1567e8ad403..07db48aae44fdddea2c074637981a0dbf56cfd50 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/IGearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/IGearbox.cs @@ -36,5 +36,5 @@ namespace TUGraz.VectoCore.Models.SimulationComponent /// <summary> /// Defines interfaces for a gearbox. /// </summary> - public interface IGearbox : IPowerTrainComponent, IGearboxInfo, IGearboxControl { } + public interface IGearbox : IPowerTrainComponent, IGearboxInfo, IGearboxControl, IHybridControlledGearbox { } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/SimulationComponent/IHybridControlStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/IHybridControlStrategy.cs new file mode 100644 index 0000000000000000000000000000000000000000..ff09dec5eeddf0904ee715b7438248cd76639750 --- /dev/null +++ b/VectoCore/VectoCore/Models/SimulationComponent/IHybridControlStrategy.cs @@ -0,0 +1,7 @@ +namespace TUGraz.VectoCore.Models.SimulationComponent +{ + public interface IHybridControlStrategy + { + + } +} \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/SimulationComponent/IHybridControlledGearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/IHybridControlledGearbox.cs new file mode 100644 index 0000000000000000000000000000000000000000..74b4199371b6fe4f468960c1e670ef04af5db363 --- /dev/null +++ b/VectoCore/VectoCore/Models/SimulationComponent/IHybridControlledGearbox.cs @@ -0,0 +1,7 @@ +namespace TUGraz.VectoCore.Models.SimulationComponent +{ + public interface IHybridControlledGearbox + { + bool SwitchToNeutral { set; } + } +} \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/SimulationComponent/IShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/IShiftStrategy.cs index b339ecfc8e4945ba81ba0ea362a20fa1dfcc15ce..9d27262594459b96504b540e380397ec1daa3406 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/IShiftStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/IShiftStrategy.cs @@ -98,6 +98,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent IGearbox Gearbox { get; set; } GearInfo NextGear { get; } + + bool CheckGearshiftRequired { get; } + void Request(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity); void WriteModalResults(IModalDataContainer container); diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategy.cs index 98b0fe6bc26b1afd6eb1290c79e84a52b61404db..968000af4f7ce7a0309442713e394754763b5217 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategy.cs @@ -109,7 +109,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl continue; } - if (!IsBelowDownShiftCurve(gear, response.Engine.EnginePowerRequest / response.Engine.EngineSpeed, response.Engine.EngineSpeed)) { + if (!IsBelowDownShiftCurve(gear, response.Engine.PowerRequest / response.Engine.EngineSpeed, response.Engine.EngineSpeed)) { _gearbox.TorqueConverterLocked = torqueConverterLocked; _gearbox.Disengaged = false; return gear; @@ -140,7 +140,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl throw new System.NotImplementedException("AT Shift Strategy does not support disengaging."); } - public override bool ShiftRequired( + protected override bool DoCheckShiftRequired( Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, NewtonMeter inTorque, PerSecond inAngularVelocity, uint gear, Second lastShiftTime, IResponse response) { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategyVoith.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategyVoith.cs index bb191d72353b50a65bb8d4c4c5d750045d0b5513..324783f7abbfa6132215f889567ca469aab56a25 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategyVoith.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATShiftStrategyVoith.cs @@ -163,7 +163,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl base.Request(absTime, dt, outTorque, outAngularVelocity); } - public override bool ShiftRequired( + protected override bool DoCheckShiftRequired( Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, NewtonMeter inTorque, PerSecond inAngularVelocity, uint gear, Second lastShiftTime, IResponse response) { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AbstractGearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AbstractGearbox.cs index 01c67375f7ca108531cb621e3edf6a7cecdad035..a8d2514eb0e41a49bbedc76bcaee11c26320e56b 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AbstractGearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AbstractGearbox.cs @@ -43,8 +43,7 @@ using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox; namespace TUGraz.VectoCore.Models.SimulationComponent.Impl { public abstract class AbstractGearbox<TStateType> : - StatefulProviderComponent<TStateType, ITnOutPort, ITnInPort, ITnOutPort>, ITnOutPort, ITnInPort, IGearbox, - IClutchInfo + StatefulProviderComponent<TStateType, ITnOutPort, ITnInPort, ITnOutPort>, ITnOutPort, ITnInPort, IGearbox where TStateType : GearboxState, new() { /// <summary> @@ -130,7 +129,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl #endregion - public abstract bool ClutchClosed(Second absTime); + public abstract bool GearEngaged(Second absTime); protected bool ConsiderShiftLosses(GearInfo nextGear, NewtonMeter torqueOut) { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/BaseShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/BaseShiftStrategy.cs index 1cb40d344553a2930e7da2dbedd80a58525810a8..466bd6c03dd913380c0f6da7085bfb37900d5ab6 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/BaseShiftStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/BaseShiftStrategy.cs @@ -54,13 +54,27 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl DataBus = dataBus; } - public abstract bool ShiftRequired(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, NewtonMeter inTorque, PerSecond inAngularVelocity, uint gear, Second lastShiftTime, IResponse response); + public virtual bool ShiftRequired(Second absTime, Second dt, NewtonMeter outTorque, + PerSecond outAngularVelocity, NewtonMeter inTorque, PerSecond inAngularVelocity, uint gear, + Second lastShiftTime, IResponse response) + { + CheckGearshiftRequired = true; + var retVal = DoCheckShiftRequired(absTime, dt, outTorque, outAngularVelocity, inTorque, inAngularVelocity, gear, lastShiftTime, response); + CheckGearshiftRequired = false; + return retVal; + } + + public abstract bool DoCheckShiftRequired(Second absTime, Second dt, NewtonMeter outTorque, + PerSecond outAngularVelocity, NewtonMeter inTorque, PerSecond inAngularVelocity, uint gear, + Second lastShiftTime, IResponse response); public abstract uint InitGear(Second absTime, Second dt, NewtonMeter torque, PerSecond outAngularVelocity); public abstract uint Engage(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity); public abstract void Disengage(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outEngineSpeed); public abstract IGearbox Gearbox { get; set; } public abstract GearInfo NextGear { get; } + + public bool CheckGearshiftRequired { get; protected set; } public virtual void Request(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity) { } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/VTPGearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/VTPGearbox.cs index 44e34722436cb851d3e775ccc1ef4befb2240bb3..24fa947cb45714ed307d4786ff899a53613d57e1 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/VTPGearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/VTPGearbox.cs @@ -44,7 +44,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return DataBus.CycleData.LeftSample.Gear; } - public override bool ClutchClosed(Second absTime) + public override bool GearEngaged(Second absTime) { return DataBus.CycleData.LeftSample.Gear != 0; } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs new file mode 100644 index 0000000000000000000000000000000000000000..54a0e185c70bac772953fce08802a0a7e8b9fb9c --- /dev/null +++ b/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs @@ -0,0 +1,7 @@ +namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies +{ + public class HybridStrategy + { + + } +} \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/SimulationComponent/SwitchableClutch.cs b/VectoCore/VectoCore/Models/SimulationComponent/SwitchableClutch.cs new file mode 100644 index 0000000000000000000000000000000000000000..4775ebeed4112d74d0835a01f2aad2e702a8e2cc --- /dev/null +++ b/VectoCore/VectoCore/Models/SimulationComponent/SwitchableClutch.cs @@ -0,0 +1,7 @@ +namespace TUGraz.VectoCore.Models.SimulationComponent +{ + public class SwitchableClutch + { + + } +} \ No newline at end of file