1 /* Copyright 2002-2025 CS GROUP
2 * Licensed to CS GROUP (CS) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * CS licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17 package org.orekit.forces.maneuvers.trigger;
18
19 import org.hipparchus.CalculusFieldElement;
20 import org.orekit.propagation.FieldSpacecraftState;
21 import org.orekit.time.FieldAbsoluteDate;
22
23 /** Resetter for maneuver triggers.
24 * @param <T> type of the field elements
25 * @see AbstractManeuverTriggers
26 * @author Luc Maisonobe
27 * @since 11.1
28 */
29 public interface FieldManeuverTriggersResetter<T extends CalculusFieldElement<T>> {
30
31 /** Initialization method called at propagation start.
32 * <p>
33 * The default implementation does nothing.
34 * </p>
35 * @param initialState initial spacecraft state (at the start of propagation).
36 * @param target date of propagation. Not equal to {@code initialState.getDate()}.
37 */
38 default void init(FieldSpacecraftState<T> initialState, FieldAbsoluteDate<T> target) {
39 // nothing by default
40 }
41
42 /** Observe a maneuver trigger.
43 * <p>
44 * The {@code start} parameter corresponds to physical flow of time
45 * from past to future, not to propagation direction which can be backward.
46 * This means that during forward propagations, the first call will have
47 * {@code start} set to {@code true} and the second call will have
48 * {@code start} set to {@code false}, whereas in backward propagation,
49 * the first call will have {@code start} set to {@code false} and the second
50 * call will have {@code start} set to {@code true}.
51 * </p>
52 * @param state spacecraft state at trigger date (before applying the maneuver)
53 * @param start if true, the trigger is the start of the maneuver
54 */
55 void maneuverTriggered(FieldSpacecraftState<T> state, boolean start);
56
57 /** Reset state as a maneuver triggers.
58 * @param state spacecraft state at trigger date
59 * @return reset state taking into account maneuver start/stop
60 */
61 FieldSpacecraftState<T> resetState(FieldSpacecraftState<T> state);
62
63 }