LegacyNavigationMessage.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.orekit.gnss.SatelliteSystem;
  20. import org.orekit.time.TimeScales;

  21. /**
  22.  * Container for data contained in a GPS/QZNSS legacy navigation message.
  23.  * @param <O> type of the orbital elements
  24.  * @author Bryan Cazabonne
  25.  * @since 11.0
  26.  */
  27. public abstract class LegacyNavigationMessage<O extends LegacyNavigationMessage<O>>
  28.     extends AbstractNavigationMessage<O>
  29.     implements GNSSClockElements {

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

  32.     /** Issue of Data, Ephemeris. */
  33.     private int iode;

  34.     /** Issue of Data, Clock. */
  35.     private int iodc;

  36.     /** The user SV accuracy (m). */
  37.     private double svAccuracy;

  38.     /** Satellite health status. */
  39.     private int svHealth;

  40.     /** Fit interval.
  41.      * @since 12.0
  42.      */
  43.     private int fitInterval;

  44.     /**
  45.      * Constructor.
  46.      * @param mu Earth's universal gravitational parameter
  47.      * @param angularVelocity mean angular velocity of the Earth for the GNSS model
  48.      * @param weeksInCycle number of weeks in the GNSS cycle
  49.      * @param timeScales known time scales
  50.      * @param system          satellite system to consider for interpreting week number
  51.      *                        (may be different from real system, for example in Rinex nav, weeks
  52.      *                        are always according to GPS)
  53.      */
  54.     protected LegacyNavigationMessage(final double mu, final double angularVelocity, final int weeksInCycle,
  55.                                       final TimeScales timeScales, final SatelliteSystem system) {
  56.         super(mu, angularVelocity, weeksInCycle, timeScales, system);
  57.     }

  58.     /** Constructor from field instance.
  59.      * @param <T> type of the field elements
  60.      * @param <A> type of the orbital elements (non-field version)
  61.      * @param original regular field instance
  62.      */
  63.     protected <T extends CalculusFieldElement<T>, A extends LegacyNavigationMessage<A>>
  64.         LegacyNavigationMessage(final FieldLegacyNavigationMessage<T, A> original) {
  65.         super(original);
  66.         setIODE(original.getIODE());
  67.         setIODC(original.getIODC());
  68.         setSvAccuracy(original.getSvAccuracy().getReal());
  69.         setSvHealth(original.getSvHealth());
  70.         setFitInterval(original.getFitInterval());
  71.     }

  72.     /**
  73.      * Getter for the Issue Of Data Ephemeris (IODE).
  74.      * @return the Issue Of Data Ephemeris (IODE)
  75.      */
  76.     public int getIODE() {
  77.         return iode;
  78.     }

  79.     /**
  80.      * Setter for the Issue of Data Ephemeris.
  81.      * @param value the IODE to set
  82.      */
  83.     public void setIODE(final double value) {
  84.         // The value is given as a floating number in the navigation message
  85.         this.iode = (int) value;
  86.     }

  87.     /**
  88.      * Getter for the Issue Of Data Clock (IODC).
  89.      * @return the Issue Of Data Clock (IODC)
  90.      */
  91.     public int getIODC() {
  92.         return iodc;
  93.     }

  94.     /**
  95.      * Setter for the Issue of Data Clock.
  96.      * @param value the IODC to set
  97.      */
  98.     public void setIODC(final int value) {
  99.         this.iodc = value;
  100.     }

  101.     /**
  102.      * Getter for the user SV accuray (meters).
  103.      * @return the user SV accuracy
  104.      */
  105.     public double getSvAccuracy() {
  106.         return svAccuracy;
  107.     }

  108.     /**
  109.      * Setter for the user SV accuracy.
  110.      * @param svAccuracy the value to set
  111.      */
  112.     public void setSvAccuracy(final double svAccuracy) {
  113.         this.svAccuracy = svAccuracy;
  114.     }

  115.     /**
  116.      * Getter for the satellite health status.
  117.      * @return the satellite health status
  118.      */
  119.     public int getSvHealth() {
  120.         return svHealth;
  121.     }

  122.     /**
  123.      * Setter for the satellite health status.
  124.      * @param svHealth the value to set
  125.      */
  126.     public void setSvHealth(final int svHealth) {
  127.         this.svHealth = svHealth;
  128.     }

  129.     /**
  130.      * Getter for the fit interval.
  131.      * @return the fit interval
  132.      * @since 12.0
  133.      */
  134.     public int getFitInterval() {
  135.         return fitInterval;
  136.     }

  137.     /**
  138.      * Setter for the fit interval.
  139.      * @param fitInterval fit interval
  140.      * @since 12.0
  141.      */
  142.     public void setFitInterval(final int fitInterval) {
  143.         this.fitInterval = fitInterval;
  144.     }

  145. }