source: ntrip/trunk/BNC/src/RTCM3/RTCM3coDecoder.cpp@ 6850

Last change on this file since 6850 was 6850, checked in by stuerze, 9 years ago

extension of the rtnetuploadcaster interface regarding RTCM SSR II messages (phase biases) for GPS; GLONASS, Galileo, QZSS, SBAS and BDS

File size: 20.3 KB
Line 
1// Part of BNC, a utility for retrieving decoding and
2// converting GNSS data streams from NTRIP broadcasters.
3//
4// Copyright (C) 2007
5// German Federal Agency for Cartography and Geodesy (BKG)
6// http://www.bkg.bund.de
7// Czech Technical University Prague, Department of Geodesy
8// http://www.fsv.cvut.cz
9//
10// Email: euref-ip@bkg.bund.de
11//
12// This program is free software; you can redistribute it and/or
13// modify it under the terms of the GNU General Public License
14// as published by the Free Software Foundation, version 2.
15//
16// This program is distributed in the hope that it will be useful,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19// GNU General Public License for more details.
20//
21// You should have received a copy of the GNU General Public License
22// along with this program; if not, write to the Free Software
23// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
25/* -------------------------------------------------------------------------
26 * BKG NTRIP Client
27 * -------------------------------------------------------------------------
28 *
29 * Class: RTCM3coDecoder
30 *
31 * Purpose: RTCM3 Clock Orbit Decoder
32 *
33 * Author: L. Mervart
34 *
35 * Created: 05-May-2008
36 *
37 * Changes:
38 *
39 * -----------------------------------------------------------------------*/
40
41#include <stdio.h>
42#include <math.h>
43
44#include "RTCM3coDecoder.h"
45#include "bncutils.h"
46#include "bncrinex.h"
47#include "bnccore.h"
48#include "bncsettings.h"
49#include "bnctime.h"
50
51using namespace std;
52
53// Constructor
54////////////////////////////////////////////////////////////////////////////
55RTCM3coDecoder::RTCM3coDecoder(const QString& staID) {
56
57 _staID = staID;
58
59 // File Output
60 // -----------
61 bncSettings settings;
62 QString path = settings.value("corrPath").toString();
63 if (!path.isEmpty()) {
64 expandEnvVar(path);
65 if ( path.length() > 0 && path[path.length()-1] != QDir::separator() ) {
66 path += QDir::separator();
67 }
68 _fileNameSkl = path + staID;
69 }
70 _out = 0;
71
72 connect(this, SIGNAL(newOrbCorrections(QList<t_orbCorr>)),
73 BNC_CORE, SLOT(slotNewOrbCorrections(QList<t_orbCorr>)));
74
75 connect(this, SIGNAL(newClkCorrections(QList<t_clkCorr>)),
76 BNC_CORE, SLOT(slotNewClkCorrections(QList<t_clkCorr>)));
77
78 connect(this, SIGNAL(newCodeBiases(QList<t_satCodeBias>)),
79 BNC_CORE, SLOT(slotNewCodeBiases(QList<t_satCodeBias>)));
80
81 connect(this, SIGNAL(newPhaseBiases(QList<t_satPhaseBias>)),
82 BNC_CORE, SLOT(slotNewPhaseBiases(QList<t_satPhaseBias>)));
83
84 connect(this, SIGNAL(newTec(t_vTec)),
85 BNC_CORE, SLOT(slotNewTec(t_vTec)));
86
87 connect(this, SIGNAL(providerIDChanged(QString)),
88 BNC_CORE, SIGNAL(providerIDChanged(QString)));
89
90 connect(this, SIGNAL(newMessage(QByteArray,bool)),
91 BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
92
93 reset();
94
95 _providerID[0] = -1;
96 _providerID[1] = -1;
97 _providerID[2] = -1;
98}
99
100// Destructor
101////////////////////////////////////////////////////////////////////////////
102RTCM3coDecoder::~RTCM3coDecoder() {
103 delete _out;
104}
105
106//
107////////////////////////////////////////////////////////////////////////////
108void RTCM3coDecoder::reset() {
109 memset(&_clkOrb, 0, sizeof(_clkOrb));
110 memset(&_codeBias, 0, sizeof(_codeBias));
111 memset(&_phaseBias, 0, sizeof(_phaseBias));
112 memset(&_vTEC, 0, sizeof(_vTEC));
113}
114
115// Reopen Output File
116////////////////////////////////////////////////////////////////////////
117void RTCM3coDecoder::reopen() {
118
119 if (!_fileNameSkl.isEmpty()) {
120
121 bncSettings settings;
122
123 QDateTime datTim = currentDateAndTimeGPS();
124
125 QString hlpStr = bncRinex::nextEpochStr(datTim,
126 settings.value("corrIntr").toString());
127
128 QString fileNameHlp = _fileNameSkl
129 + QString("%1").arg(datTim.date().dayOfYear(), 3, 10, QChar('0'))
130 + hlpStr + datTim.toString(".yyC");
131
132 if (_fileName == fileNameHlp) {
133 return;
134 }
135 else {
136 _fileName = fileNameHlp;
137 }
138
139 delete _out;
140 if ( Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked) {
141 _out = new ofstream( _fileName.toAscii().data(), ios_base::out | ios_base::app );
142 }
143 else {
144 _out = new ofstream( _fileName.toAscii().data() );
145 }
146 }
147}
148
149//
150////////////////////////////////////////////////////////////////////////////
151t_irc RTCM3coDecoder::Decode(char* buffer, int bufLen, vector<string>& errmsg) {
152
153 errmsg.clear();
154
155 _buffer.append(QByteArray(buffer,bufLen));
156
157 t_irc retCode = failure;
158
159 while(_buffer.size()) {
160
161 struct ClockOrbit clkOrbSav;
162 struct CodeBias codeBiasSav;
163 struct PhaseBias phaseBiasSav;
164 struct VTEC vTECSav;
165 memcpy(&clkOrbSav, &_clkOrb, sizeof(clkOrbSav)); // save state
166 memcpy(&codeBiasSav, &_codeBias, sizeof(codeBiasSav));
167 memcpy(&phaseBiasSav, &_phaseBias, sizeof(phaseBiasSav));
168 memcpy(&vTECSav, &_vTEC, sizeof(vTECSav));
169
170 int bytesused = 0;
171 GCOB_RETURN irc = GetSSR(&_clkOrb, &_codeBias, &_vTEC, &_phaseBias,
172 _buffer.data(), _buffer.size(), &bytesused);
173
174 if (irc <= -30) { // not enough data - restore state and exit loop
175 memcpy(&_clkOrb, &clkOrbSav, sizeof(clkOrbSav));
176 memcpy(&_codeBias, &codeBiasSav, sizeof(codeBiasSav));
177 memcpy(&_phaseBias, &phaseBiasSav, sizeof(phaseBiasSav));
178 memcpy(&_vTEC, &vTECSav, sizeof(vTECSav));
179 break;
180 }
181
182 else if (irc < 0) { // error - skip 1 byte and retry
183 reset();
184 _buffer = _buffer.mid(bytesused ? bytesused : 1);
185 }
186
187 else { // OK or MESSAGEFOLLOWS
188 _buffer = _buffer.mid(bytesused);
189
190 if (irc == GCOBR_OK || irc == GCOBR_MESSAGEFOLLOWS ) {
191
192 setEpochTime(); // sets _lastTime
193
194 if (_lastTime.valid()) {
195 reopen();
196 checkProviderID();
197 sendResults();
198 retCode = success;
199 }
200 else {
201 retCode = failure;
202 }
203
204 reset();
205 }
206 }
207 }
208
209 return retCode;
210}
211
212//
213////////////////////////////////////////////////////////////////////////////
214void RTCM3coDecoder::sendResults() {
215
216 // Orbit and clock corrections of all satellites
217 // ---------------------------------------------
218 for (unsigned ii = 0; ii < CLOCKORBIT_NUMGPS + _clkOrb.NumberOfSat[CLOCKORBIT_SATGLONASS]; ii++) {
219 char sysCh = ' ';
220 if (ii < _clkOrb.NumberOfSat[CLOCKORBIT_SATGPS]) {
221 sysCh = 'G';
222 }
223 else if (ii >= CLOCKORBIT_NUMGPS) {
224 sysCh = 'R';
225 }
226 else {
227 continue;
228 }
229
230 // Orbit correction
231 // ----------------
232 if ( _clkOrb.messageType == COTYPE_GPSCOMBINED ||
233 _clkOrb.messageType == COTYPE_GLONASSCOMBINED ||
234 _clkOrb.messageType == COTYPE_GPSORBIT ||
235 _clkOrb.messageType == COTYPE_GLONASSORBIT ) {
236
237 t_orbCorr orbCorr;
238 orbCorr._prn.set(sysCh, _clkOrb.Sat[ii].ID);
239 orbCorr._staID = _staID.toStdString();
240 orbCorr._iod = _clkOrb.Sat[ii].IOD;
241 orbCorr._time = _lastTime;
242 orbCorr._updateInt = _clkOrb.UpdateInterval;
243 orbCorr._system = 'R';
244 orbCorr._xr[0] = _clkOrb.Sat[ii].Orbit.DeltaRadial;
245 orbCorr._xr[1] = _clkOrb.Sat[ii].Orbit.DeltaAlongTrack;
246 orbCorr._xr[2] = _clkOrb.Sat[ii].Orbit.DeltaCrossTrack;
247 orbCorr._dotXr[0] = _clkOrb.Sat[ii].Orbit.DotDeltaRadial;
248 orbCorr._dotXr[1] = _clkOrb.Sat[ii].Orbit.DotDeltaAlongTrack;
249 orbCorr._dotXr[2] = _clkOrb.Sat[ii].Orbit.DotDeltaCrossTrack;
250
251 _orbCorrections[_lastTime].push_back(orbCorr);
252
253 _IODs[orbCorr._prn] = _clkOrb.Sat[ii].IOD;
254 }
255
256 // Clock Corrections
257 // -----------------
258 if ( _clkOrb.messageType == COTYPE_GPSCOMBINED ||
259 _clkOrb.messageType == COTYPE_GLONASSCOMBINED ||
260 _clkOrb.messageType == COTYPE_GPSCLOCK ||
261 _clkOrb.messageType == COTYPE_GLONASSCLOCK ) {
262
263 t_clkCorr clkCorr;
264 clkCorr._prn.set(sysCh, _clkOrb.Sat[ii].ID);
265 clkCorr._staID = _staID.toStdString();
266 clkCorr._time = _lastTime;
267 clkCorr._updateInt = _clkOrb.UpdateInterval;
268 clkCorr._dClk = _clkOrb.Sat[ii].Clock.DeltaA0 / t_CST::c;
269 clkCorr._dotDClk = _clkOrb.Sat[ii].Clock.DeltaA1 / t_CST::c;
270 clkCorr._dotDotDClk = _clkOrb.Sat[ii].Clock.DeltaA2 / t_CST::c;
271
272 _lastClkCorrections[clkCorr._prn] = clkCorr;
273
274 if (_IODs.contains(clkCorr._prn)) {
275 clkCorr._iod = _IODs[clkCorr._prn];
276 _clkCorrections[_lastTime].push_back(clkCorr);
277 }
278 }
279
280 // High-Resolution Clocks
281 // ----------------------
282 if ( _clkOrb.messageType == COTYPE_GPSHR ||
283 _clkOrb.messageType == COTYPE_GLONASSHR ) {
284
285 t_prn prn(sysCh, _clkOrb.Sat[ii].ID);
286 if (_lastClkCorrections.contains(prn)) {
287 t_clkCorr clkCorr;
288 clkCorr = _lastClkCorrections[prn];
289 clkCorr._time = _lastTime;
290 clkCorr._updateInt = _clkOrb.UpdateInterval;
291 clkCorr._dClk += _clkOrb.Sat[ii].hrclock / t_CST::c;
292 if (_IODs.contains(clkCorr._prn)) {
293 clkCorr._iod = _IODs[clkCorr._prn];
294 _clkCorrections[_lastTime].push_back(clkCorr);
295 }
296 }
297 }
298 }
299
300 // Code Biases
301 // -----------
302 for (unsigned ii = 0; ii < CLOCKORBIT_NUMGPS + _codeBias.NumberOfSat[CLOCKORBIT_SATGLONASS]; ii++) {
303 char sysCh = ' ';
304 if (ii < _codeBias.NumberOfSat[CLOCKORBIT_SATGPS]) {
305 sysCh = 'G';
306 }
307 else if (ii >= CLOCKORBIT_NUMGPS) {
308 sysCh = 'R';
309 }
310 else {
311 continue;
312 }
313 t_satCodeBias satCodeBias;
314 satCodeBias._prn.set(sysCh, _codeBias.Sat[ii].ID);
315 satCodeBias._staID = _staID.toStdString();
316 satCodeBias._time = _lastTime;
317 satCodeBias._updateInt = _codeBias.UpdateInterval;
318 for (unsigned jj = 0; jj < _codeBias.Sat[ii].NumberOfCodeBiases; jj++) {
319 const CodeBias::BiasSat::CodeBiasEntry& biasEntry = _codeBias.Sat[ii].Biases[jj];
320 t_frqCodeBias frqCodeBias;
321 frqCodeBias._rnxType2ch = codeTypeToRnxType(sysCh, biasEntry.Type);
322 frqCodeBias._value = biasEntry.Bias;
323 if (!frqCodeBias._rnxType2ch.empty()) {
324 satCodeBias._bias.push_back(frqCodeBias);
325 }
326 }
327 _codeBiases[_lastTime].push_back(satCodeBias);
328 }
329
330 // Phase Biases
331 // -----------
332 for (unsigned ii = 0; ii < CLOCKORBIT_NUMGPS + _phaseBias.NumberOfSat[CLOCKORBIT_SATGLONASS]; ii++) {
333 char sysCh = ' ';
334 if (ii < _phaseBias.NumberOfSat[CLOCKORBIT_SATGPS]) {
335 sysCh = 'G';
336 }
337 else if (ii >= CLOCKORBIT_NUMGPS) {
338 sysCh = 'R';
339 }
340 else {
341 continue;
342 }
343 t_satPhaseBias satPhaseBias;
344 satPhaseBias._prn.set(sysCh, _phaseBias.Sat[ii].ID);
345 satPhaseBias._staID = _staID.toStdString();
346 satPhaseBias._time = _lastTime;
347 satPhaseBias._updateInt = _phaseBias.UpdateInterval;
348 satPhaseBias._dispersiveBiasConsitencyIndicator
349 = _phaseBias.DispersiveBiasConsistencyIndicator;
350 satPhaseBias._MWConsistencyIndicator
351 = _phaseBias.MWConsistencyIndicator;
352 satPhaseBias._yawDeg = _phaseBias.Sat[ii].YawAngle * 180.0 / M_PI;
353 satPhaseBias._yawDegRate = _phaseBias.Sat[ii].YawRate * 180.0 / M_PI;
354 for (unsigned jj = 0; jj < _phaseBias.Sat[ii].NumberOfPhaseBiases; jj++) {
355 const PhaseBias::PhaseBiasSat::PhaseBiasEntry& biasEntry = _phaseBias.Sat[ii].Biases[jj];
356 t_frqPhaseBias frqPhaseBias;
357 frqPhaseBias._rnxType2ch = codeTypeToRnxType(sysCh, biasEntry.Type);
358 frqPhaseBias._value = biasEntry.Bias;
359 frqPhaseBias._fixIndicator = biasEntry.SignalIntegerIndicator;
360 frqPhaseBias._fixWideLaneIndicator = biasEntry.SignalsWideLaneIntegerIndicator;
361 frqPhaseBias._jumpCounter = biasEntry.SignalDiscontinuityCounter;
362 if (!frqPhaseBias._rnxType2ch.empty()) {
363 satPhaseBias._bias.push_back(frqPhaseBias);
364 }
365 }
366 _phaseBiases[_lastTime].push_back(satPhaseBias);
367 }
368
369 // Ionospheric Model
370 // -----------------
371 if (_vTEC.NumLayers > 0) {
372 _vTecMap[_lastTime]._time = _lastTime;
373 _vTecMap[_lastTime]._updateInt = _vTEC.UpdateInterval;
374 _vTecMap[_lastTime]._staID = _staID.toStdString();
375 for (unsigned ii = 0; ii < _vTEC.NumLayers; ii++) {
376 const VTEC::IonoLayers& ionoLayer = _vTEC.Layers[ii];
377 t_vTecLayer layer;
378 layer._height = ionoLayer.Height;
379 layer._C.ReSize(ionoLayer.Degree, ionoLayer.Order);
380 layer._S.ReSize(ionoLayer.Degree, ionoLayer.Order);
381 for (unsigned iDeg = 0; iDeg < ionoLayer.Degree; iDeg++) {
382 for (unsigned iOrd = 0; iOrd < ionoLayer.Order; iOrd++) {
383 layer._C[iDeg][iOrd] = ionoLayer.Cosinus[iDeg][iOrd];
384 layer._S[iDeg][iOrd] = ionoLayer.Sinus[iDeg][iOrd];
385 }
386 }
387 _vTecMap[_lastTime]._layers.push_back(layer);
388 }
389 }
390
391 // Dump all older epochs
392 // ---------------------
393 QMutableMapIterator<bncTime, QList<t_orbCorr> > itOrb(_orbCorrections);
394 while (itOrb.hasNext()) {
395 itOrb.next();
396 if (itOrb.key() < _lastTime) {
397 emit newOrbCorrections(itOrb.value());
398 t_orbCorr::writeEpoch(_out, itOrb.value());
399 itOrb.remove();
400 }
401 }
402 QMutableMapIterator<bncTime, QList<t_clkCorr> > itClk(_clkCorrections);
403 while (itClk.hasNext()) {
404 itClk.next();
405 if (itClk.key() < _lastTime) {
406 emit newClkCorrections(itClk.value());
407 t_clkCorr::writeEpoch(_out, itClk.value());
408 itClk.remove();
409 }
410 }
411 QMutableMapIterator<bncTime, QList<t_satCodeBias> > itCB(_codeBiases);
412 while (itCB.hasNext()) {
413 itCB.next();
414 if (itCB.key() < _lastTime) {
415 emit newCodeBiases(itCB.value());
416 t_satCodeBias::writeEpoch(_out, itCB.value());
417 itCB.remove();
418 }
419 }
420 QMutableMapIterator<bncTime, QList<t_satPhaseBias> > itPB(_phaseBiases);
421 while (itPB.hasNext()) {
422 itPB.next();
423 if (itPB.key() < _lastTime) {
424 emit newPhaseBiases(itPB.value());
425 t_satPhaseBias::writeEpoch(_out, itPB.value());
426 itPB.remove();
427 }
428 }
429 QMutableMapIterator<bncTime, t_vTec> itTec(_vTecMap);
430 while (itTec.hasNext()) {
431 itTec.next();
432 if (itTec.key() < _lastTime) {
433 emit newTec(itTec.value());
434 t_vTec::write(_out, itTec.value());
435 itTec.remove();
436 }
437 }
438}
439
440//
441////////////////////////////////////////////////////////////////////////////
442void RTCM3coDecoder::checkProviderID() {
443
444 if (_clkOrb.SSRProviderID == 0 && _clkOrb.SSRSolutionID == 0 && _clkOrb.SSRIOD == 0) {
445 return;
446 }
447
448 int newProviderID[3];
449 newProviderID[0] = _clkOrb.SSRProviderID;
450 newProviderID[1] = _clkOrb.SSRSolutionID;
451 newProviderID[2] = _clkOrb.SSRIOD;
452
453 bool alreadySet = false;
454 bool different = false;
455
456 for (unsigned ii = 0; ii < 3; ii++) {
457 if (_providerID[ii] != -1) {
458 alreadySet = true;
459 }
460 if (_providerID[ii] != newProviderID[ii]) {
461 different = true;
462 }
463 _providerID[ii] = newProviderID[ii];
464 }
465
466 if (alreadySet && different) {
467 emit newMessage("RTCM3coDecoder: Provider Changed " + _staID.toAscii() + "\n", true);
468 emit providerIDChanged(_staID);
469 }
470}
471
472//
473////////////////////////////////////////////////////////////////////////////
474void RTCM3coDecoder::setEpochTime() {
475
476 _lastTime.reset();
477
478 double epoSecGPS = -1.0;
479 double epoSecGlo = -1.0;
480 if (_clkOrb.NumberOfSat[CLOCKORBIT_SATGPS] > 0) {
481 epoSecGPS = _clkOrb.EpochTime[CLOCKORBIT_SATGPS]; // 0 .. 604799 s
482 }
483 else if (_codeBias.NumberOfSat[CLOCKORBIT_SATGPS] > 0) {
484 epoSecGPS = _codeBias.EpochTime[CLOCKORBIT_SATGPS]; // 0 .. 604799 s
485 }
486 else if (_phaseBias.NumberOfSat[CLOCKORBIT_SATGPS] > 0) {
487 epoSecGPS = _phaseBias.EpochTime[CLOCKORBIT_SATGPS]; // 0 .. 604799 s
488 }
489 else if (_vTEC.NumLayers > 0) {
490 epoSecGPS = _vTEC.EpochTime; // 0 .. 604799 s
491 }
492 else if (_clkOrb.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0) {
493 epoSecGlo = _clkOrb.EpochTime[CLOCKORBIT_SATGLONASS]; // 0 .. 86399 s
494 }
495 else if (_codeBias.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0) {
496 epoSecGlo = _codeBias.EpochTime[CLOCKORBIT_SATGLONASS]; // 0 .. 86399 s
497 }
498 else if (_phaseBias.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0) {
499 epoSecGlo = _phaseBias.EpochTime[CLOCKORBIT_SATGLONASS]; // 0 .. 86399 s
500 }
501
502 // Retrieve current time
503 // ---------------------
504 int currentWeek = 0;
505 double currentSec = 0.0;
506 currentGPSWeeks(currentWeek, currentSec);
507 bncTime currentTime(currentWeek, currentSec);
508
509 // Set _lastTime close to currentTime
510 // ----------------------------------
511 if (epoSecGPS != -1) {
512 _lastTime.set(currentWeek, epoSecGPS);
513 }
514 else if (epoSecGlo != -1) {
515 QDate date = dateAndTimeFromGPSweek(currentTime.gpsw(), currentTime.gpssec()).date();
516 epoSecGlo = epoSecGlo - 3 * 3600 + gnumleap(date.year(), date.month(), date.day());
517 _lastTime.set(currentWeek, epoSecGlo);
518 }
519
520 if (_lastTime.valid()) {
521 double maxDiff = 12 * 3600.0;
522 while (_lastTime < currentTime - maxDiff) {
523 _lastTime = _lastTime + maxDiff;
524 }
525 while (_lastTime > currentTime + maxDiff) {
526 _lastTime = _lastTime - maxDiff;
527 }
528 }
529}
530
531//
532////////////////////////////////////////////////////////////////////////////
533string RTCM3coDecoder::codeTypeToRnxType(char system, CodeType type) const {
534 if (system == 'G') {
535 switch (type) {
536 case CODETYPEGPS_L1_CA: return "1C";
537 case CODETYPEGPS_L1_P: return "1P";
538 case CODETYPEGPS_L1_Z: return "1W";
539 case CODETYPEGPS_L2_CA: return "2C";
540 case CODETYPEGPS_SEMI_CODELESS: return "?N"; // which carrier ?
541 case CODETYPEGPS_L2_CM: return "2S";
542 case CODETYPEGPS_L2_CL: return "2L";
543 case CODETYPEGPS_L2_CML: return "2X";
544 case CODETYPEGPS_L2_P: return "2P";
545 case CODETYPEGPS_L2_Z: return "2W";
546 case CODETYPEGPS_L5_I: return "5I";
547 case CODETYPEGPS_L5_Q: return "5Q";
548 default: return "";
549 }
550 }
551 else if (system == 'R') {
552 switch (type) {
553 case CODETYPEGLONASS_L1_CA: return "1C";
554 case CODETYPEGLONASS_L1_P: return "1P";
555 case CODETYPEGLONASS_L2_CA: return "2C";
556 case CODETYPEGLONASS_L2_P: return "2P";
557 default: return "";
558 }
559 }
560 else if (system == 'E') {
561 switch (type) {
562 case CODETYPEGALILEO_E1_A: return "1A";
563 case CODETYPEGALILEO_E1_B: return "1B";
564 case CODETYPEGALILEO_E1_C: return "1C";
565 case CODETYPEGALILEO_E5A_I: return "5I";
566 case CODETYPEGALILEO_E5A_Q: return "5Q";
567 case CODETYPEGALILEO_E5B_I: return "7I";
568 case CODETYPEGALILEO_E5B_Q: return "7Q";
569 case CODETYPEGALILEO_E5_I: return "8I";
570 case CODETYPEGALILEO_E5_Q: return "8Q";
571 case CODETYPEGALILEO_E6_A: return "6A";
572 case CODETYPEGALILEO_E6_B: return "6B";
573 case CODETYPEGALILEO_E6_C: return "6C";
574 default: return "";
575 }
576 }
577 else if (system == 'J') {
578 switch (type) {
579 case CODETYPEQZSS_L1_CA: return "1C";
580 case CODETYPEQZSS_L1C_D: return "1S";
581 case CODETYPEQZSS_L1C_P: return "1L";
582 case CODETYPEQZSS_L1C_DP: return "1X";
583 case CODETYPEQZSS_L2_CM: return "2S";
584 case CODETYPEQZSS_L2_CL: return "2L";
585 case CODETYPEQZSS_L2_CML: return "2X";
586 case CODETYPEQZSS_L5_I: return "5I";
587 case CODETYPEQZSS_L5_Q: return "5Q";
588 case CODETYPEQZSS_L5_IQ: return "5X";
589 case CODETYPEQZSS_LEX_S: return "6S";
590 case CODETYPEQZSS_LEX_L: return "6L";
591 case CODETYPEQZSS_LEX_SL: return "6X";
592 default: return "";
593 }
594 }
595 else if (system == 'S') {
596 switch (type) {
597 case CODETYPE_SBAS_L1_CA: return "1C";
598 case CODETYPE_SBAS_L5_I: return "5I";
599 case CODETYPE_SBAS_L5_Q: return "5Q";
600 case CODETYPE_SBAS_L5_IQ: return "5X";
601 default: return "";
602 }
603 }
604 else if (system == 'C') {
605 switch (type) {
606 case CODETYPE_BDS_B1_I: return "1I";
607 case CODETYPE_BDS_B1_Q: return "1Q";
608 case CODETYPE_BDS_B1_IQ: return "1X";
609 case CODETYPE_BDS_B2_I: return "7I";
610 case CODETYPE_BDS_B2_Q: return "7Q";
611 case CODETYPE_BDS_B2_IQ: return "7X";
612 case CODETYPE_BDS_B3_I: return "6I";
613 case CODETYPE_BDS_B3_Q: return "6Q";
614 case CODETYPE_BDS_B3_IQ: return "6X";
615 default: return "";
616 }
617 }
618 return "";
619};
Note: See TracBrowser for help on using the repository browser.