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.ArrayList;
20  import java.util.Collections;
21  import java.util.HashMap;
22  import java.util.List;
23  import java.util.Map;
24  
25  import org.orekit.gnss.SatelliteSystem;
26  
27  /**
28   * GNSS SSR Phase Bias Message.
29   * @author Bryan Cazabonne
30   * @since 11.0
31   */
32  public class SsrIgm06 extends SsrIgmMessage<SsrIgm06Header, SsrIgm06Data> {
33  
34      /**
35       * Constructor.
36       * @param typeCode message number
37       * @param system satellite system
38       * @param header message header
39       * @param data message data
40       */
41      public SsrIgm06(final int typeCode, final SatelliteSystem system,
42                      final SsrIgm06Header header, final List<SsrIgm06Data> data) {
43          super(typeCode, system, header, data);
44      }
45  
46      /**
47       * Get the SSR IGM06 data parsed in the SSR message.
48       * @return the SSR IGM06 data for the parsed message
49       */
50      public Map<String, List<SsrIgm06Data>> getSsrIgm06Data() {
51  
52          // Initialize map
53          final Map<String, List<SsrIgm06Data>> ssrIgm06Data = new HashMap<>();
54  
55          // Loop on parsed data and fill map
56          for (final SsrIgm06Data currentData : getData()) {
57              final int ssrIgm06Id = currentData.getSatelliteID();
58              final String ssrIgm06IdString = ssrIgm06Id < 10 ? "0" + String.valueOf(ssrIgm06Id) : String.valueOf(ssrIgm06Id);
59              final String id = getSatelliteSystem().getKey() + ssrIgm06IdString;
60              ssrIgm06Data.putIfAbsent(id, new ArrayList<>());
61              ssrIgm06Data.get(id).add(currentData);
62          }
63  
64          // Return an unmodifiable map of the parsed data
65          return Collections.unmodifiableMap(ssrIgm06Data);
66  
67      }
68  }
69