SsrIgm05Data.java

  1. /* Copyright 2002-2022 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. import java.util.Collections;
  19. import java.util.HashMap;
  20. import java.util.Map;

  21. /**
  22.  * Container for SSR IGM05 data.
  23.  * @author Bryan Cazabonne
  24.  * @since 11.0
  25.  */
  26. public class SsrIgm05Data extends SsrIgmData {

  27.     /** Number of biases processed for the current satellite. */
  28.     private int numberOfBiasesProcessed;

  29.     /** Map of code biases.
  30.      * First key: the signal ID
  31.      * Second key: the code bias object
  32.      */
  33.     private Map<Integer, CodeBias> biases;

  34.     /** Constructor. */
  35.     public SsrIgm05Data() {
  36.         // Initialize an empty map
  37.         this.biases = new HashMap<>();
  38.     }

  39.     /**
  40.      * Get the number of biases processed for the current satellite.
  41.      * @return the number of biases processed
  42.      */
  43.     public int getNumberOfBiasesProcessed() {
  44.         return numberOfBiasesProcessed;
  45.     }

  46.     /**
  47.      * Set the number of biases processed for the current satellite.
  48.      * @param numberOfBiasesProcessed the number to set
  49.      */
  50.     public void setNumberOfBiasesProcessed(final int numberOfBiasesProcessed) {
  51.         this.numberOfBiasesProcessed = numberOfBiasesProcessed;
  52.     }

  53.     /**
  54.      * Add a code bias value for the current satellite.
  55.      * @param bias the code bias to add
  56.      */
  57.     public void addCodeBias(final CodeBias bias) {
  58.         this.biases.put(bias.getSignalID(), bias);
  59.     }

  60.     /**
  61.      * Get the code biases for the current satellite.
  62.      * <p>
  63.      * First key: signal ID
  64.      * Second key: the code bias object
  65.      * </p>
  66.      * @return the code biases for the current satellite
  67.      */
  68.     public Map<Integer, CodeBias> getCodeBiases() {
  69.         return Collections.unmodifiableMap(biases);
  70.     }

  71.     /**
  72.      * Get the code bias for a given signal ID.
  73.      * @param signalID the signal IF
  74.      * @return the corresponding code bias (null if not provided)
  75.      */
  76.     public CodeBias getCodeBias(final int signalID) {
  77.         return biases.get(signalID);
  78.     }

  79. }