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
19 /** SSR Update interval.
20 * <p>
21 * Using the indicator parsed in the RTCM message, this
22 * class provides the SSR update interval in seconds.
23 * </p>
24 * @author Bryan Cazabonne
25 * @since 12.0
26 */
27 public class SsrUpdateInterval {
28
29 /** SSR update interval indicator. */
30 private final int indicator;
31
32 /**
33 * Constructor.
34 * @param indicator indicator read in the RTCM message
35 */
36 public SsrUpdateInterval(final int indicator) {
37 this.indicator = indicator;
38 }
39
40 /**
41 * Get the update interval.
42 * @return the update interval in seconds
43 */
44 public double getUpdateInterval() {
45 switch (indicator) {
46 case 0 : return 1.0;
47 case 1 : return 2.0;
48 case 2 : return 5.0;
49 case 3 : return 10.0;
50 case 4 : return 15.0;
51 case 5 : return 30.0;
52 case 6 : return 60.0;
53 case 7 : return 120.0;
54 case 8 : return 240.0;
55 case 9 : return 300.0;
56 case 10 : return 600.0;
57 case 11 : return 900.0;
58 case 12 : return 1800.0;
59 case 13 : return 3600.0;
60 case 14 : return 7200.0;
61 default : return 10800.0;
62 }
63 }
64
65 }