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.     /** Health identifier.
  37.      * @since 14.0
  38.      */
  39.     private int satH1;

  40.     /** B1/B3 Group Delay Differential (s). */
  41.     private double tgd1;

  42.     /** B2/B3 Group Delay Differential (s). */
  43.     private double tgd2;

  44.     /** The user SV accuracy (m). */
  45.     private double svAccuracy;

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

  59.     /** Constructor from field instance.
  60.      * @param <T> type of the field elements
  61.      * @param original regular field instance
  62.      */
  63.     public <T extends CalculusFieldElement<T>> BeidouLegacyNavigationMessage(final FieldBeidouLegacyNavigationMessage<T> original) {
  64.         super(original);
  65.         setAODE(original.getAODE());
  66.         setAODC(original.getAODC());
  67.         setTGD1(original.getTGD1().getReal());
  68.         setTGD2(original.getTGD2().getReal());
  69.         setSvAccuracy(original.getSvAccuracy().getReal());
  70.         setSatH1(original.getSatH1());
  71.     }

  72.     /** {@inheritDoc} */
  73.     @SuppressWarnings("unchecked")
  74.     @Override
  75.     public <T extends CalculusFieldElement<T>, F extends FieldGnssOrbitalElements<T, BeidouLegacyNavigationMessage>>
  76.         F toField(final Field<T> field) {
  77.         return (F) new FieldBeidouLegacyNavigationMessage<>(field, this);
  78.     }

  79.     /**
  80.      * Getter for the Age Of Data Clock (AODC).
  81.      * @return the Age Of Data Clock (AODC)
  82.      */
  83.     public int getAODC() {
  84.         return aodc;
  85.     }

  86.     /**
  87.      * Setter for the age of data clock.
  88.      * @param aod the age of data to set
  89.      */
  90.     public void setAODC(final double aod) {
  91.         // The value is given as a floating number in the navigation message
  92.         this.aodc = (int) aod;
  93.     }

  94.     /**
  95.      * Getter for the Age Of Data Ephemeris (AODE).
  96.      * @return the Age Of Data Ephemeris (AODE)
  97.      */
  98.     public int getAODE() {
  99.         return aode;
  100.     }

  101.     /**
  102.      * Setter for the age of data ephemeris.
  103.      * @param aod the age of data to set
  104.      */
  105.     public void setAODE(final double aod) {
  106.         // The value is given as a floating number in the navigation message
  107.         this.aode = (int) aod;
  108.     }

  109.     /**
  110.      * Getter for the estimated group delay differential TGD1 for B1I signal.
  111.      * @return the estimated group delay differential TGD1 for B1I signal (s)
  112.      */
  113.     public double getTGD1() {
  114.         return tgd1;
  115.     }

  116.     /**
  117.      * Setter for the B1/B3 Group Delay Differential (s).
  118.      * @param tgd the group delay differential to set
  119.      */
  120.     public void setTGD1(final double tgd) {
  121.         this.tgd1 = tgd;
  122.     }

  123.     /**
  124.      * Getter for the estimated group delay differential TGD for B2I signal.
  125.      * @return the estimated group delay differential TGD2 for B2I signal (s)
  126.      */
  127.     public double getTGD2() {
  128.         return tgd2;
  129.     }

  130.     /**
  131.      * Setter for the B2/B3 Group Delay Differential (s).
  132.      * @param tgd the group delay differential to set
  133.      */
  134.     public void setTGD2(final double tgd) {
  135.         this.tgd2 = tgd;
  136.     }

  137.     /**
  138.      * Getter for the user SV accuray (meters).
  139.      * @return the user SV accuracy
  140.      */
  141.     public double getSvAccuracy() {
  142.         return svAccuracy;
  143.     }

  144.     /**
  145.      * Setter for the user SV accuracy.
  146.      * @param svAccuracy the value to set
  147.      */
  148.     public void setSvAccuracy(final double svAccuracy) {
  149.         this.svAccuracy = svAccuracy;
  150.     }

  151.     /** Get the health identifier.
  152.      * @return health identifier
  153.      * @since 14.0
  154.      */
  155.     public int getSatH1() {
  156.         return satH1;
  157.     }

  158.     /** Set the health identifier.
  159.      * @param satH1 health identifier
  160.      * @since 14.0
  161.      */
  162.     public void setSatH1(final int satH1) {
  163.         this.satH1 = satH1;
  164.     }

  165. }