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