0.5.0
Loading...
Searching...
No Matches
Code.cpp
Go to the documentation of this file.
1// This file is part of INSTINCT, the INS Toolkit for Integrated
2// Navigation Concepts and Training by the Institute of Navigation of
3// the University of Stuttgart, Germany.
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
9#include "Code.hpp"
10
11#include <array>
12#include <fmt/core.h>
13#include <imgui.h>
14
15#include "util/Logger.hpp"
16
17namespace NAV
18{
19
20Code::Code(const std::string& str)
21{
22 if (str == "G1C") { value.set(G1C, true); }
23 else if (str == "G1S") { value.set(G1S, true); }
24 else if (str == "G1L") { value.set(G1L, true); }
25 else if (str == "G1X") { value.set(G1X, true); }
26 else if (str == "G1P") { value.set(G1P, true); }
27 else if (str == "G1W") { value.set(G1W, true); }
28 else if (str == "G1Y") { value.set(G1Y, true); }
29 else if (str == "G1M") { value.set(G1M, true); }
30 else if (str == "G1N") { value.set(G1N, true); }
31 else if (str == "G2C") { value.set(G2C, true); }
32 else if (str == "G2D") { value.set(G2D, true); }
33 else if (str == "G2S") { value.set(G2S, true); }
34 else if (str == "G2L") { value.set(G2L, true); }
35 else if (str == "G2X") { value.set(G2X, true); }
36 else if (str == "G2P") { value.set(G2P, true); }
37 else if (str == "G2W") { value.set(G2W, true); }
38 else if (str == "G2Y") { value.set(G2Y, true); }
39 else if (str == "G2M") { value.set(G2M, true); }
40 else if (str == "G2N") { value.set(G2N, true); }
41 else if (str == "G5I") { value.set(G5I, true); }
42 else if (str == "G5Q") { value.set(G5Q, true); }
43 else if (str == "G5X") { value.set(G5X, true); }
44 else if (str == "E1A") { value.set(E1A, true); }
45 else if (str == "E1B") { value.set(E1B, true); }
46 else if (str == "E1C") { value.set(E1C, true); }
47 else if (str == "E1X") { value.set(E1X, true); }
48 else if (str == "E1Z") { value.set(E1Z, true); }
49 else if (str == "E5I") { value.set(E5I, true); }
50 else if (str == "E5Q") { value.set(E5Q, true); }
51 else if (str == "E5X") { value.set(E5X, true); }
52 else if (str == "E6A") { value.set(E6A, true); }
53 else if (str == "E6B") { value.set(E6B, true); }
54 else if (str == "E6C") { value.set(E6C, true); }
55 else if (str == "E6X") { value.set(E6X, true); }
56 else if (str == "E6Z") { value.set(E6Z, true); }
57 else if (str == "E7I") { value.set(E7I, true); }
58 else if (str == "E7Q") { value.set(E7Q, true); }
59 else if (str == "E7X") { value.set(E7X, true); }
60 else if (str == "E8I") { value.set(E8I, true); }
61 else if (str == "E8Q") { value.set(E8Q, true); }
62 else if (str == "E8X") { value.set(E8X, true); }
63 else if (str == "R1C") { value.set(R1C, true); }
64 else if (str == "R1P") { value.set(R1P, true); }
65 else if (str == "R2C") { value.set(R2C, true); }
66 else if (str == "R2P") { value.set(R2P, true); }
67 else if (str == "R3I") { value.set(R3I, true); }
68 else if (str == "R3Q") { value.set(R3Q, true); }
69 else if (str == "R3X") { value.set(R3X, true); }
70 else if (str == "R4A") { value.set(R4A, true); }
71 else if (str == "R4B") { value.set(R4B, true); }
72 else if (str == "R4X") { value.set(R4X, true); }
73 else if (str == "R6A") { value.set(R6A, true); }
74 else if (str == "R6B") { value.set(R6B, true); }
75 else if (str == "R6X") { value.set(R6X, true); }
76 else if (str == "B1D") { value.set(B1D, true); }
77 else if (str == "B1P") { value.set(B1P, true); }
78 else if (str == "B1X") { value.set(B1X, true); }
79 else if (str == "B2I") { value.set(B2I, true); }
80 else if (str == "B2Q") { value.set(B2Q, true); }
81 else if (str == "B2X") { value.set(B2X, true); }
82 else if (str == "B5D") { value.set(B5D, true); }
83 else if (str == "B5P") { value.set(B5P, true); }
84 else if (str == "B5X") { value.set(B5X, true); }
85 else if (str == "B6I") { value.set(B6I, true); }
86 else if (str == "B6Q") { value.set(B6Q, true); }
87 else if (str == "B6X") { value.set(B6X, true); }
88 else if (str == "B6A") { value.set(B6A, true); }
89 else if (str == "B7I") { value.set(B7I, true); }
90 else if (str == "B7Q") { value.set(B7Q, true); }
91 else if (str == "B7X") { value.set(B7X, true); }
92 else if (str == "B7D") { value.set(B7D, true); }
93 else if (str == "B7P") { value.set(B7P, true); }
94 else if (str == "B7Z") { value.set(B7Z, true); }
95 else if (str == "B8D") { value.set(B8D, true); }
96 else if (str == "B8P") { value.set(B8P, true); }
97 else if (str == "B8X") { value.set(B8X, true); }
98 else if (str == "J1C") { value.set(J1C, true); }
99 else if (str == "J1S") { value.set(J1S, true); }
100 else if (str == "J1L") { value.set(J1L, true); }
101 else if (str == "J1X") { value.set(J1X, true); }
102 else if (str == "J1Z") { value.set(J1Z, true); }
103 else if (str == "J2S") { value.set(J2S, true); }
104 else if (str == "J2L") { value.set(J2L, true); }
105 else if (str == "J2X") { value.set(J2X, true); }
106 else if (str == "J5I") { value.set(J5I, true); }
107 else if (str == "J5Q") { value.set(J5Q, true); }
108 else if (str == "J5X") { value.set(J5X, true); }
109 else if (str == "J5D") { value.set(J5D, true); }
110 else if (str == "J5P") { value.set(J5P, true); }
111 else if (str == "J5Z") { value.set(J5Z, true); }
112 else if (str == "J6S") { value.set(J6S, true); }
113 else if (str == "J6L") { value.set(J6L, true); }
114 else if (str == "J6X") { value.set(J6X, true); }
115 else if (str == "J6E") { value.set(J6E, true); }
116 else if (str == "J6Z") { value.set(J6Z, true); }
117 else if (str == "I5A") { value.set(I5A, true); }
118 else if (str == "I5B") { value.set(I5B, true); }
119 else if (str == "I5C") { value.set(I5C, true); }
120 else if (str == "I5X") { value.set(I5X, true); }
121 else if (str == "I9A") { value.set(I9A, true); }
122 else if (str == "I9B") { value.set(I9B, true); }
123 else if (str == "I9C") { value.set(I9C, true); }
124 else if (str == "I9X") { value.set(I9X, true); }
125 else if (str == "S1C") { value.set(S1C, true); }
126 else if (str == "S5I") { value.set(S5I, true); }
127 else if (str == "S5Q") { value.set(S5Q, true); }
128 else if (str == "S5X") { value.set(S5X, true); }
129}
130
132{
133 if (sys & GPS) { *this |= Code(G01 | G02 | G05); }
134 if (sys & GAL) { *this |= Code(E01 | E05 | E06 | E07 | E08); }
135 if (sys & GLO) { *this |= Code(R01 | R02 | R03 | R04 | R06); }
136 if (sys & BDS) { *this |= Code(B01 | B02 | B05 | B06 | B07 | B08); }
137 if (sys & QZSS) { *this |= Code(J01 | J02 | J05 | J06); }
138 if (sys & IRNSS) { *this |= Code(I05 | I09); }
139 if (sys & SBAS) { *this |= Code(S01 | S05); }
140}
141
143{
144 if (freq & G01) { *this |= G1C | G1S | G1L | G1X | G1P | G1W | G1Y | G1M | G1N; }
145 if (freq & G02) { *this |= G2C | G2D | G2S | G2L | G2X | G2P | G2W | G2Y | G2M | G2N; }
146 if (freq & G05) { *this |= G5I | G5Q | G5X; }
147 if (freq & E01) { *this |= E1A | E1B | E1C | E1X | E1Z; }
148 if (freq & E05) { *this |= E5I | E5Q | E5X; }
149 if (freq & E06) { *this |= E6A | E6B | E6C | E6X | E6Z; }
150 if (freq & E07) { *this |= E7I | E7Q | E7X; }
151 if (freq & E08) { *this |= E8I | E8Q | E8X; }
152 if (freq & R01) { *this |= R1C | R1P; }
153 if (freq & R02) { *this |= R2C | R2P; }
154 if (freq & R03) { *this |= R3I | R3Q | R3X; }
155 if (freq & R04) { *this |= R4A | R4B | R4X; }
156 if (freq & R06) { *this |= R6A | R6B | R6X; }
157 if (freq & B01) { *this |= B1D | B1P | B1X; }
158 if (freq & B02) { *this |= B2I | B2Q | B2X; }
159 if (freq & B05) { *this |= B5D | B5P | B5X; }
160 if (freq & B06) { *this |= B6I | B6Q | B6X | B6A; }
161 if (freq & B07) { *this |= B7I | B7Q | B7X | B7D | B7P | B7Z; }
162 if (freq & B08) { *this |= B8D | B8P | B8X; }
163 if (freq & J01) { *this |= J1C | J1S | J1L | J1X | J1Z; }
164 if (freq & J02) { *this |= J2S | J2L | J2X; }
165 if (freq & J05) { *this |= J5I | J5Q | J5X | J5D | J5P | J5Z; }
166 if (freq & J06) { *this |= J6S | J6L | J6X | J6E | J6Z; }
167 if (freq & I05) { *this |= I5A | I5B | I5C | I5X; }
168 if (freq & I09) { *this |= I9A | I9B | I9C | I9X; }
169 if (freq & S01) { value |= S1C; }
170 if (freq & S05) { *this |= S5I | S5Q | S5X; }
171}
172
173Code::operator std::string() const
174{
175 const std::string filler = " | ";
176 std::string str;
177
178 if (*this & G1C) { str += (!str.empty() ? filler : "") + "G1C"; }
179 if (*this & G1S) { str += (!str.empty() ? filler : "") + "G1S"; }
180 if (*this & G1L) { str += (!str.empty() ? filler : "") + "G1L"; }
181 if (*this & G1X) { str += (!str.empty() ? filler : "") + "G1X"; }
182 if (*this & G1P) { str += (!str.empty() ? filler : "") + "G1P"; }
183 if (*this & G1W) { str += (!str.empty() ? filler : "") + "G1W"; }
184 if (*this & G1Y) { str += (!str.empty() ? filler : "") + "G1Y"; }
185 if (*this & G1M) { str += (!str.empty() ? filler : "") + "G1M"; }
186 if (*this & G1N) { str += (!str.empty() ? filler : "") + "G1N"; }
187 if (*this & G2C) { str += (!str.empty() ? filler : "") + "G2C"; }
188 if (*this & G2D) { str += (!str.empty() ? filler : "") + "G2D"; }
189 if (*this & G2S) { str += (!str.empty() ? filler : "") + "G2S"; }
190 if (*this & G2L) { str += (!str.empty() ? filler : "") + "G2L"; }
191 if (*this & G2X) { str += (!str.empty() ? filler : "") + "G2X"; }
192 if (*this & G2P) { str += (!str.empty() ? filler : "") + "G2P"; }
193 if (*this & G2W) { str += (!str.empty() ? filler : "") + "G2W"; }
194 if (*this & G2Y) { str += (!str.empty() ? filler : "") + "G2Y"; }
195 if (*this & G2M) { str += (!str.empty() ? filler : "") + "G2M"; }
196 if (*this & G2N) { str += (!str.empty() ? filler : "") + "G2N"; }
197 if (*this & G5I) { str += (!str.empty() ? filler : "") + "G5I"; }
198 if (*this & G5Q) { str += (!str.empty() ? filler : "") + "G5Q"; }
199 if (*this & G5X) { str += (!str.empty() ? filler : "") + "G5X"; }
200
201 if (*this & E1A) { str += (!str.empty() ? filler : "") + "E1A"; }
202 if (*this & E1B) { str += (!str.empty() ? filler : "") + "E1B"; }
203 if (*this & E1C) { str += (!str.empty() ? filler : "") + "E1C"; }
204 if (*this & E1X) { str += (!str.empty() ? filler : "") + "E1X"; }
205 if (*this & E1Z) { str += (!str.empty() ? filler : "") + "E1Z"; }
206 if (*this & E5I) { str += (!str.empty() ? filler : "") + "E5I"; }
207 if (*this & E5Q) { str += (!str.empty() ? filler : "") + "E5Q"; }
208 if (*this & E5X) { str += (!str.empty() ? filler : "") + "E5X"; }
209 if (*this & E6A) { str += (!str.empty() ? filler : "") + "E6A"; }
210 if (*this & E6B) { str += (!str.empty() ? filler : "") + "E6B"; }
211 if (*this & E6C) { str += (!str.empty() ? filler : "") + "E6C"; }
212 if (*this & E6X) { str += (!str.empty() ? filler : "") + "E6X"; }
213 if (*this & E6Z) { str += (!str.empty() ? filler : "") + "E6Z"; }
214 if (*this & E7I) { str += (!str.empty() ? filler : "") + "E7I"; }
215 if (*this & E7Q) { str += (!str.empty() ? filler : "") + "E7Q"; }
216 if (*this & E7X) { str += (!str.empty() ? filler : "") + "E7X"; }
217 if (*this & E8I) { str += (!str.empty() ? filler : "") + "E8I"; }
218 if (*this & E8Q) { str += (!str.empty() ? filler : "") + "E8Q"; }
219 if (*this & E8X) { str += (!str.empty() ? filler : "") + "E8X"; }
220
221 if (*this & R1C) { str += (!str.empty() ? filler : "") + "R1C"; }
222 if (*this & R1P) { str += (!str.empty() ? filler : "") + "R1P"; }
223 if (*this & R2C) { str += (!str.empty() ? filler : "") + "R2C"; }
224 if (*this & R2P) { str += (!str.empty() ? filler : "") + "R2P"; }
225 if (*this & R3I) { str += (!str.empty() ? filler : "") + "R3I"; }
226 if (*this & R3Q) { str += (!str.empty() ? filler : "") + "R3Q"; }
227 if (*this & R3X) { str += (!str.empty() ? filler : "") + "R3X"; }
228 if (*this & R4A) { str += (!str.empty() ? filler : "") + "R4A"; }
229 if (*this & R4B) { str += (!str.empty() ? filler : "") + "R4B"; }
230 if (*this & R4X) { str += (!str.empty() ? filler : "") + "R4X"; }
231 if (*this & R6A) { str += (!str.empty() ? filler : "") + "R6A"; }
232 if (*this & R6B) { str += (!str.empty() ? filler : "") + "R6B"; }
233 if (*this & R6X) { str += (!str.empty() ? filler : "") + "R6X"; }
234
235 if (*this & B1D) { str += (!str.empty() ? filler : "") + "B1D"; }
236 if (*this & B1P) { str += (!str.empty() ? filler : "") + "B1P"; }
237 if (*this & B1X) { str += (!str.empty() ? filler : "") + "B1X"; }
238 if (*this & B2I) { str += (!str.empty() ? filler : "") + "B2I"; }
239 if (*this & B2Q) { str += (!str.empty() ? filler : "") + "B2Q"; }
240 if (*this & B2X) { str += (!str.empty() ? filler : "") + "B2X"; }
241 if (*this & B5D) { str += (!str.empty() ? filler : "") + "B5D"; }
242 if (*this & B5P) { str += (!str.empty() ? filler : "") + "B5P"; }
243 if (*this & B5X) { str += (!str.empty() ? filler : "") + "B5X"; }
244 if (*this & B6I) { str += (!str.empty() ? filler : "") + "B6I"; }
245 if (*this & B6Q) { str += (!str.empty() ? filler : "") + "B6Q"; }
246 if (*this & B6X) { str += (!str.empty() ? filler : "") + "B6X"; }
247 if (*this & B6A) { str += (!str.empty() ? filler : "") + "B6A"; }
248 if (*this & B7I) { str += (!str.empty() ? filler : "") + "B7I"; }
249 if (*this & B7Q) { str += (!str.empty() ? filler : "") + "B7Q"; }
250 if (*this & B7X) { str += (!str.empty() ? filler : "") + "B7X"; }
251 if (*this & B7D) { str += (!str.empty() ? filler : "") + "B7D"; }
252 if (*this & B7P) { str += (!str.empty() ? filler : "") + "B7P"; }
253 if (*this & B7Z) { str += (!str.empty() ? filler : "") + "B7Z"; }
254 if (*this & B8D) { str += (!str.empty() ? filler : "") + "B8D"; }
255 if (*this & B8P) { str += (!str.empty() ? filler : "") + "B8P"; }
256 if (*this & B8X) { str += (!str.empty() ? filler : "") + "B8X"; }
257
258 if (*this & J1C) { str += (!str.empty() ? filler : "") + "J1C"; }
259 if (*this & J1S) { str += (!str.empty() ? filler : "") + "J1S"; }
260 if (*this & J1L) { str += (!str.empty() ? filler : "") + "J1L"; }
261 if (*this & J1X) { str += (!str.empty() ? filler : "") + "J1X"; }
262 if (*this & J1Z) { str += (!str.empty() ? filler : "") + "J1Z"; }
263 if (*this & J2S) { str += (!str.empty() ? filler : "") + "J2S"; }
264 if (*this & J2L) { str += (!str.empty() ? filler : "") + "J2L"; }
265 if (*this & J2X) { str += (!str.empty() ? filler : "") + "J2X"; }
266 if (*this & J5I) { str += (!str.empty() ? filler : "") + "J5I"; }
267 if (*this & J5Q) { str += (!str.empty() ? filler : "") + "J5Q"; }
268 if (*this & J5X) { str += (!str.empty() ? filler : "") + "J5X"; }
269 if (*this & J5D) { str += (!str.empty() ? filler : "") + "J5D"; }
270 if (*this & J5P) { str += (!str.empty() ? filler : "") + "J5P"; }
271 if (*this & J5Z) { str += (!str.empty() ? filler : "") + "J5Z"; }
272 if (*this & J6S) { str += (!str.empty() ? filler : "") + "J6S"; }
273 if (*this & J6L) { str += (!str.empty() ? filler : "") + "J6L"; }
274 if (*this & J6X) { str += (!str.empty() ? filler : "") + "J6X"; }
275 if (*this & J6E) { str += (!str.empty() ? filler : "") + "J6E"; }
276 if (*this & J6Z) { str += (!str.empty() ? filler : "") + "J6Z"; }
277
278 if (*this & I5A) { str += (!str.empty() ? filler : "") + "I5A"; }
279 if (*this & I5B) { str += (!str.empty() ? filler : "") + "I5B"; }
280 if (*this & I5C) { str += (!str.empty() ? filler : "") + "I5C"; }
281 if (*this & I5X) { str += (!str.empty() ? filler : "") + "I5X"; }
282 if (*this & I9A) { str += (!str.empty() ? filler : "") + "I9A"; }
283 if (*this & I9B) { str += (!str.empty() ? filler : "") + "I9B"; }
284 if (*this & I9C) { str += (!str.empty() ? filler : "") + "I9C"; }
285 if (*this & I9X) { str += (!str.empty() ? filler : "") + "I9X"; }
286
287 if (*this & S1C) { str += (!str.empty() ? filler : "") + "S1C"; }
288 if (*this & S5I) { str += (!str.empty() ? filler : "") + "S5I"; }
289 if (*this & S5Q) { str += (!str.empty() ? filler : "") + "S5Q"; }
290 if (*this & S5X) { str += (!str.empty() ? filler : "") + "S5X"; }
291
292 if (!str.empty())
293 {
294 return str;
295 }
296 return "None";
297}
298
299Code Code::fromFreqAttr(Frequency freq, char attribute)
300{
301 switch (Frequency_(freq))
302 {
303 case G01: // GPS L1 (1575.42 MHz).
304 if (attribute == 'C') { return G1C; }
305 if (attribute == 'S') { return G1S; }
306 if (attribute == 'L') { return G1L; }
307 if (attribute == 'X') { return G1X; }
308 if (attribute == 'P') { return G1P; }
309 if (attribute == 'W') { return G1W; }
310 if (attribute == 'Y') { return G1Y; }
311 if (attribute == 'M') { return G1M; }
312 if (attribute == 'N') { return G1N; }
313 break;
314 case G02: // GPS L2 (1227.6 MHz).
315 if (attribute == 'C') { return G2C; }
316 if (attribute == 'D') { return G2D; }
317 if (attribute == 'S') { return G2S; }
318 if (attribute == 'L') { return G2L; }
319 if (attribute == 'X') { return G2X; }
320 if (attribute == 'P') { return G2P; }
321 if (attribute == 'W') { return G2W; }
322 if (attribute == 'Y') { return G2Y; }
323 if (attribute == 'M') { return G2M; }
324 if (attribute == 'N') { return G2N; }
325 break;
326 case G05: // GPS L5 (1176.45 MHz).
327 if (attribute == 'I') { return G5I; }
328 if (attribute == 'Q') { return G5Q; }
329 if (attribute == 'X') { return G5X; }
330 break;
331 case E01: // Galileo, "E1" (1575.42 MHz).
332 if (attribute == 'A') { return E1A; }
333 if (attribute == 'B') { return E1B; }
334 if (attribute == 'C') { return E1C; }
335 if (attribute == 'X') { return E1X; }
336 if (attribute == 'Z') { return E1Z; }
337 break;
338 case E05: // Galileo E5a (1176.45 MHz).
339 if (attribute == 'I') { return E5I; }
340 if (attribute == 'Q') { return E5Q; }
341 if (attribute == 'X') { return E5X; }
342 break;
343 case E06: // Galileo E6 (1278.75 MHz).
344 if (attribute == 'A') { return E6A; }
345 if (attribute == 'B') { return E6B; }
346 if (attribute == 'C') { return E6C; }
347 if (attribute == 'X') { return E6X; }
348 if (attribute == 'Z') { return E6Z; }
349 break;
350 case E07: // Galileo E5b (1207.14 MHz).
351 if (attribute == 'I') { return E7I; }
352 if (attribute == 'Q') { return E7Q; }
353 if (attribute == 'X') { return E7X; }
354 break;
355 case E08: // Galileo E5 (E5a + E5b) (1191.795MHz).
356 if (attribute == 'I') { return E8I; }
357 if (attribute == 'Q') { return E8Q; }
358 if (attribute == 'X') { return E8X; }
359 break;
360
361 case R01: // GLONASS, "G1" (1602 MHZ).
362 if (attribute == 'C') { return R1C; }
363 if (attribute == 'P') { return R1P; }
364 break;
365 case R02: // GLONASS, "G2" (1246 MHz).
366 if (attribute == 'C') { return R2C; }
367 if (attribute == 'P') { return R2P; }
368 break;
369 case R03: // GLONASS, "G3" (1202.025 MHz).
370 if (attribute == 'I') { return R3I; }
371 if (attribute == 'Q') { return R3Q; }
372 if (attribute == 'X') { return R3X; }
373 break;
374 case R04: // GLONASS, "G1a" (1600.995 MHZ).
375 if (attribute == 'A') { return R4A; }
376 if (attribute == 'B') { return R4B; }
377 if (attribute == 'X') { return R4X; }
378 break;
379 case R06: // GLONASS, "G2a" (1248.06 MHz).
380 if (attribute == 'A') { return R6A; }
381 if (attribute == 'B') { return R6B; }
382 if (attribute == 'X') { return R6X; }
383 break;
384
385 case B01: // Beidou B1 (1575.42 MHz).
386 if (attribute == 'D') { return B1D; }
387 if (attribute == 'P') { return B1P; }
388 if (attribute == 'X') { return B1X; }
389 break;
390 case B02: // Beidou B1-2 (1561.098 MHz).
391 if (attribute == 'I') { return B2I; }
392 if (attribute == 'Q') { return B2Q; }
393 if (attribute == 'X') { return B2X; }
394 break;
395 case B05: // Beidou B2a (1176.45 MHz).
396 if (attribute == 'D') { return B5D; }
397 if (attribute == 'P') { return B5P; }
398 if (attribute == 'X') { return B5X; }
399 break;
400 case B06: // Beidou B3 (1268.52 MHz).
401 if (attribute == 'I') { return B6I; }
402 if (attribute == 'Q') { return B6Q; }
403 if (attribute == 'X') { return B6X; }
404 if (attribute == 'A') { return B6A; }
405 break;
406 case B07: // Beidou B2b (1207.14 MHz).
407 if (attribute == 'I') { return B7I; }
408 if (attribute == 'Q') { return B7Q; }
409 if (attribute == 'X') { return B7X; }
410 if (attribute == 'D') { return B7D; }
411 if (attribute == 'P') { return B7P; }
412 if (attribute == 'Z') { return B7Z; }
413 break;
414 case B08: // Beidou B2 (B2a + B2b) (1191.795MHz).
415 if (attribute == 'D') { return B8D; }
416 if (attribute == 'P') { return B8P; }
417 if (attribute == 'X') { return B8X; }
418 break;
419
420 case J01: // QZSS L1 (1575.42 MHz).
421 if (attribute == 'C') { return J1C; }
422 if (attribute == 'S') { return J1S; }
423 if (attribute == 'L') { return J1L; }
424 if (attribute == 'X') { return J1X; }
425 if (attribute == 'Z') { return J1Z; }
426 break;
427 case J02: // QZSS L2 (1227.6 MHz).
428 if (attribute == 'S') { return J2S; }
429 if (attribute == 'L') { return J2L; }
430 if (attribute == 'X') { return J2X; }
431 break;
432 case J05: // QZSS L5 (1176.45 MHz).
433 if (attribute == 'I') { return J5I; }
434 if (attribute == 'Q') { return J5Q; }
435 if (attribute == 'X') { return J5X; }
436 if (attribute == 'D') { return J5D; }
437 if (attribute == 'P') { return J5P; }
438 if (attribute == 'Z') { return J5Z; }
439 break;
440 case J06: // QZSS L6 / LEX (1278.75 MHz).
441 if (attribute == 'S') { return J6S; }
442 if (attribute == 'L') { return J6L; }
443 if (attribute == 'X') { return J6X; }
444 if (attribute == 'E') { return J6E; }
445 if (attribute == 'Z') { return J6Z; }
446 break;
447
448 case I05: // IRNSS L5 (1176.45 MHz).
449 if (attribute == 'A') { return I5A; }
450 if (attribute == 'B') { return I5B; }
451 if (attribute == 'C') { return I5C; }
452 if (attribute == 'X') { return I5X; }
453 break;
454 case I09: // IRNSS S (2492.028 MHz).
455 if (attribute == 'A') { return I9A; }
456 if (attribute == 'B') { return I9B; }
457 if (attribute == 'C') { return I9C; }
458 if (attribute == 'X') { return I9X; }
459 break;
460
461 case S01: // SBAS L1 (1575.42 MHz).
462 if (attribute == 'C') { return S1C; }
463 break;
464 case S05: // SBAS L5 (1176.45 MHz).
465 if (attribute == 'I') { return S5I; }
466 if (attribute == 'Q') { return S5Q; }
467 if (attribute == 'X') { return S5X; }
468 break;
469
470 case Freq_None:
471 break;
472 }
473
474 LOG_WARN("Can't convert frequency '{}' and attribute '{}'. Unkown code.", freq, attribute);
475
476 return Code(Set());
477}
478
480{
481 if (code == G1C) { return "GPS L1 - C/A-code"; }
482 if (code == G1S) { return "GPS L1 - L1C-D (data)"; }
483 if (code == G1L) { return "GPS L1 - L1C-P (pilot)"; }
484 if (code == G1X) { return "GPS L1 - L1C-(D+P) (combined)"; }
485 if (code == G1P) { return "GPS L1 - P-code (unencrypted)"; }
486 if (code == G1W) { return "GPS L1 - Semicodeless P(Y) tracking (Z-tracking)"; }
487 if (code == G1Y) { return "GPS L1 - Y-code (with decryption)"; }
488 if (code == G1M) { return "GPS L1 - M-code"; }
489 if (code == G1N) { return "GPS L1 - codeless"; }
490 if (code == G2C) { return "GPS L2 - C/A-code"; }
491 if (code == G2D) { return "GPS L2 - Semi-codeless P(Y) tracking (L1 C/A + (P2-P1))"; }
492 if (code == G2S) { return "GPS L2 - L2C(M) (medium)"; }
493 if (code == G2L) { return "GPS L2 - L2C(L) (long)"; }
494 if (code == G2X) { return "GPS L2 - L2C(M+L) (combined)"; }
495 if (code == G2P) { return "GPS L2 - P-code (unencrypted)"; }
496 if (code == G2W) { return "GPS L2 - Semicodeless P(Y) tracking (Z-tracking)"; }
497 if (code == G2Y) { return "GPS L2 - Y-code (with decryption)"; }
498 if (code == G2M) { return "GPS L2 - M-code"; }
499 if (code == G2N) { return "GPS L2 - codeless"; }
500 if (code == G5I) { return "GPS L5 - Data"; }
501 if (code == G5Q) { return "GPS L5 - Pilot"; }
502 if (code == G5X) { return "GPS L5 - Combined"; }
503
504 if (code == E1A) { return "GAL E1 - PRS signal"; }
505 if (code == E1B) { return "GAL E1 - OS (data)"; }
506 if (code == E1C) { return "GAL E1 - OS (pilot)"; }
507 if (code == E1X) { return "GAL E1 - OS(B+C) (combined)"; }
508 if (code == E1Z) { return "GAL E1 - PRS + OS (data + pilot)"; }
509 if (code == E5I) { return "GAL E5a - Data"; }
510 if (code == E5Q) { return "GAL E5a - Pilot"; }
511 if (code == E5X) { return "GAL E5a - Combined"; }
512 if (code == E6A) { return "GAL E6 - PRS signal"; }
513 if (code == E6B) { return "GAL E6 - Data"; }
514 if (code == E6C) { return "GAL E6 - Pilot"; }
515 if (code == E6X) { return "GAL E6 - Combined (B+C)"; }
516 if (code == E6Z) { return "GAL E6 - PRS + OS (A+B+C)"; }
517 if (code == E7I) { return "GAL E5b - Data"; }
518 if (code == E7Q) { return "GAL E5b - Pilot"; }
519 if (code == E7X) { return "GAL E5b - Combined"; }
520 if (code == E8I) { return "GAL E5(a+b) - AltBOC (data)"; }
521 if (code == E8Q) { return "GAL E5(a+b) - AltBOC (pilot)"; }
522 if (code == E8X) { return "GAL E5(a+b) - AltBOC (combined)"; }
523
524 if (code == R1C) { return "GLO L1 - C/A-code"; }
525 if (code == R1P) { return "GLO L1 - P-code"; }
526 if (code == R2C) { return "GLO L2 - C/A-code"; }
527 if (code == R2P) { return "GLO L2 - P-code"; }
528 if (code == R3I) { return "GLO L3 - Data"; }
529 if (code == R3Q) { return "GLO L3 - Pilot"; }
530 if (code == R3X) { return "GLO L3 - Combined"; }
531 if (code == R4A) { return "GLO G1a - L1OCd (data)"; }
532 if (code == R4B) { return "GLO G1a - L1OCp (pilot)"; }
533 if (code == R4X) { return "GLO G1a - L1OCd+L1OCp (combined)"; }
534 if (code == R6A) { return "GLO G2a - L2CSI (data)"; }
535 if (code == R6B) { return "GLO G2a - L2OCp (pilot)"; }
536 if (code == R6X) { return "GLO G2a - L2CSI+L2OCp (combined)"; }
537
538 if (code == B1D) { return "BeiDou B1 - Data (D)"; }
539 if (code == B1P) { return "BeiDou B1 - Pilot(P)"; }
540 if (code == B1X) { return "BeiDou B1 - D+P"; }
541 if (code == B2I) { return "BeiDou B1-2 - B1I(OS)"; }
542 if (code == B2Q) { return "BeiDou B1-2 - B1Q"; }
543 if (code == B2X) { return "BeiDou B1-2 - B1I(OS), B1Q, combined"; }
544 if (code == B5D) { return "BeiDou B2a - Data (D)"; }
545 if (code == B5P) { return "BeiDou B2a - Pilot(P)"; }
546 if (code == B5X) { return "BeiDou B2a - D+P"; }
547 if (code == B6I) { return "BeiDou B3 - B3I"; }
548 if (code == B6Q) { return "BeiDou B3 - B3Q"; }
549 if (code == B6X) { return "BeiDou B3 - B3I, B3Q, combined"; }
550 if (code == B6A) { return "BeiDou B3 - B3A"; }
551 if (code == B7I) { return "BeiDou B2b (BDS-2) - B2I(OS)"; }
552 if (code == B7Q) { return "BeiDou B2b (BDS-2) - B2Q"; }
553 if (code == B7X) { return "BeiDou B2b (BDS-2) - B2I(OS), B2Q, combined"; }
554 if (code == B7D) { return "BeiDou B2b (BDS-3) - Data (D)"; }
555 if (code == B7P) { return "BeiDou B2b (BDS-3) - Pilot(P)"; }
556 if (code == B7Z) { return "BeiDou B2b (BDS-3) - D+P"; }
557 if (code == B8D) { return "BeiDou B2 (B2a+B2b) - Data (D)"; }
558 if (code == B8P) { return "BeiDou B2 (B2a+B2b) - Pilot(P)"; }
559 if (code == B8X) { return "BeiDou B2 (B2a+B2b) - D+P"; }
560
561 if (code == J1C) { return "QZSS L1 - C/A-code"; }
562 if (code == J1S) { return "QZSS L1 - L1C (data)"; }
563 if (code == J1L) { return "QZSS L1 - L1C (pilot)"; }
564 if (code == J1X) { return "QZSS L1 - L1C (combined)"; }
565 if (code == J1Z) { return "QZSS L1 - L1-SAIF signal"; }
566 if (code == J2S) { return "QZSS L2 - L2C-code (medium)"; }
567 if (code == J2L) { return "QZSS L2 - L2C-code (long)"; }
568 if (code == J2X) { return "QZSS L2 - L2C-code (combined)"; }
569 if (code == J5I) { return "QZSS L5 - Data"; }
570 if (code == J5Q) { return "QZSS L5 - Pilot"; }
571 if (code == J5X) { return "QZSS L5 - Combined"; }
572 if (code == J5D) { return "QZSS L5S - I"; }
573 if (code == J5P) { return "QZSS L5S - Q"; }
574 if (code == J5Z) { return "QZSS L5S - I+Q"; }
575 if (code == J6S) { return "QZSS L6 - L6D LEX signal (short)"; }
576 if (code == J6L) { return "QZSS L6 - L6P LEX signal (long)"; }
577 if (code == J6X) { return "QZSS L6 - L6(D+P) LEX signal (combined)"; }
578 if (code == J6E) { return "QZSS L6 - L6E"; }
579 if (code == J6Z) { return "QZSS L6 - L6(D+E)"; }
580
581 if (code == I5A) { return "IRNSS L5 - SPS Signal"; }
582 if (code == I5B) { return "IRNSS L5 - RS (data)"; }
583 if (code == I5C) { return "IRNSS L5 - RS (pilot)"; }
584 if (code == I5X) { return "IRNSS L5 - RS (combined)"; }
585 if (code == I9A) { return "IRNSS S - SPS signal"; }
586 if (code == I9B) { return "IRNSS S - RS (data)"; }
587 if (code == I9C) { return "IRNSS S - RS (pilot)"; }
588 if (code == I9X) { return "IRNSS S - RS (combined)"; }
589
590 if (code == S1C) { return "SBAS L1 - C/A-code"; }
591 if (code == S5I) { return "SBAS L5 - Data"; }
592 if (code == S5Q) { return "SBAS L5 - Pilot"; }
593 if (code == S5X) { return "SBAS L5 - Combined"; }
594
595 return "Unknown code.";
596}
597
598const char* Code::getDescription() const
599{
600 return GetCodeDescription(*this);
601}
602
604{
605 if (code == G1C) { return G01; } // GPS L1 - C/A-code
606 if (code == G1S) { return G01; } // GPS L1 - L1C-D (data)
607 if (code == G1L) { return G01; } // GPS L1 - L1C-P (pilot)
608 if (code == G1X) { return G01; } // GPS L1 - L1C-(D+P) (combined)
609 if (code == G1P) { return G01; } // GPS L1 - P-code (unencrypted)
610 if (code == G1W) { return G01; } // GPS L1 - Semicodeless P(Y) tracking (Z-tracking)
611 if (code == G1Y) { return G01; } // GPS L1 - Y-code (with decryption)
612 if (code == G1M) { return G01; } // GPS L1 - M-code
613 if (code == G1N) { return G01; } // GPS L1 - codeless
614 if (code == G2C) { return G02; } // GPS L2 - C/A-code
615 if (code == G2D) { return G02; } // GPS L2 - Semi-codeless P(Y) tracking (L1 C/A + (P2-P1))
616 if (code == G2S) { return G02; } // GPS L2 - L2C(M) (medium)
617 if (code == G2L) { return G02; } // GPS L2 - L2C(L) (long)
618 if (code == G2X) { return G02; } // GPS L2 - L2C(M+L) (combined)
619 if (code == G2P) { return G02; } // GPS L2 - P-code (unencrypted)
620 if (code == G2W) { return G02; } // GPS L2 - Semicodeless P(Y) tracking (Z-tracking)
621 if (code == G2Y) { return G02; } // GPS L2 - Y-code (with decryption)
622 if (code == G2M) { return G02; } // GPS L2 - M-code
623 if (code == G2N) { return G02; } // GPS L2 - codeless
624 if (code == G5I) { return G05; } // GPS L5 - Data
625 if (code == G5Q) { return G05; } // GPS L5 - Pilot
626 if (code == G5X) { return G05; } // GPS L5 - Combined
627
628 if (code == E1A) { return E01; } // GAL E1 - PRS signal
629 if (code == E1B) { return E01; } // GAL E1 - OS (data)
630 if (code == E1C) { return E01; } // GAL E1 - OS (pilot)
631 if (code == E1X) { return E01; } // GAL E1 - OS(B+C) (combined)
632 if (code == E1Z) { return E01; } // GAL E1 - PRS + OS (data + pilot)
633 if (code == E5I) { return E05; } // GAL E5a - Data
634 if (code == E5Q) { return E05; } // GAL E5a - Pilot
635 if (code == E5X) { return E05; } // GAL E5a - Combined
636 if (code == E6A) { return E06; } // GAL E6 - PRS signal
637 if (code == E6B) { return E06; } // GAL E6 - Data
638 if (code == E6C) { return E06; } // GAL E6 - Pilot
639 if (code == E6X) { return E06; } // GAL E6 - Combined (B+C)
640 if (code == E6Z) { return E06; } // GAL E6 - PRS + OS (A+B+C)
641 if (code == E7I) { return E07; } // GAL E5b - Data
642 if (code == E7Q) { return E07; } // GAL E5b - Pilot
643 if (code == E7X) { return E07; } // GAL E5b - Combined
644 if (code == E8I) { return E08; } // GAL E5(a+b) - AltBOC (data)
645 if (code == E8Q) { return E08; } // GAL E5(a+b) - AltBOC (pilot)
646 if (code == E8X) { return E08; } // GAL E5(a+b) - AltBOC (combined)
647
648 if (code == R1C) { return R01; } // GLO L1 - C/A-code
649 if (code == R1P) { return R01; } // GLO L1 - P-code
650 if (code == R2C) { return R02; } // GLO L2 - C/A-code
651 if (code == R2P) { return R02; } // GLO L2 - P-code
652 if (code == R3I) { return R03; } // GLO L3 - Data
653 if (code == R3Q) { return R03; } // GLO L3 - Pilot
654 if (code == R3X) { return R03; } // GLO L3 - Combined
655 if (code == R4A) { return R04; } // GLO G1a - L1OCd (data)
656 if (code == R4B) { return R04; } // GLO G1a - L1OCp (pilot)
657 if (code == R4X) { return R04; } // GLO G1a - L1OCd+L1OCp (combined)
658 if (code == R6A) { return R06; } // GLO G2a - L2CSI (data)
659 if (code == R6B) { return R06; } // GLO G2a - L2OCp (pilot)
660 if (code == R6X) { return R06; } // GLO G2a - L2CSI+L2OCp (combined)
661
662 if (code == B1D) { return B01; } // BeiDou B1 - Data (D)
663 if (code == B1P) { return B01; } // BeiDou B1 - Pilot(P)
664 if (code == B1X) { return B01; } // BeiDou B1 - D+P
665 if (code == B2I) { return B02; } // BeiDou B1-2 - B1I(OS)
666 if (code == B2Q) { return B02; } // BeiDou B1-2 - B1Q
667 if (code == B2X) { return B02; } // BeiDou B1-2 - B1I(OS), B1Q, combined
668 if (code == B5D) { return B05; } // BeiDou B2a - Data (D)
669 if (code == B5P) { return B05; } // BeiDou B2a - Pilot(P)
670 if (code == B5X) { return B05; } // BeiDou B2a - D+P
671 if (code == B6I) { return B06; } // BeiDou B3 - B3I
672 if (code == B6Q) { return B06; } // BeiDou B3 - B3Q
673 if (code == B6X) { return B06; } // BeiDou B3 - B3I, B3Q, combined
674 if (code == B6A) { return B06; } // BeiDou B3 - B3A
675 if (code == B7I) { return B07; } // BeiDou B2b (BDS-2) - B2I(OS)
676 if (code == B7Q) { return B07; } // BeiDou B2b (BDS-2) - B2Q
677 if (code == B7X) { return B07; } // BeiDou B2b (BDS-2) - B2I(OS), B2Q, combined
678 if (code == B7D) { return B07; } // BeiDou B2b (BDS-3) - Data (D)
679 if (code == B7P) { return B07; } // BeiDou B2b (BDS-3) - Pilot(P)
680 if (code == B7Z) { return B07; } // BeiDou B2b (BDS-3) - D+P
681 if (code == B8D) { return B08; } // BeiDou B2 (B2a+B2b) - Data (D)
682 if (code == B8P) { return B08; } // BeiDou B2 (B2a+B2b) - Pilot(P)
683 if (code == B8X) { return B08; } // BeiDou B2 (B2a+B2b) - D+P
684
685 if (code == J1C) { return J01; } // QZSS L1 - C/A-code
686 if (code == J1S) { return J01; } // QZSS L1 - L1C (data)
687 if (code == J1L) { return J01; } // QZSS L1 - L1C (pilot)
688 if (code == J1X) { return J01; } // QZSS L1 - L1C (combined)
689 if (code == J1Z) { return J01; } // QZSS L1 - L1-SAIF signal
690 if (code == J2S) { return J02; } // QZSS L2 - L2C-code (medium)
691 if (code == J2L) { return J02; } // QZSS L2 - L2C-code (long)
692 if (code == J2X) { return J02; } // QZSS L2 - L2C-code (combined)
693 if (code == J5I) { return J05; } // QZSS L5 - Data
694 if (code == J5Q) { return J05; } // QZSS L5 - Pilot
695 if (code == J5X) { return J05; } // QZSS L5 - Combined
696 if (code == J5D) { return J05; } // QZSS L5S - I
697 if (code == J5P) { return J05; } // QZSS L5S - Q
698 if (code == J5Z) { return J05; } // QZSS L5S - I+Q
699 if (code == J6S) { return J06; } // QZSS L6 - L6D LEX signal (short)
700 if (code == J6L) { return J06; } // QZSS L6 - L6P LEX signal (long)
701 if (code == J6X) { return J06; } // QZSS L6 - L6(D+P) LEX signal (combined)
702 if (code == J6E) { return J06; } // QZSS L6 - L6E
703 if (code == J6Z) { return J06; } // QZSS L6 - L6(D+E)
704
705 if (code == I5A) { return I05; } // IRNSS L5 - SPS Signal
706 if (code == I5B) { return I05; } // IRNSS L5 - RS (data)
707 if (code == I5C) { return I05; } // IRNSS L5 - RS (pilot)
708 if (code == I5X) { return I05; } // IRNSS L5 - RS (combined)
709 if (code == I9A) { return I09; } // IRNSS S - SPS signal
710 if (code == I9B) { return I09; } // IRNSS S - RS (data)
711 if (code == I9C) { return I09; } // IRNSS S - RS (pilot)
712 if (code == I9X) { return I09; } // IRNSS S - RS (combined)
713
714 if (code == S1C) { return S01; } // SBAS L1 - C/A-code
715 if (code == S5I) { return S05; } // SBAS L5 - Data
716 if (code == S5Q) { return S05; } // SBAS L5 - Pilot
717 if (code == S5X) { return S05; } // SBAS L5 - Combined
718
719 return Freq_None;
720}
721
723{
724 return GetCodeFequency(*this);
725}
726
727bool Code::IsCodeCombined(Code first, Code second)
728{
729 return ((first & Code_G1S_G1L_G1X) && (second & Code_G1S_G1L_G1X))
730 || ((first & Code_G2S_G2L_G2X) && (second & Code_G2S_G2L_G2X))
731 || ((first & Code_G5I_G5Q_G5X) && (second & Code_G5I_G5Q_G5X))
732 || ((first & Code_E1B_E1C_E1X) && (second & Code_E1B_E1C_E1X))
733 || ((first & Code_E5I_E5Q_E5X) && (second & Code_E5I_E5Q_E5X))
734 || ((first & Code_E6B_E6C_E6X) && (second & Code_E6B_E6C_E6X))
735 || ((first & Code_E7I_E7Q_E7X) && (second & Code_E7I_E7Q_E7X))
736 || ((first & Code_E8I_E8Q_E8X) && (second & Code_E8I_E8Q_E8X))
737 || ((first & Code_R3I_R3Q_R3X) && (second & Code_R3I_R3Q_R3X))
738 || ((first & Code_R4A_R4B_R4X) && (second & Code_R4A_R4B_R4X))
739 || ((first & Code_R6A_R6B_R6X) && (second & Code_R6A_R6B_R6X))
740 || ((first & Code_B1D_B1P_B1X) && (second & Code_B1D_B1P_B1X))
741 || ((first & Code_B2I_B2Q_B2X) && (second & Code_B2I_B2Q_B2X))
742 || ((first & Code_B5D_B5P_B5X) && (second & Code_B5D_B5P_B5X))
743 || ((first & Code_B6I_B6Q_B6X) && (second & Code_B6I_B6Q_B6X))
744 || ((first & Code_B7I_B7Q_B7X) && (second & Code_B7I_B7Q_B7X))
745 || ((first & Code_B7D_B7P_B7Z) && (second & Code_B7D_B7P_B7Z))
746 || ((first & Code_B8D_B8P_B8X) && (second & Code_B8D_B8P_B8X))
747 || ((first & Code_J1S_J1L_J1X) && (second & Code_J1S_J1L_J1X))
748 || ((first & Code_J2S_J2L_J2X) && (second & Code_J2S_J2L_J2X))
749 || ((first & Code_J5I_J5Q_J5X) && (second & Code_J5I_J5Q_J5X))
750 || ((first & Code_J5D_J5P_J5Z) && (second & Code_J5D_J5P_J5Z))
751 || ((first & Code_J6S_J6L_J6X) && (second & Code_J6S_J6L_J6X))
752 || ((first & Code_I5B_I5C_I5X) && (second & Code_I5B_I5C_I5X))
753 || ((first & Code_I9B_I9C_I9X) && (second & Code_I9B_I9C_I9X))
754 || ((first & Code_S5I_S5Q_S5X) && (second & Code_S5I_S5Q_S5X));
755}
756
757std::vector<Code> Code::GetAll()
758{
759 std::vector<Code> codes;
760 codes.reserve(COUNT);
761 for (size_t i = 1; i < static_cast<size_t>(COUNT); i++)
762 {
763 codes.emplace_back(static_cast<Enum>(i));
764 }
765 return codes;
766}
767
769{
770 for (size_t i = 0; i < static_cast<size_t>(COUNT); i++)
771 {
772 if (static_cast<Enum>(i) == code) { return static_cast<Enum>(i); }
773 }
774 return Code::None;
775}
776
778{
779 return GetCodeEnumValue(*this);
780}
781
782// #########################################################################################################################################
783
784Code operator|(const Code& lhs, const Code& rhs)
785{
786 return Code(lhs.value | rhs.value);
787}
788Code operator|(const Code& lhs, const Code::Enum& rhs)
789{
790 return Code(lhs.value | Code(rhs).value);
791}
792Code operator|(const Code::Enum& lhs, const Code& rhs)
793{
794 return Code(Code::Set().set(lhs, true) | rhs.value);
795}
796
798{
799 *this = *this | rhs;
800 return *this;
801}
803{
804 *this = *this | rhs;
805 return *this;
806}
807
808Code operator&(const Code& lhs, const Code& rhs)
809{
810 return Code(lhs.value & rhs.value);
811}
812Code operator&(const Code& lhs, const Code::Enum& rhs)
813{
814 return Code(lhs.value & Code::Set().set(rhs, true));
815}
816Code operator&(const Code::Enum& lhs, const Code& rhs)
817{
818 return Code(Code::Set().set(lhs, true) & rhs.value);
819}
820
821Code operator|(const Code::Enum& lhs, const Code::Enum& rhs)
822{
823 return Code(lhs) | Code(rhs);
824}
825Code operator&(const Code::Enum& lhs, const Code::Enum& rhs)
826{
827 return Code(lhs) & Code(rhs);
828}
829
831{
832 *this = *this & rhs;
833 return *this;
834}
836{
837 *this = *this & rhs;
838 return *this;
839}
840
842{
843 return Code(~value);
844}
845
846// #########################################################################################################################################
847
848bool operator==(const Code& lhs, const Code& rhs)
849{
850 return lhs.value == rhs.value;
851}
852
853bool operator==(const Code& lhs, const Code::Enum& rhs)
854{
855 return lhs.value == Code(rhs).value;
856}
857
858bool operator==(const Code::Enum& lhs, const Code& rhs)
859{
860 return Code(lhs).value == rhs.value;
861}
862
863bool operator!=(const Code& lhs, const Code& rhs)
864{
865 return !(lhs == rhs);
866}
867
868bool operator!=(const Code& lhs, const Code::Enum& rhs)
869{
870 return !(lhs == rhs);
871}
872
873bool operator!=(const Code::Enum& lhs, const Code& rhs)
874{
875 return !(lhs == rhs);
876}
877
878bool operator<(const Code& lhs, const Code& rhs)
879{
880 return lhs.getEnumValue() < rhs.getEnumValue();
881}
882
883bool operator<(const Code& lhs, const Code::Enum& rhs)
884{
885 return lhs.getEnumValue() < rhs;
886}
887
888bool operator<(const Code::Enum& lhs, const Code& rhs)
889{
890 return lhs < rhs.getEnumValue();
891}
892
893// #########################################################################################################################################
894
896{
897 if (rhs == SatSys_None)
898 {
899 return Code(Code::Set());
900 }
901 if (rhs & GPS)
902 {
903 for (int i = Code::_GPS_START; i <= Code::_GPS_END; i++) { lhs &= Code(Code::Enum(i)); }
904 }
905 if (rhs & GAL)
906 {
907 for (int i = Code::_GAL_START; i <= Code::_GAL_END; i++) { lhs &= Code(Code::Enum(i)); }
908 }
909 if (rhs & GLO)
910 {
911 for (int i = Code::_GLO_START; i <= Code::_GLO_END; i++) { lhs &= Code(Code::Enum(i)); }
912 }
913 if (rhs & BDS)
914 {
915 for (int i = Code::_BDS_START; i <= Code::_BDS_END; i++) { lhs &= Code(Code::Enum(i)); }
916 }
917 if (rhs & QZSS)
918 {
919 for (int i = Code::_QZSS_START; i <= Code::_QZSS_END; i++) { lhs &= Code(Code::Enum(i)); }
920 }
921 if (rhs & IRNSS)
922 {
923 for (int i = Code::_IRNSS_START; i <= Code::_IRNSS_END; i++) { lhs &= Code(Code::Enum(i)); }
924 }
925 if (rhs & SBAS)
926 {
927 for (int i = Code::_SBAS_START; i <= Code::_SBAS_END; i++) { lhs &= Code(Code::Enum(i)); }
928 }
929
930 return lhs;
931}
933{
934 return rhs & lhs;
935}
937{
938 *this = *this & rhs;
939 return *this;
940}
942{
943 return lhs & SatelliteSystem_(rhs);
944}
946{
947 return SatelliteSystem_(lhs) & rhs;
948}
950{
951 *this = *this & rhs;
952 return *this;
953}
954
956{
957 if (rhs == SatSys_None)
958 {
959 return lhs;
960 }
961 if (rhs & GPS)
962 {
963 for (int i = Code::_GPS_START; i <= Code::_GPS_END; i++) { lhs |= Code(Code::Enum(i)); }
964 }
965 if (rhs & GAL)
966 {
967 for (int i = Code::_GAL_START; i <= Code::_GAL_END; i++) { lhs |= Code(Code::Enum(i)); }
968 }
969 if (rhs & GLO)
970 {
971 for (int i = Code::_GLO_START; i <= Code::_GLO_END; i++) { lhs |= Code(Code::Enum(i)); }
972 }
973 if (rhs & BDS)
974 {
975 for (int i = Code::_BDS_START; i <= Code::_BDS_END; i++) { lhs |= Code(Code::Enum(i)); }
976 }
977 if (rhs & QZSS)
978 {
979 for (int i = Code::_QZSS_START; i <= Code::_QZSS_END; i++) { lhs |= Code(Code::Enum(i)); }
980 }
981 if (rhs & IRNSS)
982 {
983 for (int i = Code::_IRNSS_START; i <= Code::_IRNSS_END; i++) { lhs |= Code(Code::Enum(i)); }
984 }
985 if (rhs & SBAS)
986 {
987 for (int i = Code::_SBAS_START; i <= Code::_SBAS_END; i++) { lhs |= Code(Code::Enum(i)); }
988 }
989
990 return lhs;
991}
993{
994 return rhs | lhs;
995}
997{
998 *this = *this | rhs;
999 return *this;
1000}
1002{
1003 return lhs | SatelliteSystem_(rhs);
1004}
1006{
1007 return SatelliteSystem_(lhs) | rhs;
1008}
1010{
1011 *this = *this | rhs;
1012 return *this;
1013}
1014
1015// #########################################################################################################################################
1016
1018{
1019 LOG_DATA("Before ({}) & ({})", Frequency(rhs), lhs);
1020 if (rhs == Freq_None)
1021 {
1022 return Code(Code::Set());
1023 }
1024 if (!(rhs & Frequency_::G01))
1025 {
1026 for (int i = Code::_G01_START; i <= Code::_G01_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1027 }
1028 if (!(rhs & Frequency_::G02))
1029 {
1030 for (int i = Code::_G02_START; i <= Code::_G02_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1031 }
1032 if (!(rhs & Frequency_::G05))
1033 {
1034 for (int i = Code::_G05_START; i <= Code::_G05_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1035 }
1036 if (!(rhs & Frequency_::E01))
1037 {
1038 for (int i = Code::_E01_START; i <= Code::_E01_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1039 }
1040 if (!(rhs & Frequency_::E05))
1041 {
1042 for (int i = Code::_E05_START; i <= Code::_E05_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1043 }
1044 if (!(rhs & Frequency_::E06))
1045 {
1046 for (int i = Code::_E06_START; i <= Code::_E06_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1047 }
1048 if (!(rhs & Frequency_::E07))
1049 {
1050 for (int i = Code::_E07_START; i <= Code::_E07_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1051 }
1052 if (!(rhs & Frequency_::E08))
1053 {
1054 for (int i = Code::_E08_START; i <= Code::_E08_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1055 }
1056 if (!((rhs & Frequency_::R01) || (rhs & Frequency_::R04)))
1057 {
1058 for (int i = Code::_R01_START; i <= Code::_R01_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1059 }
1060 if (!((rhs & Frequency_::R02) || (rhs & Frequency_::R06)))
1061 {
1062 for (int i = Code::_R02_START; i <= Code::_R02_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1063 }
1064 if (!(rhs & Frequency_::R03))
1065 {
1066 for (int i = Code::_R03_START; i <= Code::_R03_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1067 }
1068 if (!(rhs & Frequency_::R04))
1069 {
1070 for (int i = Code::_R04_START; i <= Code::_R04_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1071 }
1072 if (!(rhs & Frequency_::R06))
1073 {
1074 for (int i = Code::_R06_START; i <= Code::_R06_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1075 }
1076 if (!(rhs & Frequency_::B01))
1077 {
1078 for (int i = Code::_B01_START; i <= Code::_B01_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1079 }
1080 if (!(rhs & Frequency_::B02))
1081 {
1082 for (int i = Code::_B02_START; i <= Code::_B02_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1083 }
1084 if (!(rhs & Frequency_::B05))
1085 {
1086 for (int i = Code::_B05_START; i <= Code::_B05_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1087 }
1088 if (!(rhs & Frequency_::B06))
1089 {
1090 for (int i = Code::_B06_START; i <= Code::_B06_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1091 }
1092 if (!(rhs & Frequency_::B07))
1093 {
1094 for (int i = Code::_B07_START; i <= Code::_B07_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1095 }
1096 if (!(rhs & Frequency_::B08))
1097 {
1098 for (int i = Code::_B08_START; i <= Code::_B08_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1099 }
1100 if (!(rhs & Frequency_::J01))
1101 {
1102 for (int i = Code::_J01_START; i <= Code::_J01_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1103 }
1104 if (!(rhs & Frequency_::J02))
1105 {
1106 for (int i = Code::_J02_START; i <= Code::_J02_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1107 }
1108 if (!(rhs & Frequency_::J05))
1109 {
1110 for (int i = Code::_J05_START; i <= Code::_J05_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1111 }
1112 if (!(rhs & Frequency_::J06))
1113 {
1114 for (int i = Code::_J06_START; i <= Code::_J06_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1115 }
1116 if (!(rhs & Frequency_::I05))
1117 {
1118 for (int i = Code::_I05_START; i <= Code::_I05_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1119 }
1120 if (!(rhs & Frequency_::I09))
1121 {
1122 for (int i = Code::_I09_START; i <= Code::_I09_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1123 }
1124 if (!(rhs & Frequency_::S01))
1125 {
1126 for (int i = Code::_S01_START; i <= Code::_S01_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1127 }
1128 if (!(rhs & Frequency_::S05))
1129 {
1130 for (int i = Code::_S05_START; i <= Code::_S05_END; i++) { lhs &= ~Code(Code::Enum(i)); }
1131 }
1132 LOG_DATA("After ({}) & ({})", Frequency(rhs), lhs);
1133
1134 return lhs;
1135}
1137{
1138 return rhs & lhs;
1139}
1141{
1142 *this = *this & rhs;
1143 return *this;
1144}
1146{
1147 return lhs & Frequency_(rhs);
1148}
1150{
1151 return Frequency_(lhs) & rhs;
1152}
1154{
1155 *this = *this & rhs;
1156 return *this;
1157}
1158
1160{
1161 LOG_DATA("Before ({}) & ({})", Frequency(rhs), lhs);
1162 if (rhs == Freq_None)
1163 {
1164 return lhs;
1165 }
1166 if (rhs & Frequency_::G01)
1167 {
1168 for (int i = Code::_G01_START; i <= Code::_G01_END; i++) { lhs |= Code(Code::Enum(i)); }
1169 }
1170 if (rhs & Frequency_::G02)
1171 {
1172 for (int i = Code::_G02_START; i <= Code::_G02_END; i++) { lhs |= Code(Code::Enum(i)); }
1173 }
1174 if (rhs & Frequency_::G05)
1175 {
1176 for (int i = Code::_G05_START; i <= Code::_G05_END; i++) { lhs |= Code(Code::Enum(i)); }
1177 }
1178 if (rhs & Frequency_::E01)
1179 {
1180 for (int i = Code::_E01_START; i <= Code::_E01_END; i++) { lhs |= Code(Code::Enum(i)); }
1181 }
1182 if (rhs & Frequency_::E05)
1183 {
1184 for (int i = Code::_E05_START; i <= Code::_E05_END; i++) { lhs |= Code(Code::Enum(i)); }
1185 }
1186 if (rhs & Frequency_::E06)
1187 {
1188 for (int i = Code::_E06_START; i <= Code::_E06_END; i++) { lhs |= Code(Code::Enum(i)); }
1189 }
1190 if (rhs & Frequency_::E07)
1191 {
1192 for (int i = Code::_E07_START; i <= Code::_E07_END; i++) { lhs |= Code(Code::Enum(i)); }
1193 }
1194 if (rhs & Frequency_::E08)
1195 {
1196 for (int i = Code::_E08_START; i <= Code::_E08_END; i++) { lhs |= Code(Code::Enum(i)); }
1197 }
1198 if ((rhs & Frequency_::R01) || (rhs & Frequency_::R04))
1199 {
1200 for (int i = Code::_R01_START; i <= Code::_R01_END; i++) { lhs |= Code(Code::Enum(i)); }
1201 }
1202 if ((rhs & Frequency_::R02) || (rhs & Frequency_::R06))
1203 {
1204 for (int i = Code::_R02_START; i <= Code::_R02_END; i++) { lhs |= Code(Code::Enum(i)); }
1205 }
1206 if (rhs & Frequency_::R03)
1207 {
1208 for (int i = Code::_R03_START; i <= Code::_R03_END; i++) { lhs |= Code(Code::Enum(i)); }
1209 }
1210 if (rhs & Frequency_::R04)
1211 {
1212 for (int i = Code::_R04_START; i <= Code::_R04_END; i++) { lhs |= Code(Code::Enum(i)); }
1213 }
1214 if (rhs & Frequency_::R06)
1215 {
1216 for (int i = Code::_R06_START; i <= Code::_R06_END; i++) { lhs |= Code(Code::Enum(i)); }
1217 }
1218 if (rhs & Frequency_::B01)
1219 {
1220 for (int i = Code::_B01_START; i <= Code::_B01_END; i++) { lhs |= Code(Code::Enum(i)); }
1221 }
1222 if (rhs & Frequency_::B02)
1223 {
1224 for (int i = Code::_B02_START; i <= Code::_B02_END; i++) { lhs |= Code(Code::Enum(i)); }
1225 }
1226 if (rhs & Frequency_::B05)
1227 {
1228 for (int i = Code::_B05_START; i <= Code::_B05_END; i++) { lhs |= Code(Code::Enum(i)); }
1229 }
1230 if (rhs & Frequency_::B06)
1231 {
1232 for (int i = Code::_B06_START; i <= Code::_B06_END; i++) { lhs |= Code(Code::Enum(i)); }
1233 }
1234 if (rhs & Frequency_::B07)
1235 {
1236 for (int i = Code::_B07_START; i <= Code::_B07_END; i++) { lhs |= Code(Code::Enum(i)); }
1237 }
1238 if (rhs & Frequency_::B08)
1239 {
1240 for (int i = Code::_B08_START; i <= Code::_B08_END; i++) { lhs |= Code(Code::Enum(i)); }
1241 }
1242 if (rhs & Frequency_::J01)
1243 {
1244 for (int i = Code::_J01_START; i <= Code::_J01_END; i++) { lhs |= Code(Code::Enum(i)); }
1245 }
1246 if (rhs & Frequency_::J02)
1247 {
1248 for (int i = Code::_J02_START; i <= Code::_J02_END; i++) { lhs |= Code(Code::Enum(i)); }
1249 }
1250 if (rhs & Frequency_::J05)
1251 {
1252 for (int i = Code::_J05_START; i <= Code::_J05_END; i++) { lhs |= Code(Code::Enum(i)); }
1253 }
1254 if (rhs & Frequency_::J06)
1255 {
1256 for (int i = Code::_J06_START; i <= Code::_J06_END; i++) { lhs |= Code(Code::Enum(i)); }
1257 }
1258 if (rhs & Frequency_::I05)
1259 {
1260 for (int i = Code::_I05_START; i <= Code::_I05_END; i++) { lhs |= Code(Code::Enum(i)); }
1261 }
1262 if (rhs & Frequency_::I09)
1263 {
1264 for (int i = Code::_I09_START; i <= Code::_I09_END; i++) { lhs |= Code(Code::Enum(i)); }
1265 }
1266 if (rhs & Frequency_::S01)
1267 {
1268 for (int i = Code::_S01_START; i <= Code::_S01_END; i++) { lhs |= Code(Code::Enum(i)); }
1269 }
1270 if (rhs & Frequency_::S05)
1271 {
1272 for (int i = Code::_S05_START; i <= Code::_S05_END; i++) { lhs |= Code(Code::Enum(i)); }
1273 }
1274 LOG_DATA("After ({}) & ({})", Frequency(rhs), lhs);
1275
1276 return lhs;
1277}
1279{
1280 return rhs | lhs;
1281}
1283{
1284 *this = *this | rhs;
1285 return *this;
1286}
1288{
1289 return lhs | Frequency_(rhs);
1290}
1292{
1293 return Frequency_(lhs) | rhs;
1294}
1296{
1297 *this = *this | rhs;
1298 return *this;
1299}
1300
1301void to_json(json& j, const Code& data)
1302{
1303 j = Code::Set(data).to_string();
1304}
1305void from_json(const json& j, Code& data)
1306{
1307 data = Code(Code::Set(j.get<std::string>()));
1308}
1309
1310bool ShowCodeSelector(const char* label, Code& code, const Frequency& filterFreq, bool singleSelect)
1311{
1312 bool valueChanged = false;
1313 if (ImGui::BeginCombo(label, std::string(code).c_str(), ImGuiComboFlags_HeightLargest))
1314 {
1315 if (ImGui::BeginTable(fmt::format("{} Table", label).c_str(), 7, ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_ScrollY))
1316 {
1317 ImGui::TableSetupScrollFreeze(0, 1);
1318 for (uint64_t satSys = 0xFF; satSys < static_cast<uint64_t>(0xFF) << (7 * 8); satSys = satSys << 8UL)
1319 {
1320 ImGui::TableSetupColumn(std::string(SatelliteSystem(SatelliteSystem_(satSys))).c_str());
1321 }
1322 ImGui::TableHeadersRow();
1323 ImGui::TableNextRow();
1324 for (int satSys = 0; satSys < 7; satSys++)
1325 {
1326 ImGui::TableSetColumnIndex(satSys);
1327 for (uint64_t f = 0; f < 8; f++)
1328 {
1329 uint64_t flag = (static_cast<uint64_t>(1) << (f + static_cast<uint64_t>(satSys) * 8));
1330 auto frequency = Frequency(Frequency_(flag));
1331 auto text = std::string(frequency);
1332 if (text == "None")
1333 {
1334 continue;
1335 }
1336 bool hasCode = false;
1337 for (int c = 0; c < Code::COUNT; c++)
1338 {
1339 auto co = Code(Code::Enum(c));
1340 if (co.getFrequency() == frequency)
1341 {
1342 hasCode = true;
1343 break;
1344 }
1345 }
1346 if (hasCode)
1347 {
1348 ImGui::Text("%s", text.c_str());
1349 if (!(frequency & filterFreq))
1350 {
1351 ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.6F);
1352 }
1353 ImGui::Indent();
1354 for (int c = 0; c < Code::COUNT; c++)
1355 {
1356 auto co = Code(Code::Enum(c));
1357 if (co.getFrequency() == frequency)
1358 {
1359 auto checked = bool(co & code);
1360 if (c > 0 && Code::IsCodeCombined(Code(Code::Enum(c - 1)), co))
1361 {
1362 ImGui::SameLine();
1363 }
1364 if (ImGui::Checkbox(std::string(co).c_str(), &checked) && (frequency & filterFreq))
1365 {
1366 if (checked)
1367 {
1368 if (singleSelect) { code = co; }
1369 else { code |= co; }
1370 valueChanged = true;
1371 }
1372 else if (!singleSelect)
1373 {
1374 code &= ~co;
1375 valueChanged = true;
1376 }
1377 }
1378 if (ImGui::IsItemHovered())
1379 {
1380 ImGui::SetTooltip("%s", co.getDescription());
1381 }
1382 }
1383 }
1384 ImGui::Unindent();
1385 if (!(frequency & filterFreq))
1386 {
1387 ImGui::PopStyleVar();
1388 }
1389 }
1390 }
1391 }
1392
1393 ImGui::EndTable();
1394 }
1395 ImGui::EndCombo();
1396 }
1397 return valueChanged;
1398}
1399
1400} // namespace NAV
1401
1402std::ostream& operator<<(std::ostream& os, const NAV::Code& obj)
1403{
1404 return os << fmt::format("{}", obj);
1405}
std::ostream & operator<<(std::ostream &os, const NAV::Code &obj)
Stream insertion operator overload.
Definition Code.cpp:1402
Code definitions.
nlohmann::json json
json namespace
Utility class for logging to console and file.
#define LOG_DATA
All output which occurs repeatedly every time observations are received.
Definition Logger.hpp:29
#define LOG_WARN
Error occurred, but a fallback option exists and program continues to work normally.
Definition Logger.hpp:71
Enumerate for GNSS Codes.
Definition Code.hpp:89
Code & operator|=(const Code &rhs)
Allows combining flags of the Code enum.
Definition Code.cpp:797
Set value
Code bitset.
Definition Code.hpp:597
const char * getDescription() const
Returns a short description for the code.
Definition Code.cpp:598
std::bitset< COUNT > Set
Typedef for the bitset with size of COUNT.
Definition Code.hpp:293
Enum
Enumeration of all Codes.
Definition Code.hpp:93
@ E6B
GAL E6 - Data.
Definition Code.hpp:128
@ G2P
GPS L2 - P-code (unencrypted)
Definition Code.hpp:110
@ G2C
GPS L2 - C/A-code.
Definition Code.hpp:105
@ R3X
GLO L3 - Combined.
Definition Code.hpp:145
@ B7I
BeiDou B2b (BDS-2) - B2I(OS)
Definition Code.hpp:166
@ R1C
GLO L1 - C/A-code.
Definition Code.hpp:139
@ R6A
GLO G2a - L2CSI (data)
Definition Code.hpp:149
@ J2L
QZSS L2 - L2C-code (long)
Definition Code.hpp:182
@ G1L
GPS L1 - L1C-P (pilot)
Definition Code.hpp:98
@ G2D
GPS L2 - Semi-codeless P(Y) tracking (L1 C/A + (P2-P1))
Definition Code.hpp:106
@ B6Q
BeiDou B3 - B3Q.
Definition Code.hpp:163
@ I5X
IRNSS L5 - RS (combined)
Definition Code.hpp:199
@ J6L
QZSS L6 - L6P LEX signal (long)
Definition Code.hpp:191
@ E7I
GAL E5b - Data.
Definition Code.hpp:132
@ E5Q
GAL E5a - Pilot.
Definition Code.hpp:125
@ B5P
BeiDou B2a - Pilot(P)
Definition Code.hpp:160
@ B7D
BeiDou B2b (BDS-3) - Data (D)
Definition Code.hpp:169
@ B5X
BeiDou B2a - D+P.
Definition Code.hpp:161
@ S1C
SBAS L1 - C/A-code.
Definition Code.hpp:205
@ S5Q
SBAS L5 - Pilot.
Definition Code.hpp:207
@ G1Y
GPS L1 - Y-code (with decryption)
Definition Code.hpp:102
@ G1X
GPS L1 - L1C-(D+P) (combined)
Definition Code.hpp:99
@ E1B
GAL E1 - OS (data)
Definition Code.hpp:120
@ G1M
GPS L1 - M-code.
Definition Code.hpp:103
@ J5I
QZSS L5 - Data.
Definition Code.hpp:184
@ J1Z
QZSS L1 - L1-SAIF signal.
Definition Code.hpp:180
@ J5P
QZSS L5S - Q.
Definition Code.hpp:188
@ G1N
GPS L1 - codeless.
Definition Code.hpp:104
@ G2X
GPS L2 - L2C(M+L) (combined)
Definition Code.hpp:109
@ J6X
QZSS L6 - L6(D+P) LEX signal (combined)
Definition Code.hpp:192
@ J5D
QZSS L5S - I.
Definition Code.hpp:187
@ E6X
GAL E6 - Combined (B+C)
Definition Code.hpp:130
@ J1L
QZSS L1 - L1C (pilot)
Definition Code.hpp:178
@ J1S
QZSS L1 - L1C (data)
Definition Code.hpp:177
@ I5C
IRNSS L5 - RS (pilot)
Definition Code.hpp:198
@ J5Z
QZSS L5S - I+Q.
Definition Code.hpp:189
@ I5B
IRNSS L5 - RS (data)
Definition Code.hpp:197
@ J1X
QZSS L1 - L1C (combined)
Definition Code.hpp:179
@ J6E
QZSS L6 - L6E.
Definition Code.hpp:193
@ E8X
GAL E5(a+b) - AltBOC (combined)
Definition Code.hpp:137
@ R2C
GLO L2 - C/A-code.
Definition Code.hpp:141
@ B6A
BeiDou B3 - B3A.
Definition Code.hpp:165
@ G2Y
GPS L2 - Y-code (with decryption)
Definition Code.hpp:112
@ G5X
GPS L5 - Combined.
Definition Code.hpp:117
@ E5I
GAL E5a - Data.
Definition Code.hpp:124
@ E1Z
GAL E1 - PRS + OS (data + pilot)
Definition Code.hpp:123
@ R3Q
GLO L3 - Pilot.
Definition Code.hpp:144
@ J1C
QZSS L1 - C/A-code.
Definition Code.hpp:176
@ J5Q
QZSS L5 - Pilot.
Definition Code.hpp:185
@ E6Z
GAL E6 - PRS + OS (A+B+C)
Definition Code.hpp:131
@ R3I
GLO L3 - Data.
Definition Code.hpp:143
@ None
None.
Definition Code.hpp:94
@ G1P
GPS L1 - P-code (unencrypted)
Definition Code.hpp:100
@ B1P
BeiDou B1 - Pilot(P)
Definition Code.hpp:154
@ J2X
QZSS L2 - L2C-code (combined)
Definition Code.hpp:183
@ G1C
GPS L1 - C/A-code.
Definition Code.hpp:96
@ B1D
BeiDou B1 - Data (D)
Definition Code.hpp:153
@ G1W
GPS L1 - Semicodeless P(Y) tracking (Z-tracking)
Definition Code.hpp:101
@ G2L
GPS L2 - L2C(L) (long)
Definition Code.hpp:108
@ I5A
IRNSS L5 - SPS Signal.
Definition Code.hpp:196
@ R1P
GLO L1 - P-code.
Definition Code.hpp:140
@ R6B
GLO G2a - L2OCp (pilot)
Definition Code.hpp:150
@ I9X
IRNSS S - RS (combined)
Definition Code.hpp:203
@ E7X
GAL E5b - Combined.
Definition Code.hpp:134
@ B8X
BeiDou B2 (B2a+B2b) - D+P.
Definition Code.hpp:174
@ B2Q
BeiDou B1-2 - B1Q.
Definition Code.hpp:157
@ R4X
GLO G1a - L1OCd+L1OCp (combined)
Definition Code.hpp:148
@ J5X
QZSS L5 - Combined.
Definition Code.hpp:186
@ B8D
BeiDou B2 (B2a+B2b) - Data (D)
Definition Code.hpp:172
@ E8I
GAL E5(a+b) - AltBOC (data)
Definition Code.hpp:135
@ G5Q
GPS L5 - Pilot.
Definition Code.hpp:116
@ B7P
BeiDou B2b (BDS-3) - Pilot(P)
Definition Code.hpp:170
@ G2W
GPS L2 - Semicodeless P(Y) tracking (Z-tracking)
Definition Code.hpp:111
@ G2M
GPS L2 - M-code.
Definition Code.hpp:113
@ R2P
GLO L2 - P-code.
Definition Code.hpp:142
@ G2N
GPS L2 - codeless.
Definition Code.hpp:114
@ E1A
GAL E1 - PRS signal.
Definition Code.hpp:119
@ S5X
SBAS L5 - Combined.
Definition Code.hpp:208
@ E8Q
GAL E5(a+b) - AltBOC (pilot)
Definition Code.hpp:136
@ B5D
BeiDou B2a - Data (D)
Definition Code.hpp:159
@ J6S
QZSS L6 - L6D LEX signal (short)
Definition Code.hpp:190
@ R4B
GLO G1a - L1OCp (pilot)
Definition Code.hpp:147
@ G5I
GPS L5 - Data.
Definition Code.hpp:115
@ S5I
SBAS L5 - Data.
Definition Code.hpp:206
@ I9A
IRNSS S - SPS signal.
Definition Code.hpp:200
@ B6X
BeiDou B3 - B3I, B3Q, combined.
Definition Code.hpp:164
@ B7X
BeiDou B2b (BDS-2) - B2I(OS), B2Q, combined.
Definition Code.hpp:168
@ E1X
GAL E1 - OS(B+C) (combined)
Definition Code.hpp:122
@ E6A
GAL E6 - PRS signal.
Definition Code.hpp:127
@ B2I
BeiDou B1-2 - B1I(OS)
Definition Code.hpp:156
@ E6C
GAL E6 - Pilot.
Definition Code.hpp:129
@ B7Q
BeiDou B2b (BDS-2) - B2Q.
Definition Code.hpp:167
@ J6Z
QZSS L6 - L6(D+E)
Definition Code.hpp:194
@ R6X
GLO G2a - L2CSI+L2OCp (combined)
Definition Code.hpp:151
@ G1S
GPS L1 - L1C-D (data)
Definition Code.hpp:97
@ I9C
IRNSS S - RS (pilot)
Definition Code.hpp:202
@ B2X
BeiDou B1-2 - B1I(OS), B1Q, combined.
Definition Code.hpp:158
@ B7Z
BeiDou B2b (BDS-3) - D+P.
Definition Code.hpp:171
@ E7Q
GAL E5b - Pilot.
Definition Code.hpp:133
@ B8P
BeiDou B2 (B2a+B2b) - Pilot(P)
Definition Code.hpp:173
@ B6I
BeiDou B3 - B3I.
Definition Code.hpp:162
@ B1X
BeiDou B1 - D+P.
Definition Code.hpp:155
@ E1C
GAL E1 - OS (pilot)
Definition Code.hpp:121
@ G2S
GPS L2 - L2C(M) (medium)
Definition Code.hpp:107
@ I9B
IRNSS S - RS (data)
Definition Code.hpp:201
@ E5X
GAL E5a - Combined.
Definition Code.hpp:126
@ J2S
QZSS L2 - L2C-code (medium)
Definition Code.hpp:181
@ R4A
GLO G1a - L1OCd (data)
Definition Code.hpp:146
static Frequency GetCodeFequency(Code code)
Returns the frequency for the code.
Definition Code.cpp:603
Frequency getFrequency() const
Returns the frequency for the code.
Definition Code.cpp:722
Code & operator&=(const Code &rhs)
Allows combining flags of the Code enum.
Definition Code.cpp:830
static Enum GetCodeEnumValue(Code code)
Returns the enum value for the code (only one must be set)
Definition Code.cpp:768
Enum getEnumValue() const
Returns the enum value for the code (only one must be set)
Definition Code.cpp:777
static bool IsCodeCombined(Code first, Code second)
Checks if the codes are part of a combined code.
Definition Code.cpp:727
static Code fromFreqAttr(Frequency freq, char attribute)
Generates a Code from frequency and attribute.
Definition Code.cpp:299
Code operator~() const
Allows negating flags of the Code enum.
Definition Code.cpp:841
constexpr Code()=default
Default constructor for an empty code.
static std::vector< Code > GetAll()
Returns a list with all possible codes.
Definition Code.cpp:757
@ _S05_START
SBAS L start index in the Enum.
Definition Code.hpp:286
@ _GAL_START
GAL start index in the Enum.
Definition Code.hpp:215
@ _GPS_END
GPS end index in the Enum.
Definition Code.hpp:214
@ _J06_END
QZSS L6 end index in the Enum.
Definition Code.hpp:277
@ _GAL_END
GAL end index in the Enum.
Definition Code.hpp:216
@ _R04_END
GLO G1a end index in the Enum.
Definition Code.hpp:253
@ _R04_START
GLO G1a start index in the Enum.
Definition Code.hpp:252
@ _B06_END
BDS B3 end index in the Enum.
Definition Code.hpp:264
@ _I09_END
IRNSS S end index in the Enum.
Definition Code.hpp:282
@ _E01_START
GAL E1 start index in the Enum.
Definition Code.hpp:235
@ _E06_START
GAL E6 start index in the Enum.
Definition Code.hpp:239
@ _G05_START
GPS L5 start index in the Enum.
Definition Code.hpp:232
@ _B08_END
BDS B2 (B2a+B2b) end index in the Enum.
Definition Code.hpp:268
@ _R01_START
GLO L1 start index in the Enum.
Definition Code.hpp:246
@ _B05_START
BDS B2a start index in the Enum.
Definition Code.hpp:261
@ _B07_START
BDS B2b start index in the Enum.
Definition Code.hpp:265
@ _J05_START
QZSS L5 start index in the Enum.
Definition Code.hpp:274
@ _IRNSS_END
IRNSS end index in the Enum.
Definition Code.hpp:224
@ _S01_END
SBAS L end index in the Enum.
Definition Code.hpp:285
@ _J05_END
QZSS L5 end index in the Enum.
Definition Code.hpp:275
@ _J01_END
QZSS L1 end index in the Enum.
Definition Code.hpp:271
@ _E07_START
GAL E5b start index in the Enum.
Definition Code.hpp:241
@ _R03_END
GLO L3 end index in the Enum.
Definition Code.hpp:251
@ _R03_START
GLO L3 start index in the Enum.
Definition Code.hpp:250
@ _E01_END
GAL E1 end index in the Enum.
Definition Code.hpp:236
@ _B05_END
BDS B2a end index in the Enum.
Definition Code.hpp:262
@ _QZSS_END
QZSS end index in the Enum.
Definition Code.hpp:222
@ _E08_END
GAL E5(a+b) end index in the Enum.
Definition Code.hpp:244
@ _GLO_START
GLO start index in the Enum.
Definition Code.hpp:217
@ _G02_END
GPS L2 end index in the Enum.
Definition Code.hpp:231
@ _GPS_START
GPS start index in the Enum.
Definition Code.hpp:213
@ _IRNSS_START
IRNSS start index in the Enum.
Definition Code.hpp:223
@ _B01_START
BDS B1 start index in the Enum.
Definition Code.hpp:257
@ _J02_START
QZSS L2 start index in the Enum.
Definition Code.hpp:272
@ _B06_START
BDS B3 start index in the Enum.
Definition Code.hpp:263
@ _QZSS_START
QZSS start index in the Enum.
Definition Code.hpp:221
@ _S05_END
SBAS L end index in the Enum.
Definition Code.hpp:287
@ _R06_END
GLO G2a end index in the Enum.
Definition Code.hpp:255
@ _G05_END
GPS L5 end index in the Enum.
Definition Code.hpp:233
@ _BDS_END
BDS end index in the Enum.
Definition Code.hpp:220
@ _E07_END
GAL E5b end index in the Enum.
Definition Code.hpp:242
@ _E06_END
GAL E6 end index in the Enum.
Definition Code.hpp:240
@ _J01_START
QZSS L1 start index in the Enum.
Definition Code.hpp:270
@ _G02_START
GPS L2 start index in the Enum.
Definition Code.hpp:230
@ _S01_START
SBAS L start index in the Enum.
Definition Code.hpp:284
@ _SBAS_START
SBAS start index in the Enum.
Definition Code.hpp:225
@ _B02_START
BDS B1-2 start index in the Enum.
Definition Code.hpp:259
@ _I05_START
IRNSS L5 start index in the Enum.
Definition Code.hpp:279
@ _G01_START
GPS L1 start index in the Enum.
Definition Code.hpp:228
@ _BDS_START
BDS start index in the Enum.
Definition Code.hpp:219
@ _B01_END
BDS B1 end index in the Enum.
Definition Code.hpp:258
@ _R02_END
GLO L2 end index in the Enum.
Definition Code.hpp:249
@ _J06_START
QZSS L6 start index in the Enum.
Definition Code.hpp:276
@ _B08_START
BDS B2 (B2a+B2b) start index in the Enum.
Definition Code.hpp:267
@ _GLO_END
GLO end index in the Enum.
Definition Code.hpp:218
@ _G01_END
GPS L1 end index in the Enum.
Definition Code.hpp:229
@ _E05_END
GAL E5a end index in the Enum.
Definition Code.hpp:238
@ _R06_START
GLO G2a start index in the Enum.
Definition Code.hpp:254
@ _E08_START
GAL E5(a+b) start index in the Enum.
Definition Code.hpp:243
@ _SBAS_END
SBAS end index in the Enum.
Definition Code.hpp:226
@ _I09_START
IRNSS S start index in the Enum.
Definition Code.hpp:281
@ _R02_START
GLO L2 start index in the Enum.
Definition Code.hpp:248
@ _R01_END
GLO L1 end index in the Enum.
Definition Code.hpp:247
@ COUNT
Amount of Codes in the Enum.
Definition Code.hpp:289
@ _E05_START
GAL E5a start index in the Enum.
Definition Code.hpp:237
@ _I05_END
IRNSS L5 end index in the Enum.
Definition Code.hpp:280
@ _B07_END
BDS B2b end index in the Enum.
Definition Code.hpp:266
@ _B02_END
BDS B1-2 end index in the Enum.
Definition Code.hpp:260
@ _J02_END
QZSS L2 end index in the Enum.
Definition Code.hpp:273
static const char * GetCodeDescription(Code code)
Returns a short description for the code.
Definition Code.cpp:479
Frequency definition for different satellite systems.
Definition Frequency.hpp:59
void to_json(json &j, const Node &node)
Converts the provided node into a json object.
Definition Node.cpp:990
const Code Code_G5I_G5Q_G5X
L5 (data, pilot, combined)
Definition Code.hpp:626
const Code Code_I5B_I5C_I5X
RS (data, pilot, combined)
Definition Code.hpp:652
const Code Code_E8I_E8Q_E8X
E5 AltBOC (data, pilot, combined)
Definition Code.hpp:632
Frequency_
Enumerate for GNSS frequencies.
Definition Frequency.hpp:26
@ E07
Galileo E5b (1207.14 MHz).
Definition Frequency.hpp:34
@ R03
GLONASS, "G3" (1202.025 MHz).
Definition Frequency.hpp:38
@ J01
QZSS L1 (1575.42 MHz).
Definition Frequency.hpp:47
@ B02
Beidou B1-2 (B1I) (1561.098 MHz).
Definition Frequency.hpp:42
@ S01
SBAS L1 (1575.42 MHz).
Definition Frequency.hpp:53
@ E06
Galileo E6 (1278.75 MHz).
Definition Frequency.hpp:33
@ Freq_None
None.
Definition Frequency.hpp:27
@ I09
IRNSS S (2492.028 MHz).
Definition Frequency.hpp:52
@ B05
Beidou B2a (1176.45 MHz).
Definition Frequency.hpp:43
@ I05
IRNSS L5 (1176.45 MHz).
Definition Frequency.hpp:51
@ R02
GLONASS, "G2" (1246 MHz).
Definition Frequency.hpp:37
@ B08
Beidou B2 (B2a + B2b) (1191.795MHz).
Definition Frequency.hpp:46
@ R06
GLONASS, "G2a" (1248.06 MHz).
Definition Frequency.hpp:40
@ E01
Galileo, "E1" (1575.42 MHz).
Definition Frequency.hpp:31
@ B06
Beidou B3 (1268.52 MHz).
Definition Frequency.hpp:44
@ E05
Galileo E5a (1176.45 MHz).
Definition Frequency.hpp:32
@ S05
SBAS L5 (1176.45 MHz).
Definition Frequency.hpp:54
@ G02
GPS L2 (1227.6 MHz).
Definition Frequency.hpp:29
@ R01
GLONASS, "G1" (1602 MHZ).
Definition Frequency.hpp:36
@ G01
GPS L1 (1575.42 MHz).
Definition Frequency.hpp:28
@ B01
Beidou B1 (1575.42 MHz).
Definition Frequency.hpp:41
@ J05
QZSS L5 (1176.45 MHz).
Definition Frequency.hpp:49
@ J02
QZSS L2 (1227.6 MHz).
Definition Frequency.hpp:48
@ B07
Beidou B2b (B2I) (1207.14 MHz).
Definition Frequency.hpp:45
@ R04
GLONASS, "G1a" (1600.995 MHZ).
Definition Frequency.hpp:39
@ E08
Galileo E5 (E5a + E5b) (1191.795MHz).
Definition Frequency.hpp:35
@ J06
QZSS L6 / LEX (1278.75 MHz).
Definition Frequency.hpp:50
@ G05
GPS L5 (1176.45 MHz).
Definition Frequency.hpp:30
const Code Code_J1S_J1L_J1X
L1C (data, pilot, combined)
Definition Code.hpp:646
const Code Code_B8D_B8P_B8X
B2 (B2a+B2b) (data, pilot, combined)
Definition Code.hpp:644
bool ShowCodeSelector(const char *label, Code &code, const Frequency &filterFreq, bool singleSelect)
Shows a ComboBox to select signal codes.
Definition Code.cpp:1310
const Code Code_B7I_B7Q_B7X
B2I(OS), B2Q, combined.
Definition Code.hpp:642
const Code Code_B1D_B1P_B1X
B1 (data, pilot, combined)
Definition Code.hpp:638
const Code Code_B5D_B5P_B5X
B2a (data, pilot, combined)
Definition Code.hpp:640
const Code Code_E7I_E7Q_E7X
E5b (data, pilot, combined)
Definition Code.hpp:631
Code operator&(const Code &lhs, const Code &rhs)
Definition Code.cpp:808
const Code Code_B2I_B2Q_B2X
B1I(OS), B1Q, combined.
Definition Code.hpp:639
bool operator<(const Code &lhs, const Code &rhs)
Definition Code.cpp:878
void from_json(const json &j, Node &node)
Converts the provided json object into a node object.
Definition Node.cpp:1007
const Code Code_E1B_E1C_E1X
OS (data, pilot, combined)
Definition Code.hpp:628
constexpr bool operator!=(const Node::Kind &lhs, const Node::Kind &rhs)
Inequal compares Node::Kind values.
Definition Node.hpp:506
const Code Code_J5I_J5Q_J5X
L5 (data, pilot, combined)
Definition Code.hpp:648
const Code Code_R3I_R3Q_R3X
L3 (data, pilot, combined)
Definition Code.hpp:634
const Code Code_B7D_B7P_B7Z
B2b (data, pilot, combined)
Definition Code.hpp:643
const Code Code_R4A_R4B_R4X
G1a (data, pilot, combined)
Definition Code.hpp:635
constexpr bool operator==(const Node::Kind &lhs, const Node::Kind &rhs)
Equal compares Node::Kind values.
Definition Node.hpp:501
const Code Code_E5I_E5Q_E5X
E5a (data, pilot, combined)
Definition Code.hpp:629
const Code Code_J6S_J6L_J6X
LEX signal (short, long, combined)
Definition Code.hpp:650
const Code Code_S5I_S5Q_S5X
L5 (data, pilot, combined)
Definition Code.hpp:655
const Code Code_I9B_I9C_I9X
RS (data, pilot, combined)
Definition Code.hpp:653
const Code Code_E6B_E6C_E6X
E6 (data, pilot, combined)
Definition Code.hpp:630
const Code Code_B6I_B6Q_B6X
B3I, B3Q, combined.
Definition Code.hpp:641
Code operator|(const Code &lhs, const Code &rhs)
Definition Code.cpp:784
const Code Code_J5D_J5P_J5Z
L5 (data, pilot, combined)
Definition Code.hpp:649
SatelliteSystem_
Satellite System enumeration.
@ GPS
Global Positioning System.
@ QZSS
Quasi-Zenith Satellite System.
@ GLO
Globalnaja nawigazionnaja sputnikowaja sistema (GLONASS)
@ GAL
Galileo.
@ SBAS
Satellite Based Augmentation System.
@ BDS
Beidou.
@ SatSys_None
No Satellite system.
@ IRNSS
Indian Regional Navigation Satellite System.
const Code Code_R6A_R6B_R6X
G2a (data, pilot, combined)
Definition Code.hpp:636
const Code Code_G2S_G2L_G2X
L2C-code (medium, long, combined)
Definition Code.hpp:625
const Code Code_J2S_J2L_J2X
L2C-code (medium, long, combined)
Definition Code.hpp:647
const Code Code_G1S_G1L_G1X
L1C (data, pilot, combined)
Definition Code.hpp:624
Satellite System type.