BeidouLegacyNavigationMessage.java

  1. /* Copyright 2002-2025 CS GROUP
  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 org.orekit.gnss.SatelliteSystem;
  21. import org.orekit.time.TimeScales;

  22. /**
  23.  * Container for data contained in a BeiDou navigation message.
  24.  * @author Bryan Cazabonne
  25.  * @since 11.0
  26.  */
  27. public class BeidouLegacyNavigationMessage extends AbstractNavigationMessage<BeidouLegacyNavigationMessage> {

  28.     /** Identifier for message type. */
  29.     public static final String D1 = "D1";

  30.     /** Identifier for message type. */
  31.     public static final String D2 = "D2";

  32.     /** Age of Data, Ephemeris. */
  33.     private int aode;

  34.     /** Age of Data, Clock. */
  35.     private int aodc;

  36.     /** B1/B3 Group Delay Differential (s). */
  37.     private double tgd1;

  38.     /** B2/B3 Group Delay Differential (s). */
  39.     private double tgd2;

  40.     /** The user SV accuracy (m). */
  41.     private double svAccuracy;

  42.     /** Constructor.
  43.      * @param timeScales known time scales
  44.      * @param system     satellite system to consider for interpreting week number
  45.      *                   (may be different from real system, for example in Rinex nav, weeks
  46.      *                   are always according to GPS)
  47.      */
  48.     public BeidouLegacyNavigationMessage(final TimeScales timeScales,
  49.                                          final SatelliteSystem system) {
  50.         super(GNSSConstants.BEIDOU_MU, GNSSConstants.BEIDOU_AV, GNSSConstants.BEIDOU_WEEK_NB,
  51.               timeScales, system);
  52.     }

  53.     /** Constructor from field instance.
  54.      * @param <T> type of the field elements
  55.      * @param original regular field instance
  56.      */
  57.     public <T extends CalculusFieldElement<T>> BeidouLegacyNavigationMessage(final FieldBeidouLegacyNavigationMessage<T> original) {
  58.         super(original);
  59.         setAODE(original.getAODE());
  60.         setAODC(original.getAODC());
  61.         setTGD1(original.getTGD1().getReal());
  62.         setTGD2(original.getTGD2().getReal());
  63.         setSvAccuracy(original.getSvAccuracy().getReal());
  64.     }

  65.     /** {@inheritDoc} */
  66.     @SuppressWarnings("unchecked")
  67.     @Override
  68.     public <T extends CalculusFieldElement<T>, F extends FieldGnssOrbitalElements<T, BeidouLegacyNavigationMessage>>
  69.         F toField(final Field<T> field) {
  70.         return (F) new FieldBeidouLegacyNavigationMessage<>(field, this);
  71.     }

  72.     /**
  73.      * Getter for the Age Of Data Clock (AODC).
  74.      * @return the Age Of Data Clock (AODC)
  75.      */
  76.     public int getAODC() {
  77.         return aodc;
  78.     }

  79.     /**
  80.      * Setter for the age of data clock.
  81.      * @param aod the age of data to set
  82.      */
  83.     public void setAODC(final double aod) {
  84.         // The value is given as a floating number in the navigation message
  85.         this.aodc = (int) aod;
  86.     }

  87.     /**
  88.      * Getter for the Age Of Data Ephemeris (AODE).
  89.      * @return the Age Of Data Ephemeris (AODE)
  90.      */
  91.     public int getAODE() {
  92.         return aode;
  93.     }

  94.     /**
  95.      * Setter for the age of data ephemeris.
  96.      * @param aod the age of data to set
  97.      */
  98.     public void setAODE(final double aod) {
  99.         // The value is given as a floating number in the navigation message
  100.         this.aode = (int) aod;
  101.     }

  102.     /**
  103.      * Getter for the estimated group delay differential TGD1 for B1I signal.
  104.      * @return the estimated group delay differential TGD1 for B1I signal (s)
  105.      */
  106.     public double getTGD1() {
  107.         return tgd1;
  108.     }

  109.     /**
  110.      * Setter for the B1/B3 Group Delay Differential (s).
  111.      * @param tgd the group delay differential to set
  112.      */
  113.     public void setTGD1(final double tgd) {
  114.         this.tgd1 = tgd;
  115.     }

  116.     /**
  117.      * Getter for the estimated group delay differential TGD for B2I signal.
  118.      * @return the estimated group delay differential TGD2 for B2I signal (s)
  119.      */
  120.     public double getTGD2() {
  121.         return tgd2;
  122.     }

  123.     /**
  124.      * Setter for the B2/B3 Group Delay Differential (s).
  125.      * @param tgd the group delay differential to set
  126.      */
  127.     public void setTGD2(final double tgd) {
  128.         this.tgd2 = tgd;
  129.     }

  130.     /**
  131.      * Getter for the user SV accuray (meters).
  132.      * @return the user SV accuracy
  133.      */
  134.     public double getSvAccuracy() {
  135.         return svAccuracy;
  136.     }

  137.     /**
  138.      * Setter for the user SV accuracy.
  139.      * @param svAccuracy the value to set
  140.      */
  141.     public void setSvAccuracy(final double svAccuracy) {
  142.         this.svAccuracy = svAccuracy;
  143.     }

  144. }