1   /* Copyright 2002-2021 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.ssr.igm;
18  
19  import java.util.Collections;
20  import java.util.HashMap;
21  import java.util.Map;
22  
23  /**
24   * Container for SSR IGM05 data.
25   * @author Bryan Cazabonne
26   * @since 11.0
27   */
28  public class SsrIgm05Data extends SsrIgmData {
29  
30      /** Number of biases processed for the current satellite. */
31      private int numberOfBiasesProcessed;
32  
33      /** Map of code biases.
34       * First key: the signal ID
35       * Second key: the code bias object
36       */
37      private Map<Integer, CodeBias> biases;
38  
39      /** Constructor. */
40      public SsrIgm05Data() {
41          // Initialize an empty map
42          this.biases = new HashMap<>();
43      }
44  
45      /**
46       * Get the number of biases processed for the current satellite.
47       * @return the number of biases processed
48       */
49      public int getNumberOfBiasesProcessed() {
50          return numberOfBiasesProcessed;
51      }
52  
53      /**
54       * Set the number of biases processed for the current satellite.
55       * @param numberOfBiasesProcessed the number to set
56       */
57      public void setNumberOfBiasesProcessed(final int numberOfBiasesProcessed) {
58          this.numberOfBiasesProcessed = numberOfBiasesProcessed;
59      }
60  
61      /**
62       * Add a code bias value for the current satellite.
63       * @param bias the code bias to add
64       */
65      public void addCodeBias(final CodeBias bias) {
66          this.biases.put(bias.getSignalID(), bias);
67      }
68  
69      /**
70       * Get the code biases for the current satellite.
71       * <p>
72       * First key: signal ID
73       * Second key: the code bias object
74       * </p>
75       * @return the code biases for the current satellite
76       */
77      public Map<Integer, CodeBias> getCodeBiases() {
78          return Collections.unmodifiableMap(biases);
79      }
80  
81      /**
82       * Get the code bias for a given signal ID.
83       * @param signalID the signal IF
84       * @return the corresponding code bias (null if not provided)
85       */
86      public CodeBias getCodeBias(final int signalID) {
87          return biases.get(signalID);
88      }
89  
90  }