SsrUpdateInterval.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.common;

  18. /** SSR Update interval.
  19.  * <p>
  20.  * Using the indicator parsed in the RTCM message, this
  21.  * class provides the SSR update interval in seconds.
  22.  * </p>
  23.  * @author Bryan Cazabonne
  24.  * @since 12.0
  25.  */
  26. public class SsrUpdateInterval {

  27.     /** SSR update interval indicator. */
  28.     private final int indicator;

  29.     /**
  30.      * Constructor.
  31.      * @param indicator indicator read in the RTCM message
  32.      */
  33.     public SsrUpdateInterval(final int indicator) {
  34.         this.indicator = indicator;
  35.     }

  36.     /**
  37.      * Get the update interval.
  38.      * @return the update interval in seconds
  39.      */
  40.     public double getUpdateInterval() {
  41.         switch (indicator) {
  42.             case 0  : return 1.0;
  43.             case 1  : return 2.0;
  44.             case 2  : return 5.0;
  45.             case 3  : return 10.0;
  46.             case 4  : return 15.0;
  47.             case 5  : return 30.0;
  48.             case 6  : return 60.0;
  49.             case 7  : return 120.0;
  50.             case 8  : return 240.0;
  51.             case 9  : return 300.0;
  52.             case 10 : return 600.0;
  53.             case 11 : return 900.0;
  54.             case 12 : return 1800.0;
  55.             case 13 : return 3600.0;
  56.             case 14 : return 7200.0;
  57.             default : return 10800.0;
  58.         }
  59.     }

  60. }