Class FieldEventsLogger<T extends CalculusFieldElement<T>>
- java.lang.Object
-
- org.orekit.propagation.events.FieldEventsLogger<T>
-
- Type Parameters:
T
- type of the field elements
public class FieldEventsLogger<T extends CalculusFieldElement<T>> extends Object
This class logs events detectors events during propagation.As
events detectors
are triggered during orbit propagation, an event specificeventOccurred
method is called. This class can be used to add a global logging feature registering all events with their corresponding states in a chronological sequence (or reverse-chronological if propagation occurs backward).This class works by wrapping user-provided
events detectors
before they are registered to the propagator. The wrapper monitor the calls toeventOccurred
and store the corresponding events asFieldEventsLogger.FieldLoggedEvent
instances. After propagation is complete, the user can retrieve all the events that have occurred at once by calling methodgetLoggedEvents()
.- Author:
- Luc Maisonobe
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FieldEventsLogger.FieldLoggedEvent<T extends CalculusFieldElement<T>>
Class for logged events entries.
-
Constructor Summary
Constructors Constructor Description FieldEventsLogger()
Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearLoggedEvents()
Clear the logged events.List<FieldEventsLogger.FieldLoggedEvent<T>>
getLoggedEvents()
Get an immutable copy of the logged events.FieldAbstractDetector<org.orekit.propagation.events.FieldEventsLogger.FieldLoggingWrapper,T>
monitorDetector(FieldEventDetector<T> monitoredDetector)
Monitor an event detector.
-
-
-
Method Detail
-
monitorDetector
public FieldAbstractDetector<org.orekit.propagation.events.FieldEventsLogger.FieldLoggingWrapper,T> monitorDetector(FieldEventDetector<T> monitoredDetector)
Monitor an event detector.In order to monitor an event detector, it must be wrapped thanks to this method as follows:
Propagator propagator = new XyzPropagator(...); EventsLogger logger = new EventsLogger(); FieldEventDetector<T> detector = new UvwDetector(...); propagator.addEventDetector(logger.monitorDetector(detector));
Note that the event detector returned by the
getEventDetector
method inFieldLoggedEvent
instances returned bygetLoggedEvents()
are themonitoredDetector
instances themselves, not the wrapping detector returned by this method.- Parameters:
monitoredDetector
- event detector to monitor- Returns:
- the wrapping detector to add to the propagator
-
clearLoggedEvents
public void clearLoggedEvents()
Clear the logged events.
-
getLoggedEvents
public List<FieldEventsLogger.FieldLoggedEvent<T>> getLoggedEvents()
Get an immutable copy of the logged events.The copy is independent of the logger. It is preserved event if the
clearLoggedEvents
method is called and the logger reused in another propagation.- Returns:
- an immutable copy of the logged events
-
-