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  
19  import org.hipparchus.CalculusFieldElement;
20  import org.hipparchus.Field;
21  import org.orekit.gnss.SatelliteSystem;
22  import org.orekit.time.TimeScales;
23  
24  /**
25   * Container for data contained in a NavIC navigation message.
26   * @author Luc Maisonobe
27   * @since 13.0
28   */
29  public class NavICL1NVNavigationMessage
30      extends CivilianNavigationMessage<NavICL1NVNavigationMessage> {
31  
32      /** Reference signal flag. */
33      private int referenceSignalFlag;
34  
35      /** Estimated group delay differential TGD for S-L5 correction. */
36      private double tgdSL5;
37  
38      /** Inter Signal Delay for S L1P. */
39      private double iscSL1P;
40  
41      /** Inter Signal Delay for L1D L1P. */
42      private double iscL1DL1P;
43  
44      /** Inter Signal Delay for L1P S. */
45      private double iscL1PS;
46  
47      /** Inter Signal Delay for L1DS. */
48      private double iscL1DS;
49  
50      /** Constructor.
51       * @param timeScales known time scales
52       * @param system     satellite system to consider for interpreting week number
53       *                   (may be different from real system, for example in Rinex nav, weeks
54       *                   are always according to GPS)
55       */
56      public NavICL1NVNavigationMessage(final TimeScales timeScales, final SatelliteSystem system) {
57          super(true, GNSSConstants.NAVIC_MU, GNSSConstants.NAVIC_AV, GNSSConstants.NAVIC_WEEK_NB,
58                timeScales, system);
59      }
60  
61      /** Constructor from field instance.
62       * @param <T> type of the field elements
63       * @param original regular field instance
64       */
65      public <T extends CalculusFieldElement<T>> NavICL1NVNavigationMessage(final FieldNavicL1NVNavigationMessage<T> original) {
66          super(original);
67          setReferenceSignalFlag(original.getReferenceSignalFlag());
68          setTGDSL5(original.getTGDSL5().getReal());
69          setIscSL1P(original.getIscSL1P().getReal());
70          setIscL1DL1P(original.getIscL1DL1P().getReal());
71          setIscL1PS(original.getIscL1PS().getReal());
72          setIscL1DS(original.getIscL1DS().getReal());
73      }
74  
75      /** {@inheritDoc} */
76      @SuppressWarnings("unchecked")
77      @Override
78      public <T extends CalculusFieldElement<T>, F extends FieldGnssOrbitalElements<T, NavICL1NVNavigationMessage>>
79          F toField(final Field<T> field) {
80          return (F) new FieldNavicL1NVNavigationMessage<>(field, this);
81      }
82  
83      /** Set reference signal flag.
84       * @param referenceSignalFlag reference signal flag
85       */
86      public void setReferenceSignalFlag(final int referenceSignalFlag) {
87          this.referenceSignalFlag = referenceSignalFlag;
88      }
89  
90      /** Get reference signal flag.
91       * @return reference signal flag
92       */
93      public int getReferenceSignalFlag() {
94          return referenceSignalFlag;
95      }
96  
97      /**
98       * Set the estimated group delay differential TGD for S-L5 correction.
99       * @param groupDelayDifferential the estimated group delay differential TGD for S-L3 correction (s)
100      */
101     public void setTGDSL5(final double groupDelayDifferential) {
102         this.tgdSL5 = groupDelayDifferential;
103     }
104 
105     /**
106      * Set the estimated group delay differential TGD for S-L5 correction.
107      * @return estimated group delay differential TGD for S-L3 correction (s)
108      */
109     public double getTGDSL5() {
110         return tgdSL5;
111     }
112 
113     /**
114      * Getter for inter Signal Delay for S L1P.
115      * @return inter signal delay
116      */
117     public double getIscSL1P() {
118         return iscSL1P;
119     }
120 
121     /**
122      * Setter for inter Signal Delay for S L1P.
123      * @param delay delay to set
124      */
125     public void setIscSL1P(final double delay) {
126         this.iscSL1P = delay;
127     }
128 
129     /**
130      * Getter for inter Signal Delay for L1D L1P.
131      * @return inter signal delay
132      */
133     public double getIscL1DL1P() {
134         return iscL1DL1P;
135     }
136 
137     /**
138      * Setter for inter Signal Delay for L1D L1P.
139      * @param delay delay to set
140      */
141     public void setIscL1DL1P(final double delay) {
142         this.iscL1DL1P = delay;
143     }
144 
145     /**
146      * Getter for inter Signal Delay for L1P S.
147      * @return inter signal delay
148      */
149     public double getIscL1PS() {
150         return iscL1PS;
151     }
152 
153     /**
154      * Setter for inter Signal Delay for L1P S.
155      * @param delay delay to set
156      */
157     public void setIscL1PS(final double delay) {
158         this.iscL1PS = delay;
159     }
160 
161     /**
162      * Getter for inter Signal Delay for L1D S.
163      * @return inter signal delay
164      */
165     public double getIscL1DS() {
166         return iscL1DS;
167     }
168 
169     /**
170      * Setter for inter Signal Delay for L1D S.
171      * @param delay delay to set
172      */
173     public void setIscL1DS(final double delay) {
174         this.iscL1DS = delay;
175     }
176 
177 }