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