diff --git a/VectoCore/Models/SimulationComponent/Impl/DummyRetarder.cs b/VectoCore/Models/SimulationComponent/Impl/DummyRetarder.cs index 9f6b849e22ba87850268b1ef2caff442f7c7ca11..437f1bba9406f3c980627d013e995aac83193d8a 100644 --- a/VectoCore/Models/SimulationComponent/Impl/DummyRetarder.cs +++ b/VectoCore/Models/SimulationComponent/Impl/DummyRetarder.cs @@ -7,7 +7,8 @@ using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.Models.SimulationComponent.Impl { - public class DummyRetarder : VectoSimulationComponent, IPowerTrainComponent, ITnInPort, ITnOutPort + public class DummyRetarder : StatefulVectoSimulationComponent<SimpleComponentState>, IPowerTrainComponent, ITnInPort, + ITnOutPort { protected ITnOutPort NextComponent; @@ -30,19 +31,26 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public IResponse Request(Second absTime, Second dt, NewtonMeter torque, PerSecond angularVelocity, bool dryRun = false) { + CurrentState.SetState(torque, angularVelocity, torque, angularVelocity); return NextComponent.Request(absTime, dt, torque, angularVelocity, dryRun); } public IResponse Initialize(NewtonMeter torque, PerSecond angularVelocity) { + PreviousState.SetState(torque, angularVelocity, torque, angularVelocity); return NextComponent.Initialize(torque, angularVelocity); } protected override void DoWriteModalResults(IModalDataContainer container) { container[ModalResultField.P_ret_loss] = 0.SI<Watt>(); + container[ModalResultField.P_retarder_in] = CurrentState.InTorque * + (CurrentState.InAngularVelocity + PreviousState.InAngularVelocity) / 2.0; } - protected override void DoCommitSimulationStep() {} + protected override void DoCommitSimulationStep() + { + AdvanceState(); + } } } \ No newline at end of file