1   /* Copyright 2022-2026 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      /** Message type.
33       * @since 14.0
34       */
35      public static final String L1NV = "L1NV";
36  
37      /** Reference signal flag. */
38      private int referenceSignalFlag;
39  
40      /** User Range Accuracy Index.
41       * @since 14.0
42       */
43      private int urai;
44  
45      /** L1 SPS health.
46       * @since 14.0
47       */
48      private int l1SpsHealth;
49  
50      /** Estimated group delay differential TGD for S-L5 correction. */
51      private double tgdSL5;
52  
53      /** Inter Signal Delay for S L1P. */
54      private double iscSL1P;
55  
56      /** Inter Signal Delay for L1D L1P. */
57      private double iscL1DL1P;
58  
59      /** Inter Signal Delay for L1P S. */
60      private double iscL1PS;
61  
62      /** Inter Signal Delay for L1DS. */
63      private double iscL1DS;
64  
65      /** Constructor.
66       * @param timeScales known time scales
67       * @param system     satellite system to consider for interpreting week number
68       *                   (may be different from real system, for example in Rinex nav, weeks
69       *                   are always according to GPS)
70       * @param type       message type
71       */
72      public NavICL1NvNavigationMessage(final TimeScales timeScales, final SatelliteSystem system,
73                                        final String type) {
74          super(true, GNSSConstants.NAVIC_MU, GNSSConstants.NAVIC_AV, GNSSConstants.NAVIC_WEEK_NB,
75                timeScales, system, type);
76      }
77  
78      /** Constructor from field instance.
79       * @param <T> type of the field elements
80       * @param original regular field instance
81       */
82      public <T extends CalculusFieldElement<T>> NavICL1NvNavigationMessage(final FieldNavicL1NvNavigationMessage<T> original) {
83          super(original);
84          setReferenceSignalFlag(original.getReferenceSignalFlag());
85          setUrai(original.getUrai());
86          setL1SpsHealth(original.getL1SpsHealth());
87          setTGDSL5(original.getTGDSL5().getReal());
88          setIscSL1P(original.getIscSL1P().getReal());
89          setIscL1DL1P(original.getIscL1DL1P().getReal());
90          setIscL1PS(original.getIscL1PS().getReal());
91          setIscL1DS(original.getIscL1DS().getReal());
92      }
93  
94      /** {@inheritDoc} */
95      @SuppressWarnings("unchecked")
96      @Override
97      public <T extends CalculusFieldElement<T>, F extends FieldGnssOrbitalElements<T, NavICL1NvNavigationMessage>>
98          F toField(final Field<T> field) {
99          return (F) new FieldNavicL1NvNavigationMessage<>(field, this);
100     }
101 
102     /** Set reference signal flag.
103      * @param referenceSignalFlag reference signal flag
104      */
105     public void setReferenceSignalFlag(final int referenceSignalFlag) {
106         this.referenceSignalFlag = referenceSignalFlag;
107     }
108 
109     /** Get reference signal flag.
110      * @return reference signal flag
111      */
112     public int getReferenceSignalFlag() {
113         return referenceSignalFlag;
114     }
115 
116     /** Set User Range Accuracy Index.
117      * @param urai User Range Accuracy Index
118      * @since 14.0
119      */
120     public void setUrai(final int urai) {
121         this.urai = urai;
122     }
123 
124     /** Get User Range Accuracy Index.
125      * @return User Range Accuracy Index
126      * @since 14.0
127      */
128     public int getUrai() {
129         return urai;
130     }
131 
132     /** Set L1 SPS health.
133      * @param l1SpsHealth L1 SPS health
134      * @since 14.0
135      */
136     public void setL1SpsHealth(final int l1SpsHealth) {
137         this.l1SpsHealth = l1SpsHealth;
138     }
139 
140     /** Get L1 SPS health.
141      * @return L1 SPS health
142      * @since 14.0
143      */
144     public int getL1SpsHealth() {
145         return l1SpsHealth;
146     }
147 
148     /**
149      * Set the estimated group delay differential TGD for S-L5 correction.
150      * @param groupDelayDifferential the estimated group delay differential TGD for S-L3 correction (s)
151      */
152     public void setTGDSL5(final double groupDelayDifferential) {
153         this.tgdSL5 = groupDelayDifferential;
154     }
155 
156     /**
157      * Set the estimated group delay differential TGD for S-L5 correction.
158      * @return estimated group delay differential TGD for S-L3 correction (s)
159      */
160     public double getTGDSL5() {
161         return tgdSL5;
162     }
163 
164     /**
165      * Getter for inter Signal Delay for S L1P.
166      * @return inter signal delay
167      */
168     public double getIscSL1P() {
169         return iscSL1P;
170     }
171 
172     /**
173      * Setter for inter Signal Delay for S L1P.
174      * @param delay delay to set
175      */
176     public void setIscSL1P(final double delay) {
177         this.iscSL1P = delay;
178     }
179 
180     /**
181      * Getter for inter Signal Delay for L1D L1P.
182      * @return inter signal delay
183      */
184     public double getIscL1DL1P() {
185         return iscL1DL1P;
186     }
187 
188     /**
189      * Setter for inter Signal Delay for L1D L1P.
190      * @param delay delay to set
191      */
192     public void setIscL1DL1P(final double delay) {
193         this.iscL1DL1P = delay;
194     }
195 
196     /**
197      * Getter for inter Signal Delay for L1P S.
198      * @return inter signal delay
199      */
200     public double getIscL1PS() {
201         return iscL1PS;
202     }
203 
204     /**
205      * Setter for inter Signal Delay for L1P S.
206      * @param delay delay to set
207      */
208     public void setIscL1PS(final double delay) {
209         this.iscL1PS = delay;
210     }
211 
212     /**
213      * Getter for inter Signal Delay for L1D S.
214      * @return inter signal delay
215      */
216     public double getIscL1DS() {
217         return iscL1DS;
218     }
219 
220     /**
221      * Setter for inter Signal Delay for L1D S.
222      * @param delay delay to set
223      */
224     public void setIscL1DS(final double delay) {
225         this.iscL1DS = delay;
226     }
227 
228 }