Class StartStopEventsTrigger<A extends AbstractDetector<A>,O extends AbstractDetector<O>>
- java.lang.Object
-
- org.orekit.forces.maneuvers.trigger.AbstractManeuverTriggers
-
- org.orekit.forces.maneuvers.trigger.StartStopEventsTrigger<A,O>
-
- Type Parameters:
A
- type of the start detectorO
- type of the stop detector
- All Implemented Interfaces:
ManeuverTriggers
- Direct Known Subclasses:
PythonStartStopEventsTrigger
public abstract class StartStopEventsTrigger<A extends AbstractDetector<A>,O extends AbstractDetector<O>> extends AbstractManeuverTriggers
Maneuver triggers based on a pair of event detectors that defines firing start and stop.The thruster starts firing when the start detector becomes positive. The thruster stops firing when the stop detector becomes positive. The 2 detectors should not be positive at the same time. A date detector is not suited as it does not delimit an interval. They can be both negative at the same time.
- Since:
- 11.1
- Author:
- Luc Maisonobe
- See Also:
IntervalEventTrigger
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
StartStopEventsTrigger(A prototypeStartDetector, O prototypeStopDetector)
Simple constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract <D extends FieldEventDetector<S>,S extends CalculusFieldElement<S>>
FieldAbstractDetector<D,S>convertStartDetector(Field<S> field, A detector)
Convert a primitive firing start detector into a field firing start detector.protected abstract <D extends FieldEventDetector<S>,S extends CalculusFieldElement<S>>
FieldAbstractDetector<D,S>convertStopDetector(Field<S> field, O detector)
Convert a primitive firing stop detector into a field firing stop detector.Stream<EventDetector>
getEventsDetectors()
Get the event detectors associated with the triggers.<S extends CalculusFieldElement<S>>
Stream<FieldEventDetector<S>>getFieldEventsDetectors(Field<S> field)
Get the event detectors associated with the triggers.A
getStartDetector()
Getter for the firing start detector.O
getStopDetector()
Getter for the firing stop detector.protected boolean
isFiringOnInitialState(SpacecraftState initialState, boolean isForward)
Method to check if the thruster is firing on initialization.-
Methods inherited from class org.orekit.forces.maneuvers.trigger.AbstractManeuverTriggers
addResetter, addResetter, applyResetters, applyResetters, getFirings, init, init, initializeResetters, initializeResetters, isFiring, isFiring, notifyResetters, notifyResetters
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.orekit.forces.maneuvers.trigger.ManeuverTriggers
getName, getParametersDrivers
-
-
-
-
Constructor Detail
-
StartStopEventsTrigger
protected StartStopEventsTrigger(A prototypeStartDetector, O prototypeStopDetector)
Simple constructor.Note that the
startDetector
andstopDetector
passed as an argument are used only as a prototypes from which new detectors will be built using theirwithHandler
methods to set up internal handlers. The original event handlers from the prototype will be ignored and never called.If the trigger is used in a
field-based propagation
, the detector will be automatically converted to a field equivalent. Beware however that theeventOccurred
of the converted propagator will call the method with the same name in the prototype detector, in order to get the correct return value.- Parameters:
prototypeStartDetector
- prototype detector for firing startprototypeStopDetector
- prototype detector for firing stop
-
-
Method Detail
-
getStartDetector
public A getStartDetector()
Getter for the firing start detector.- Returns:
- firing start detector
-
getStopDetector
public O getStopDetector()
Getter for the firing stop detector.- Returns:
- firing stop detector
-
isFiringOnInitialState
protected boolean isFiringOnInitialState(SpacecraftState initialState, boolean isForward)
Method to check if the thruster is firing on initialization. can be called by sub classes- Specified by:
isFiringOnInitialState
in classAbstractManeuverTriggers
- Parameters:
initialState
- initial spacecraft stateisForward
- if true, propagation will be in the forward direction- Returns:
- true if firing in propagation direction
-
getEventsDetectors
public Stream<EventDetector> getEventsDetectors()
Get the event detectors associated with the triggers.- Returns:
- the event detectors
-
getFieldEventsDetectors
public <S extends CalculusFieldElement<S>> Stream<FieldEventDetector<S>> getFieldEventsDetectors(Field<S> field)
Get the event detectors associated with the triggers.- Type Parameters:
S
- type of the field elements- Parameters:
field
- field to which the state belongs- Returns:
- the event detectors
-
convertStartDetector
protected abstract <D extends FieldEventDetector<S>,S extends CalculusFieldElement<S>> FieldAbstractDetector<D,S> convertStartDetector(Field<S> field, A detector)
Convert a primitive firing start detector into a field firing start detector.There is not need to set up
withMaxCheck
,withThreshold
, orwithHandler
in the converted detector, this will be done by caller.A skeleton implementation of this method to convert some
XyzDetector
intoFieldXyzDetector
, considering these detectors are created from a date and a number parameter is:protected <D extends FieldEventDetector<S>, S extends CalculusFieldElement<S>> FieldAbstractDetector<D, S> convertStartDetector(final Field<S> field, final XyzDetector detector) { final FieldAbsoluteDate<S> date = new FieldAbsoluteDate<>(field, detector.getDate()); final S param = field.getZero().newInstance(detector.getParam()); final FieldAbstractDetector<D, S> converted = (FieldAbstractDetector<D, S>) new FieldXyzDetector<>(date, param); return converted; }
- Type Parameters:
D
- type of the event detectorS
- type of the field elements- Parameters:
field
- field to which the state belongsdetector
- primitive firing start detector to convert- Returns:
- converted firing start detector
-
convertStopDetector
protected abstract <D extends FieldEventDetector<S>,S extends CalculusFieldElement<S>> FieldAbstractDetector<D,S> convertStopDetector(Field<S> field, O detector)
Convert a primitive firing stop detector into a field firing stop detector.There is not need to set up
withMaxCheck
,withThreshold
, orwithHandler
in the converted detector, this will be done by caller.A skeleton implementation of this method to convert some
XyzDetector
intoFieldXyzDetector
, considering these detectors are created from a date and a number parameter is:protected <D extends FieldEventDetector<S>, S extends CalculusFieldElement<S>> FieldAbstractDetector<D, S> convertStopDetector(final Field<S> field, final XyzDetector detector) { final FieldAbsoluteDate<S> date = new FieldAbsoluteDate<>(field, detector.getDate()); final S param = field.getZero().newInstance(detector.getParam()); final FieldAbstractDetector<D, S> converted = (FieldAbstractDetector<D, S>) new FieldXyzDetector<>(date, param); return converted; }
- Type Parameters:
D
- type of the event detectorS
- type of the field elements- Parameters:
field
- field to which the state belongsdetector
- primitive firing stop detector to convert- Returns:
- converted firing stop detector
-
-