Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

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

fix PTO cycles: correction reset cycle iterator, correction detect end of...

fix PTO cycles: correction reset cycle iterator, correction detect end of cycle, commit pto cycle only if active
parent 0cf810b7
No related branches found
No related tags found
No related merge requests found
......@@ -217,7 +217,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
private IResponse DriveTimeInterval(Second absTime, Second dt)
{
CurrentState.AbsTime = PreviousState.AbsTime + dt;
CurrentState.AbsTime = absTime;
CurrentState.WaitTime = PreviousState.WaitTime + dt;
CurrentState.Gradient = ComputeGradient(0.SI<Meter>());
CurrentState.VehicleTargetSpeed = Left.VehicleTargetSpeed;
......@@ -250,6 +250,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
retVal = NextComponent.Request(absTime, r.DeltaT, 0.SI<MeterPerSecond>(), CurrentState.Gradient);
retVal = NextComponent.Request(absTime, ds, CurrentState.VehicleTargetSpeed, CurrentState.Gradient);
});
CurrentState.AbsTime = absTime;
return retVal;
}
......
......@@ -99,6 +99,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
public void Reset()
{
_currentCycleIndex = 0;
LastEntry = false;
}
public void Dispose() {}
......
......@@ -96,15 +96,18 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
public void CommitSimulationStep(IModalDataContainer container)
{
_ptoController.CommitSimulationStep(container);
if (_currentController == _ptoController) {
_ptoController.CommitSimulationStep(container);
}
}
public Second Duration
{
get
{
if (_ptoController != null)
if (_ptoController != null) {
return _ptoController.Duration;
}
return 0.SI<Second>();
}
}
......
......@@ -88,7 +88,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
public Second GetNextCycleTime()
{
if (CycleIterator.RightSample == null) {
if (CycleIterator.LastEntry && AbsTime.IsEqual(CycleIterator.RightSample.Time)) {
return null;
}
......
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