1   /* Copyright 2022-2025 Romain Serra
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  
18  package org.orekit.forces.maneuvers.trigger;
19  
20  import org.hipparchus.CalculusFieldElement;
21  import org.orekit.propagation.events.FieldDetectorModifier;
22  import org.orekit.propagation.events.FieldEventDetector;
23  import org.orekit.propagation.events.handlers.FieldEventHandler;
24  
25  /**
26   * Wrapper for event detection triggering maneuvers (Field version).
27   *
28   * @see AbstractManeuverTriggers
29   * @see ManeuverTriggerDetector
30   * @author Romain Serra
31   * @since 13.0
32   */
33  public class FieldManeuverTriggerDetector<W extends CalculusFieldElement<W>, T extends FieldEventDetector<W>>
34          implements FieldDetectorModifier<W> {
35  
36      /** Prototype detector. */
37      private final T detector;
38  
39      /** Event handler. */
40      private final FieldEventHandler<W> handler;
41  
42      /**
43       * Constructor.
44       * @param detector prototype detector
45       * @param handler event handler
46       */
47      public FieldManeuverTriggerDetector(final T detector, final FieldEventHandler<W> handler) {
48          this.detector = detector;
49          this.handler = handler;
50      }
51  
52      @Override
53      public T getDetector() {
54          return detector;
55      }
56  
57      @Override
58      public FieldEventHandler<W> getHandler() {
59          return handler;
60      }
61  }