FieldNavicL1NVNavigationMessage.java

  1. /* Copyright 2022-2025 Luc Maisonobe
  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.propagation.analytical.gnss.data;

  18. import org.hipparchus.CalculusFieldElement;
  19. import org.hipparchus.Field;

  20. import java.util.function.Function;

  21. /**
  22.  * Container for data contained in a NavIC navigation message.
  23.  * @param <T> type of the field elements
  24.  * @author Luc Maisonobe
  25.  * @since 13.0
  26.  */
  27. public class FieldNavicL1NVNavigationMessage<T extends CalculusFieldElement<T>>
  28.     extends FieldCivilianNavigationMessage<T, NavICL1NVNavigationMessage> {

  29.     /** Reference signal flag. */
  30.     private int referenceSignalFlag;

  31.     /** Estimated group delay differential TGD for S-L5 correction. */
  32.     private T tgdSL5;

  33.     /** Inter Signal Delay for S L1P. */
  34.     private T iscSL1P;

  35.     /** Inter Signal Delay for L1D L1P. */
  36.     private T iscL1DL1P;

  37.     /** Inter Signal Delay for L1P S. */
  38.     private T iscL1PS;

  39.     /** Inter Signal Delay for L1DS. */
  40.     private T iscL1DS;

  41.     /** Constructor from non-field instance.
  42.      * @param field    field to which elements belong
  43.      * @param original regular non-field instance
  44.      */
  45.     public FieldNavicL1NVNavigationMessage(final Field<T> field, final NavICL1NVNavigationMessage original) {
  46.         super(field, original);
  47.         setReferenceSignalFlag(original.getReferenceSignalFlag());
  48.         setTGDSL5(field.getZero().newInstance(original.getTGDSL5()));
  49.         setIscSL1P(field.getZero().newInstance(original.getIscSL1P()));
  50.         setIscL1DL1P(field.getZero().newInstance(original.getIscL1DL1P()));
  51.         setIscL1PS(field.getZero().newInstance(original.getIscL1PS()));
  52.         setIscL1DS(field.getZero().newInstance(original.getIscL1DS()));
  53.     }

  54.     /** Constructor from different field instance.
  55.      * @param <V> type of the old field elements
  56.      * @param original regular non-field instance
  57.      * @param converter for field elements
  58.      */
  59.     public <V extends CalculusFieldElement<V>> FieldNavicL1NVNavigationMessage(final Function<V, T> converter,
  60.                                                                                final FieldNavicL1NVNavigationMessage<V> original) {
  61.         super(converter, original);
  62.         setReferenceSignalFlag(original.getReferenceSignalFlag());
  63.         setTGDSL5(converter.apply(original.getTGDSL5()));
  64.         setIscSL1P(converter.apply(original.getIscSL1P()));
  65.         setIscL1DL1P(converter.apply(original.getIscL1DL1P()));
  66.         setIscL1PS(converter.apply(original.getIscL1PS()));
  67.         setIscL1DS(converter.apply(original.getIscL1DS()));
  68.     }

  69.     /** {@inheritDoc} */
  70.     @Override
  71.     public NavICL1NVNavigationMessage toNonField() {
  72.         return new NavICL1NVNavigationMessage(this);
  73.     }

  74.     /** {@inheritDoc} */
  75.     @SuppressWarnings("unchecked")
  76.     @Override
  77.     public <U extends CalculusFieldElement<U>, G extends FieldGnssOrbitalElements<U, NavICL1NVNavigationMessage>>
  78.         G changeField(final Function<T, U> converter) {
  79.         return (G) new FieldNavicL1NVNavigationMessage<>(converter, this);
  80.     }

  81.     /** Set reference signal flag.
  82.      * @param referenceSignalFlag reference signal flag
  83.      */
  84.     public void setReferenceSignalFlag(final int referenceSignalFlag) {
  85.         this.referenceSignalFlag = referenceSignalFlag;
  86.     }

  87.     /** Get reference signal flag.
  88.      * @return reference signal flag
  89.      */
  90.     public int getReferenceSignalFlag() {
  91.         return referenceSignalFlag;
  92.     }

  93.     /**
  94.      * Set the estimated group delay differential TGD for S-L5 correction.
  95.      * @param groupDelayDifferential the estimated group delay differential TGD for S-L3 correction (s)
  96.      */
  97.     public void setTGDSL5(final T groupDelayDifferential) {
  98.         this.tgdSL5 = groupDelayDifferential;
  99.     }

  100.     /**
  101.      * Set the estimated group delay differential TGD for S-L5 correction.
  102.      * @return estimated group delay differential TGD for S-L3 correction (s)
  103.      */
  104.     public T getTGDSL5() {
  105.         return tgdSL5;
  106.     }

  107.     /**
  108.      * Getter for inter Signal Delay for S L1P.
  109.      * @return inter signal delay
  110.      */
  111.     public T getIscSL1P() {
  112.         return iscSL1P;
  113.     }

  114.     /**
  115.      * Setter for inter Signal Delay for S L1P.
  116.      * @param delay delay to set
  117.      */
  118.     public void setIscSL1P(final T delay) {
  119.         this.iscSL1P = delay;
  120.     }

  121.     /**
  122.      * Getter for inter Signal Delay for L1D L1P.
  123.      * @return inter signal delay
  124.      */
  125.     public T getIscL1DL1P() {
  126.         return iscL1DL1P;
  127.     }

  128.     /**
  129.      * Setter for inter Signal Delay for L1D L1P.
  130.      * @param delay delay to set
  131.      */
  132.     public void setIscL1DL1P(final T delay) {
  133.         this.iscL1DL1P = delay;
  134.     }

  135.     /**
  136.      * Getter for inter Signal Delay for L1P S.
  137.      * @return inter signal delay
  138.      */
  139.     public T getIscL1PS() {
  140.         return iscL1PS;
  141.     }

  142.     /**
  143.      * Setter for inter Signal Delay for L1P S.
  144.      * @param delay delay to set
  145.      */
  146.     public void setIscL1PS(final T delay) {
  147.         this.iscL1PS = delay;
  148.     }

  149.     /**
  150.      * Getter for inter Signal Delay for L1D S.
  151.      * @return inter signal delay
  152.      */
  153.     public T getIscL1DS() {
  154.         return iscL1DS;
  155.     }

  156.     /**
  157.      * Setter for inter Signal Delay for L1D S.
  158.      * @param delay delay to set
  159.      */
  160.     public void setIscL1DS(final T delay) {
  161.         this.iscL1DS = delay;
  162.     }

  163. }