Commit d07c800d authored by Luc Maisonobe's avatar Luc Maisonobe
Browse files

EventsLogger.LoggedEvent is now TimeStamped, so it can be sorted.

parent 41dc49ad
Pipeline #1207 passed with stages
in 22 minutes and 4 seconds
......@@ -23,6 +23,7 @@ import org.hipparchus.ode.events.Action;
import org.orekit.propagation.SpacecraftState;
import org.orekit.propagation.events.handlers.EventHandler;
import org.orekit.time.AbsoluteDate;
import org.orekit.time.TimeStamped;
/** This class logs events detectors events during propagation.
*
......@@ -102,7 +103,7 @@ public class EventsLogger {
}
/** Class for logged events entries. */
public static class LoggedEvent {
public static class LoggedEvent implements TimeStamped {
/** Event detector triggered. */
private final EventDetector detector;
......@@ -132,6 +133,12 @@ public class EventsLogger {
return detector;
}
/** {@inheritDoc} */
@Override
public AbsoluteDate getDate() {
return state.getDate();
}
/** Get the triggering state.
* @return triggering state
* @see EventDetector#eventOccurred(SpacecraftState, boolean)
......
......@@ -291,6 +291,7 @@ public class PositionAngleDetectorTest {
SpacecraftState state = e.getState();
orbitType.mapOrbitToArray(state.getOrbit(), positionAngle, array, null);
Assert.assertEquals(angle, MathUtils.normalizeAngle(array[5], angle), 1.0e-10);
Assert.assertEquals(state.getDate(), e.getDate());
}
Assert.assertEquals(expectedCrossings, logger.getLoggedEvents().size());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment