1   /* Copyright 2024-2026 The Johns Hopkins University Applied Physics Laboratory
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.files.iirv.terms;
18  
19  import org.orekit.files.iirv.terms.base.LongValuedIIRVTerm;
20  
21  /**
22   * Source of the data message.
23   * <p>
24   * Valid values:
25   * <ul>
26   * <li> 1 = Nominal/planning
27   * <li> 2 = Real-time
28   * <li> 3 = Off-line
29   * <li> 4 = Off-line/mean
30   * </ul>
31   *
32   * @author Nick LaFarge
33   * @since 13.0
34   */
35  public class DataSourceTerm extends LongValuedIIRVTerm {
36  
37      /** Nominal/planning DataSource. */
38      public static final DataSourceTerm NOMINAL = new DataSourceTerm("1");
39  
40      /** Real-time DataSource. */
41      public static final DataSourceTerm REAL_TIME = new DataSourceTerm("2");
42  
43      /** Off-line DataSource. */
44      public static final DataSourceTerm OFFLINE = new DataSourceTerm("3");
45  
46      /** Off-line/mean DataSource. */
47      public static final DataSourceTerm OFFLINE_MEAN = new DataSourceTerm("4");
48  
49      /** The length of the IIRV term within the message. */
50      public static final int DATA_SOURCE_TERM_LENGTH = 1;
51  
52      /** Regular expression that ensures the validity of string values for this term. */
53      public static final String DATA_SOURCE_TERM_PATTERN = "[1-4]";
54  
55      /**
56       * Constructor.
57       * <p>
58       * See {@link LongValuedIIRVTerm#LongValuedIIRVTerm(String, String, int, boolean)}
59       *
60       * @param value value of the data source term
61       */
62      public DataSourceTerm(final String value) {
63          super(DATA_SOURCE_TERM_PATTERN, value, DATA_SOURCE_TERM_LENGTH, false);
64      }
65  
66      /**
67       * Constructor.
68       * <p>
69       * See {@link LongValuedIIRVTerm#LongValuedIIRVTerm(String, long, int, boolean)}
70       *
71       * @param value value of the data source term
72       */
73      public DataSourceTerm(final long value) {
74          super(DATA_SOURCE_TERM_PATTERN, value, DATA_SOURCE_TERM_LENGTH, false);
75      }
76  
77  }