fr.cnes.sirius.patrius.events
Class CodedEventsLogger

java.lang.Object
  extended by fr.cnes.sirius.patrius.events.CodedEventsLogger

public final class CodedEventsLogger
extends Object

This class logs coded events during propagation. It is based on the EventsLogger class in Orekit.

This class works by wrapping user-provided CodingEventDetector before they are registered to the propagator. The wrapper monitors the calls to eventOccurred and store the corresponding events as CodedEventsLogger.LoggedCodedEvent instances. After propagation is complete, the user can retrieve all the events that have occurred at once by calling methods getCodedEventsList() or getLoggedCodedEventSet().

Since:
1.1
Version:
$Id: CodedEventsLogger.java 14677 2015-11-25 14:52:39Z rodrigues $
Author:
Pierre Cardoso, Tiziana Sabatini
See Also:
EventsLogger, CodingEventDetector
Concurrency :
not thread-safe
Concurrency comment :
no thread-sharing use case was identified for this class, so thread safety is not required.

Nested Class Summary
static class CodedEventsLogger.LoggedCodedEvent
          This class is used to store the coded event with contextual information.
 
Constructor Summary
CodedEventsLogger()
          Default constructor.
 
Method Summary
 Map<CodingEventDetector,CodedEventsList> buildCodedEventListMap()
          Builds a map of CodedEventsList, one list per CodingEventDetector instance.
 Map<CodingEventDetector,PhenomenaList> buildPhenomenaListMap(AbsoluteDateInterval definitionInterval, SpacecraftState duringState)
          Builds a map of PhenomenaList, one list per CodingEventDetector instance.
 CodedEventsList getCodedEventsList()
          Gets the CodedEventsList.
 SortedSet<CodedEventsLogger.LoggedCodedEvent> getLoggedCodedEventSet()
          Returns an unmodifiable view on the set of CodedEventsLogger.LoggedCodedEvent, sorted by date.
 EventDetector monitorDetector(CodingEventDetector detector)
          Takes a CodingEventDetector instance and returns an EventDetector instance that will trigger this CodedEventsLogger every time eventOccurred is called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CodedEventsLogger

public CodedEventsLogger()
Default constructor.

Method Detail

monitorDetector

public EventDetector monitorDetector(CodingEventDetector detector)
Takes a CodingEventDetector instance and returns an EventDetector instance that will trigger this CodedEventsLogger every time eventOccurred is called. The returned EventDetector is meant to be provided to a propagator.

Parameters:
detector - the wrapped CodingEventDetector
Returns:
a wrapper for the parameter, as an EventDetector.

getCodedEventsList

public CodedEventsList getCodedEventsList()
Gets the CodedEventsList. This method can be called after propagation to get the list of detected events.

Returns:
the CodedEventsList.

getLoggedCodedEventSet

public SortedSet<CodedEventsLogger.LoggedCodedEvent> getLoggedCodedEventSet()
Returns an unmodifiable view on the set of CodedEventsLogger.LoggedCodedEvent, sorted by date.

Returns:
the set.

buildCodedEventListMap

public Map<CodingEventDetector,CodedEventsList> buildCodedEventListMap()
Builds a map of CodedEventsList, one list per CodingEventDetector instance.

The map may be empty if no CodingEventDetector was added to the logger.

Returns:
the map. May be empty, if no CodingEventDetector was added.

buildPhenomenaListMap

public Map<CodingEventDetector,PhenomenaList> buildPhenomenaListMap(AbsoluteDateInterval definitionInterval,
                                                                    SpacecraftState duringState)
                                                             throws OrekitException
Builds a map of PhenomenaList, one list per CodingEventDetector instance.

The map may be empty if no CodingEventDetector was added to the logger.

Parameters:
definitionInterval - an AbsoluteDateInterval. May be null; if not, is used to position uncertain boundaries on a Phenomenon.
duringState - a SpacecraftState. May be null; if not, is used to compute a Phenomenon when no event has occurred.
Returns:
the map. May be empty, if no CodingEventDetector handling phenomena was added.
Throws:
OrekitException - if a problem occurs when g is called with the duringState parameter.


Copyright © 2016 CNES. All Rights Reserved.