Rtcm1044Data.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.gnss.metric.messages.rtcm.ephemeris;

  18. import org.orekit.annotation.DefaultDataContext;
  19. import org.orekit.data.DataContext;
  20. import org.orekit.gnss.SatelliteSystem;
  21. import org.orekit.propagation.analytical.gnss.GNSSPropagator;
  22. import org.orekit.propagation.analytical.gnss.data.QZSSLegacyNavigationMessage;
  23. import org.orekit.time.GNSSDate;
  24. import org.orekit.time.TimeScales;

  25. /**
  26.  * Container for RTCM 1044 data.
  27.  * @author Bryan Cazabonne
  28.  * @since 11.0
  29.  */
  30. public class Rtcm1044Data extends RtcmEphemerisData {

  31.     /** QZSS navigation message. */
  32.     private QZSSLegacyNavigationMessage qzssNavigationMessage;

  33.     /** QZSS Time of clock. */
  34.     private double qzssToc;

  35.     /** QZSS code on L2 Channel. */
  36.     private int qzssCodeOnL2;

  37.     /** QZSS fit interval. */
  38.     private int qzssFitInterval;

  39.     /** Constructor. */
  40.     public Rtcm1044Data() {
  41.         // Nothing to do ...
  42.     }

  43.     /**
  44.      * Get the QZSS navigation message corresponding to the current RTCM data.
  45.      * <p>
  46.      * This object can be used to initialize a {@link GNSSPropagator}
  47.      * <p>
  48.      * This method uses the {@link DataContext#getDefault()} to initialize
  49.      * the time scales used to configure the reference epochs of the navigation
  50.      * message.
  51.      *
  52.      * @return the QZSS navigation message
  53.      */
  54.     @DefaultDataContext
  55.     public QZSSLegacyNavigationMessage getQzssNavigationMessage() {
  56.         return getQzssNavigationMessage(DataContext.getDefault().getTimeScales());
  57.     }

  58.     /**
  59.      * Get the QZSS navigation message corresponding to the current RTCM data.
  60.      * <p>
  61.      * This object can be used to initialize a {@link GNSSPropagator}
  62.      * <p>
  63.      * When calling this method, the reference epochs of the navigation message
  64.      * (i.e. ephemeris and clock epochs) are initialized using the provided time scales.
  65.      *
  66.      * @param timeScales time scales to use for initializing epochs
  67.      * @return the QZSS navigation message
  68.      */
  69.     public QZSSLegacyNavigationMessage getQzssNavigationMessage(final TimeScales timeScales) {

  70.         // Satellite system
  71.         final SatelliteSystem system = SatelliteSystem.QZSS;

  72.         // Week number and time of ephemeris
  73.         final int    week = qzssNavigationMessage.getWeek();

  74.         // Set the ephemeris reference data
  75.         qzssNavigationMessage.setEpochToc(new GNSSDate(week, qzssToc, system, timeScales).getDate());

  76.         // Return the navigation message
  77.         return qzssNavigationMessage;

  78.     }

  79.     /**
  80.      * Set the QZSS navigation message.
  81.      * @param qzssNavigationMessage the QZSS navigation message to set
  82.      */
  83.     public void setQzssNavigationMessage(final QZSSLegacyNavigationMessage qzssNavigationMessage) {
  84.         this.qzssNavigationMessage = qzssNavigationMessage;
  85.     }

  86.     /**
  87.      * Get the QZSS time of clock.
  88.      * <p>
  89.      * The QZSS time of clock is given in seconds since
  90.      * the beginning of the QZSS week.
  91.      * </p>
  92.      * @return the QZSS time of clock
  93.      */
  94.     public double getQzssToc() {
  95.         return qzssToc;
  96.     }

  97.     /**
  98.      * Set the QZSS time of clock.
  99.      * @param toc the time of clock to set
  100.      */
  101.     public void setQzssToc(final double toc) {
  102.         this.qzssToc = toc;
  103.     }

  104.     /**
  105.      * Get the QZSS code on L2 Channel.
  106.      * @return the QZSS code on L2
  107.      */
  108.     public int getQzssCodeOnL2() {
  109.         return qzssCodeOnL2;
  110.     }

  111.     /**
  112.      * Set the QZSS code on L2.
  113.      * @param qzssCodeOnL2 the code to set
  114.      */
  115.     public void setQzssCodeOnL2(final int qzssCodeOnL2) {
  116.         this.qzssCodeOnL2 = qzssCodeOnL2;
  117.     }

  118.     /**
  119.      * Get the QZSS fit interval.
  120.      * @return the QZSS fit interval
  121.      */
  122.     public int getQzssFitInterval() {
  123.         return qzssFitInterval;
  124.     }

  125.     /**
  126.      * Set the QZSS fit interval.
  127.      * @param qzssFitInterval the QZSS fit interval to set
  128.      */
  129.     public void setQzssFitInterval(final int qzssFitInterval) {
  130.         this.qzssFitInterval = qzssFitInterval;
  131.     }

  132. }