1   /* Copyright 2022-2025 Thales Alenia Space
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.orekit.frames.Frame;
20  import org.orekit.gnss.SatelliteSystem;
21  import org.orekit.time.TimeScales;
22  
23  /**
24   * Factory for {@link BeidouCivilianNavigationMessage}.
25   * @author Luc Maisonobe
26   * @since 14.0
27   */
28  public class BeidouCivilianNavigationMessageFactory
29      extends AbstractNavigationMessageFactory<BeidouCivilianNavigationMessage> {
30  
31      /** Beidou civilian message type. */
32      private final BeidouCivilianType beidouType;
33  
34      /** Satellite type. */
35      private BeidouSatelliteType satelliteType;
36  
37      /** Issue of Data, Ephemeris. */
38      private int iode;
39  
40      /** Issue of Data, Clock. */
41      private int iodc;
42  
43      /** Inter Signal Delay for B1 CD. */
44      private double iscB1CD;
45  
46      /** Inter Signal Delay for B1 CP. */
47      private double iscB1CP;
48  
49      /** Inter Signal Delay for B2 AD. */
50      private double iscB2AD;
51  
52      /** Signal In Space Accuracy Index (along track and across track). */
53      private int sisaiOe;
54  
55      /** Signal In Space Accuracy Index (radial and clock). */
56      private int sisaiOcb;
57  
58      /** Signal In Space Accuracy Index (clock drift accuracy). */
59      private int sisaiOc1;
60  
61      /** Signal In Space Accuracy Index (clock drift rate accuracy). */
62      private int sisaiOc2;
63  
64      /** Signal In Space Monitoring Accuracy Index. */
65      private int sismai;
66  
67      /** Health. */
68      private int health;
69  
70      /** Integrity flags. */
71      private int integrityFlags;
72  
73      /** B1/B3 Group Delay Differential (s). */
74      private double tgdB1Cp;
75  
76      /** B2 AP Group Delay Differential (s). */
77      private double tgdB2ap;
78  
79      /** B2B_i / B3I Group Delay Differential (s). */
80      private double tgdB2bI;
81  
82      /** Simple constructor.
83       * @param timeScales    known time scales
84       * @param system        satellite system to use for interpreting week number
85       * @param type          message type (null if not a navigation message)
86       * @param inertial      reference inertial frame
87       * @param bodyFixed     body fixed frame (will be frozen at {@code date} to build the orbital elements
88       * @param beidouType    Beidou civilian message type
89       * @param satelliteType satellite type
90       */
91      public BeidouCivilianNavigationMessageFactory(final TimeScales timeScales, final SatelliteSystem system,
92                                                    final String type, final Frame inertial, final Frame bodyFixed,
93                                                    final BeidouCivilianType beidouType,
94                                                    final BeidouSatelliteType satelliteType) {
95          super(GNSSConstants.BEIDOU_AV, timeScales, system,
96                type, inertial, bodyFixed, GNSSConstants.BEIDOU_MU);
97          this.beidouType    = beidouType;
98          this.satelliteType = satelliteType;
99      }
100 
101     /** Get the Beidou civilian message type.
102      * @return Beidou civilian message type
103      */
104     public BeidouCivilianType getBeidouType() {
105         return beidouType;
106     }
107 
108     /** Get satellite type.
109      * @return satellite type
110      */
111     public BeidouSatelliteType getSatelliteType() {
112         return satelliteType;
113     }
114 
115     /** Set satellite type.
116      * @param satelliteType  satellite type
117      */
118     public void setSatelliteType(final BeidouSatelliteType satelliteType) {
119         this.satelliteType = satelliteType;
120     }
121 
122     /** Get the Issue Of Data Ephemeris (IODE).
123      * @return the Issue Of Data Ephemeris (IODE)
124      */
125     public int getIode() {
126         return iode;
127     }
128 
129     /** Set the Issue Of Data Ephemeris (IODE).
130      * @param iode the Issue Of Data Ephemeris (IODE)
131      */
132     public void setIode(final int iode) {
133         this.iode = iode;
134     }
135 
136     /** Get the Issue Of Data Clock (IODC).
137      * @return the Issue Of Data Clock (IODC)
138      */
139     public int getIodc() {
140         return iodc;
141     }
142 
143     /** Set the Issue Of Data Clock (IODC).
144      * @param iodc the Issue Of Data Clock (IODC)
145      */
146     public void setIodc(final int iodc) {
147         this.iodc = iodc;
148     }
149 
150     /** Get inter Signal Delay for B1 CD.
151      * @return inter signal delay
152      */
153     public double getIscB1CD() {
154         return iscB1CD;
155     }
156 
157     /** Set inter Signal Delay for B1 CD.
158      * @param iscB1CD inter signal delay
159      */
160     public void setIscB1CD(final double iscB1CD) {
161         this.iscB1CD = iscB1CD;
162     }
163 
164     /** Get inter Signal Delay for B2 AD.
165      * @return inter signal delay
166      */
167     public double getIscB2AD() {
168         return iscB2AD;
169     }
170 
171     /** Set inter Signal Delay for B2 AD.
172      * @param iscB2AD inter signal delay
173      */
174     public void setIscB2AD(final double iscB2AD) {
175         this.iscB2AD = iscB2AD;
176     }
177 
178     /** Get inter Signal Delay for B1 CP.
179      * @return inter signal delay
180      */
181     public double getIscB1CP() {
182         return iscB1CP;
183     }
184 
185     /** Set inter Signal Delay for B1 CP.
186      * @param iscB1CP inter signal delay
187      */
188     public void setIscB1CP(final double iscB1CP) {
189         this.iscB1CP = iscB1CP;
190     }
191 
192     /** Get Signal In Space Accuracy Index (along track and across track).
193      * @return Signal In Space Accuracy Index (along track and across track)
194      */
195     public int getSisaiOe() {
196         return sisaiOe;
197     }
198 
199     /** Set Signal In Space Accuracy Index (along track and across track).
200      * @param sisaiOe Signal In Space Accuracy Index (along track and across track)
201      */
202     public void setSisaiOe(final int sisaiOe) {
203         this.sisaiOe = sisaiOe;
204     }
205 
206     /** Get Signal In Space Accuracy Index (radial and clock).
207      * @return Signal In Space Accuracy Index (radial and clock)
208      */
209     public int getSisaiOcb() {
210         return sisaiOcb;
211     }
212 
213     /** Set Signal In Space Accuracy Index (radial and clock).
214      * @param sisaiOcb Signal In Space Accuracy Index (radial and clock)
215      */
216     public void setSisaiOcb(final int sisaiOcb) {
217         this.sisaiOcb = sisaiOcb;
218     }
219 
220     /** Get Signal In Space Accuracy Index (clock drift accuracy).
221      * @return Signal In Space Accuracy Index (clock drift accuracy)
222      */
223     public int getSisaiOc1() {
224         return sisaiOc1;
225     }
226 
227     /** Set Signal In Space Accuracy Index (clock drift accuracy).
228      * @param sisaiOc1 Signal In Space Accuracy Index (clock drift accuracy)
229      */
230     public void setSisaiOc1(final int sisaiOc1) {
231         this.sisaiOc1 = sisaiOc1;
232     }
233 
234     /** Get Signal In Space Accuracy Index (clock drift rate accuracy).
235      * @return Signal In Space Accuracy Index (clock drift rate accuracy)
236      */
237     public int getSisaiOc2() {
238         return sisaiOc2;
239     }
240 
241     /** Set Signal In Space Accuracy Index (clock drift rate accuracy).
242      * @param sisaiOc2 Signal In Space Accuracy Index (clock drift rate accuracy)
243      */
244     public void setSisaiOc2(final int sisaiOc2) {
245         this.sisaiOc2 = sisaiOc2;
246     }
247 
248     /** Get Signal In Space Monitoring Accuracy Index.
249      * @return Signal In Space Monitoring Accuracy Index
250      */
251     public int getSismai() {
252         return sismai;
253     }
254 
255     /** Set Signal In Space Monitoring Accuracy Index.
256      * @param sismai Signal In Space Monitoring Accuracy Index
257      */
258     public void setSismai(final int sismai) {
259         this.sismai = sismai;
260     }
261 
262     /** Get health.
263      * @return health
264      */
265     public int getHealth() {
266         return health;
267     }
268 
269     /** Set health.
270      * @param health health
271      */
272     public void setHealth(final int health) {
273         this.health = health;
274     }
275 
276     /** Get B1C integrity flags.
277      * @return B1C integrity flags
278      */
279     public int getIntegrityFlags() {
280         return integrityFlags;
281     }
282 
283     /** Set B1C integrity flags.
284      * @param integrityFlags B1C integrity flags
285      */
286     public void setIntegrityFlags(final int integrityFlags) {
287         this.integrityFlags = integrityFlags;
288     }
289 
290     /** Get B1/B3 Group Delay Differential (s).
291      * @return B1/B3 Group Delay Differential (s)
292      */
293     public double getTgdB1Cp() {
294         return tgdB1Cp;
295     }
296 
297     /** Set B1/B3 Group Delay Differential (s).
298      * @param tgdB1Cp B1/B3 Group Delay Differential (s)
299      */
300     public void setTgdB1Cp(final double tgdB1Cp) {
301         this.tgdB1Cp = tgdB1Cp;
302     }
303 
304     /** Get B2 AP Group Delay Differential (s).
305      * @return B2 AP Group Delay Differential (s)
306      */
307     public double getTgdB2ap() {
308         return tgdB2ap;
309     }
310 
311     /** Set B2 AP Group Delay Differential (s).
312      * @param tgdB2ap B2 AP Group Delay Differential (s)
313      */
314     public void setTgdB2ap(final double tgdB2ap) {
315         this.tgdB2ap = tgdB2ap;
316     }
317 
318     /** Get B2B_i / B3I Group Delay Differential (s).
319      * @return B2B_i / B3I Group Delay Differential (s)
320      */
321     public double getTgdB2bI() {
322         return tgdB2bI;
323     }
324 
325     /** Set B2B_i / B3I Group Delay Differential (s).
326      * @param tgdB2bI B2B_i / B3I Group Delay Differential (s)
327      */
328     public void setTgdB2bI(final double tgdB2bI) {
329         this.tgdB2bI = tgdB2bI;
330     }
331 
332     /** {@inheritDoc} */
333     @Override
334     public BeidouCivilianNavigationMessage createFromDrivers() {
335         return new BeidouCivilianNavigationMessage(getBeidouType(),
336                                                    getTimeScales(), getPrn(), getTimeOfEphemeris(),
337                                                    createOrbitFromDrivers(),
338                                                    getADotDriver().getValue(),
339                                                    getDeltaN0Driver().getValue(), getDeltaN0DotDriver().getValue(),
340                                                    getIDotDriver().getValue(), getOmegaDotDriver().getValue(),
341                                                    getCucDriver().getValue(), getCusDriver().getValue(),
342                                                    getCrcDriver().getValue(), getCrsDriver().getValue(),
343                                                    getCicDriver().getValue(), getCisDriver().getValue(),
344                                                    getAf0Driver().getValue(), getAf1Driver().getValue(),
345                                                    getAf2Driver().getValue(),
346                                                    getTgd(), getTimeOfClock(), getTransmissionTime(),
347                                                    getIode(), getIodc(),
348                                                    getIscB1CD(), getIscB1CP(), getIscB2AD(),
349                                                    getSisaiOe(), getSisaiOcb(),
350                                                    getSisaiOc1(), getSisaiOc2(),
351                                                    getSismai(), getHealth(),
352                                                    getIntegrityFlags(),
353                                                    getTgdB1Cp(), getTgdB2ap(), getTgdB2bI(),
354                                                    getSatelliteType());
355     }
356 
357 }