source: ntrip/trunk/BNC/bncgetthread.cpp@ 3530

Last change on this file since 3530 was 3530, checked in by mervart, 12 years ago
File size: 21.7 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: bncGetThread
30 *
31 * Purpose: Thread that retrieves data from NTRIP caster
32 *
33 * Author: L. Mervart
34 *
35 * Created: 24-Dec-2005
36 *
37 * Changes:
38 *
39 * -----------------------------------------------------------------------*/
40
41#include <stdlib.h>
42#include <iomanip>
43#include <sstream>
44
45#include <QFile>
46#include <QTextStream>
47#include <QtNetwork>
48#include <QTime>
49
50#include "bncgetthread.h"
51#include "bnctabledlg.h"
52#include "bncapp.h"
53#include "bncutils.h"
54#include "bnczerodecoder.h"
55#include "bncnetqueryv0.h"
56#include "bncnetqueryv1.h"
57#include "bncnetqueryv2.h"
58#include "bncnetqueryrtp.h"
59#include "bncnetqueryudp.h"
60#include "bncnetqueryudp0.h"
61#include "bncnetquerys.h"
62#include "bncsettings.h"
63#include "latencychecker.h"
64#include "bncpppclient.h"
65#include "upload/bncrtnetdecoder.h"
66#include "RTCM/RTCM2Decoder.h"
67#include "RTCM3/RTCM3Decoder.h"
68#include "GPSS/gpssDecoder.h"
69#include "GPSS/hassDecoder.h"
70#include "serial/qextserialport.h"
71
72using namespace std;
73
74// Constructor 1
75////////////////////////////////////////////////////////////////////////////
76bncGetThread::bncGetThread(bncRawFile* rawFile) {
77
78 _rawFile = rawFile;
79 _format = rawFile->format();
80 _staID = rawFile->staID();
81 _rawOutput = false;
82 _ntripVersion = "N";
83
84 initialize();
85}
86
87// Constructor 2
88////////////////////////////////////////////////////////////////////////////
89bncGetThread::bncGetThread(const QUrl& mountPoint,
90 const QByteArray& format,
91 const QByteArray& latitude,
92 const QByteArray& longitude,
93 const QByteArray& nmea,
94 const QByteArray& ntripVersion) {
95 _rawFile = 0;
96 _mountPoint = mountPoint;
97 _staID = mountPoint.path().mid(1).toAscii();
98 _format = format;
99 _latitude = latitude;
100 _longitude = longitude;
101 _nmea = nmea;
102 _ntripVersion = ntripVersion;
103
104 bncSettings settings;
105 if (!settings.value("rawOutFile").toString().isEmpty()) {
106 _rawOutput = true;
107 }
108
109 initialize();
110 initDecoder();
111}
112
113// Initialization (common part of the constructor)
114////////////////////////////////////////////////////////////////////////////
115void bncGetThread::initialize() {
116
117 bncSettings settings;
118
119 setTerminationEnabled(true);
120
121 bncApp* app = (bncApp*) qApp;
122
123 connect(this, SIGNAL(newMessage(QByteArray,bool)),
124 app, SLOT(slotMessage(const QByteArray,bool)));
125
126 _isToBeDeleted = false;
127 _query = 0;
128 _nextSleep = 0;
129 _PPPclient = 0;
130 _miscMount = settings.value("miscMount").toString();
131
132 // Serial Port
133 // -----------
134 _serialNMEA = NO_NMEA;
135 _serialOutFile = 0;
136 _serialPort = 0;
137
138 if (settings.value("serialMountPoint").toString() == _staID) {
139 _serialPort = new QextSerialPort(settings.value("serialPortName").toString() );
140 _serialPort->setTimeout(0,100);
141
142 // Baud Rate
143 // ---------
144 QString hlp = settings.value("serialBaudRate").toString();
145 if (hlp == "110") {
146 _serialPort->setBaudRate(BAUD110);
147 }
148 else if (hlp == "300") {
149 _serialPort->setBaudRate(BAUD300);
150 }
151 else if (hlp == "600") {
152 _serialPort->setBaudRate(BAUD600);
153 }
154 else if (hlp == "1200") {
155 _serialPort->setBaudRate(BAUD1200);
156 }
157 else if (hlp == "2400") {
158 _serialPort->setBaudRate(BAUD2400);
159 }
160 else if (hlp == "4800") {
161 _serialPort->setBaudRate(BAUD4800);
162 }
163 else if (hlp == "9600") {
164 _serialPort->setBaudRate(BAUD9600);
165 }
166 else if (hlp == "19200") {
167 _serialPort->setBaudRate(BAUD19200);
168 }
169 else if (hlp == "38400") {
170 _serialPort->setBaudRate(BAUD38400);
171 }
172 else if (hlp == "57600") {
173 _serialPort->setBaudRate(BAUD57600);
174 }
175 else if (hlp == "115200") {
176 _serialPort->setBaudRate(BAUD115200);
177 }
178
179 // Parity
180 // ------
181 hlp = settings.value("serialParity").toString();
182 if (hlp == "NONE") {
183 _serialPort->setParity(PAR_NONE);
184 }
185 else if (hlp == "ODD") {
186 _serialPort->setParity(PAR_ODD);
187 }
188 else if (hlp == "EVEN") {
189 _serialPort->setParity(PAR_EVEN);
190 }
191 else if (hlp == "SPACE") {
192 _serialPort->setParity(PAR_SPACE);
193 }
194
195 // Data Bits
196 // ---------
197 hlp = settings.value("serialDataBits").toString();
198 if (hlp == "5") {
199 _serialPort->setDataBits(DATA_5);
200 }
201 else if (hlp == "6") {
202 _serialPort->setDataBits(DATA_6);
203 }
204 else if (hlp == "7") {
205 _serialPort->setDataBits(DATA_7);
206 }
207 else if (hlp == "8") {
208 _serialPort->setDataBits(DATA_8);
209 }
210 hlp = settings.value("serialStopBits").toString();
211 if (hlp == "1") {
212 _serialPort->setStopBits(STOP_1);
213 }
214 else if (hlp == "2") {
215 _serialPort->setStopBits(STOP_2);
216 }
217
218 // Flow Control
219 // ------------
220 hlp = settings.value("serialFlowControl").toString();
221 if (hlp == "XONXOFF") {
222 _serialPort->setFlowControl(FLOW_XONXOFF);
223 }
224 else if (hlp == "HARDWARE") {
225 _serialPort->setFlowControl(FLOW_HARDWARE);
226 }
227 else {
228 _serialPort->setFlowControl(FLOW_OFF);
229 }
230
231 // Open Serial Port
232 // ----------------
233 _serialPort->open(QIODevice::ReadWrite|QIODevice::Unbuffered);
234 if (!_serialPort->isOpen()) {
235 delete _serialPort;
236 _serialPort = 0;
237 emit(newMessage((_staID + ": Cannot open serial port\n"), true));
238 }
239 connect(_serialPort, SIGNAL(readyRead()),
240 this, SLOT(slotSerialReadyRead()));
241
242 // Automatic NMEA
243 // --------------
244 if (settings.value("serialAutoNMEA").toString() == "Auto") {
245 _serialNMEA = AUTO_NMEA;
246
247 QString fName = settings.value("serialFileNMEA").toString();
248 if (!fName.isEmpty()) {
249 _serialOutFile = new QFile(fName);
250 if ( Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked) {
251 _serialOutFile->open(QIODevice::WriteOnly | QIODevice::Append);
252 }
253 else {
254 _serialOutFile->open(QIODevice::WriteOnly);
255 }
256 }
257 }
258
259 // Manual NMEA
260 // -----------
261 else {
262 _serialNMEA = MANUAL_NMEA;
263 }
264 }
265
266 // Initialize PPP Client?
267 // ----------------------
268#ifndef MLS_SOFTWARE
269 if (settings.value("pppMount").toString() == _staID) {
270 _PPPclient = new bncPPPclient(_staID);
271 app->_bncPPPclient = _PPPclient;
272 qRegisterMetaType<bncTime>("bncTime");
273 connect(_PPPclient, SIGNAL(newPosition(bncTime, double, double, double)),
274 this, SIGNAL(newPosition(bncTime, double, double, double)));
275 connect(_PPPclient, SIGNAL(newNMEAstr(QByteArray)),
276 this, SIGNAL(newNMEAstr(QByteArray)));
277 }
278#endif
279
280 _latencyChecker = new latencyChecker(_staID);
281}
282
283// Instantiate the decoder
284//////////////////////////////////////////////////////////////////////////////
285t_irc bncGetThread::initDecoder() {
286
287 if (_format.indexOf("RTCM_2") != -1 || _format.indexOf("RTCM2") != -1 ||
288 _format.indexOf("RTCM 2") != -1 ) {
289 emit(newMessage(_staID + ": Get data in RTCM 2.x format", true));
290 _decoders[_staID] = new RTCM2Decoder(_staID.data());
291 }
292 else if (_format.indexOf("RTCM_3") != -1 || _format.indexOf("RTCM3") != -1 ||
293 _format.indexOf("RTCM 3") != -1 ) {
294 emit(newMessage(_staID + ": Get data in RTCM 3.x format", true));
295 _decoders[_staID] = new RTCM3Decoder(_staID, _rawFile);
296 connect((RTCM3Decoder*) decoder(), SIGNAL(newMessage(QByteArray,bool)),
297 this, SIGNAL(newMessage(QByteArray,bool)));
298 }
299 else if (_format.indexOf("GPSS") != -1 || _format.indexOf("BNC") != -1) {
300 emit(newMessage(_staID + ": Get Data in GPSS format", true));
301 _decoders[_staID] = new gpssDecoder();
302 }
303 else if (_format.indexOf("ZERO") != -1) {
304 emit(newMessage(_staID + ": Get data in original format", true));
305 _decoders[_staID] = new bncZeroDecoder(_staID);
306 }
307 else if (_format.indexOf("RTNET") != -1) {
308 emit(newMessage(_staID + ": Get data in RTNet format", true));
309 _decoders[_staID] = new bncRtnetDecoder();
310 }
311 else if (_format.indexOf("HASS2ASCII") != -1) {
312 emit(newMessage(_staID + ": Get data in HASS2ASCII format", true));
313 _decoders[_staID] = new hassDecoder(_staID);
314 }
315 else {
316 emit(newMessage(_staID + ": Unknown data format " + _format, true));
317 _isToBeDeleted = true;
318 return failure;
319 }
320
321 msleep(100); //sleep 0.1 sec
322
323 if (decoder()) {
324 decoder()->initRinex(_staID, _mountPoint, _latitude, _longitude,
325 _nmea, _ntripVersion);
326
327 }
328
329 return success;
330}
331
332// Current decoder in use
333////////////////////////////////////////////////////////////////////////////
334GPSDecoder* bncGetThread::decoder() {
335 if (_decoders.contains(_staID) || initDecoder() == success) {
336 return _decoders.value(_staID);
337 }
338 else {
339 return 0;
340 }
341}
342
343// Destructor
344////////////////////////////////////////////////////////////////////////////
345bncGetThread::~bncGetThread() {
346 if (isRunning()) {
347 wait();
348 }
349 if (_query) {
350 _query->stop();
351 _query->deleteLater();
352 }
353 delete _PPPclient;
354 QMapIterator<QString, GPSDecoder*> it(_decoders);
355 while (it.hasNext()) {
356 it.next();
357 delete it.value();
358 }
359 delete _rawFile;
360 delete _serialOutFile;
361 delete _serialPort;
362 delete _latencyChecker;
363 emit getThreadFinished(_staID);
364}
365
366//
367////////////////////////////////////////////////////////////////////////////
368void bncGetThread::terminate() {
369 _isToBeDeleted = true;
370 if (!isRunning()) {
371 delete this;
372 }
373}
374
375// Run
376////////////////////////////////////////////////////////////////////////////
377void bncGetThread::run() {
378
379 while (true) {
380 try {
381 if (_isToBeDeleted) {
382 QThread::exit(0);
383 this->deleteLater();
384 return;
385 }
386
387 if (tryReconnect() != success) {
388 _latencyChecker->checkReconnect();
389 continue;
390 }
391
392 // Delete old observations
393 // -----------------------
394 QMapIterator<QString, GPSDecoder*> itDec(_decoders);
395 while (itDec.hasNext()) {
396 itDec.next();
397 GPSDecoder* decoder = itDec.value();
398 decoder->_obsList.clear();
399 }
400
401 // Read Data
402 // ---------
403 QByteArray data;
404 if (_query) {
405 _query->waitForReadyRead(data);
406 }
407 else if (_rawFile) {
408 data = _rawFile->readChunk();
409 _format = _rawFile->format();
410 _staID = _rawFile->staID();
411
412 if (data.isEmpty()) {
413 cout << "no more data" << endl;
414 QThread::exit(0);
415 this->deleteLater();
416 return;
417 }
418 }
419 qint64 nBytes = data.size();
420
421 // Timeout, reconnect
422 // ------------------
423 if (nBytes == 0) {
424 _latencyChecker->checkReconnect();
425 emit(newMessage(_staID + ": Data timeout, reconnecting", true));
426 msleep(10000); //sleep 10 sec, G. Weber
427 continue;
428 }
429 else {
430 emit newBytes(_staID, nBytes);
431 }
432
433 // Output Data
434 // -----------
435 if (_rawOutput) {
436 bncApp* app = (bncApp*) qApp;
437 app->writeRawData(data, _staID, _format);
438 }
439
440 if (_serialPort) {
441 slotSerialReadyRead();
442 _serialPort->write(data);
443 }
444
445 // Decode Data
446 // -----------
447 vector<string> errmsg;
448 if (!decoder()) {
449 _isToBeDeleted = true;
450 continue;
451 }
452 decoder()->_obsList.clear();
453 t_irc irc = decoder()->Decode(data.data(), data.size(), errmsg);
454
455 // Perform various scans and checks
456 // --------------------------------
457 _latencyChecker->checkOutage(irc == success);
458 _latencyChecker->checkObsLatency(decoder()->_obsList);
459 _latencyChecker->checkCorrLatency(decoder()->corrGPSEpochTime());
460
461 emit newLatency(_staID, _latencyChecker->currentLatency());
462
463 scanRTCM();
464
465 // Loop over all observations (observations output)
466 // ------------------------------------------------
467 QListIterator<t_obs> it(decoder()->_obsList);
468 bool firstObs = true;
469 while (it.hasNext()) {
470 const t_obs& obs = it.next();
471
472 QString prn = QString("%1%2").arg(obs.satSys)
473 .arg(obs.satNum, 2, 10, QChar('0'));
474 long iSec = long(floor(obs.GPSWeeks+0.5));
475 long obsTime = obs.GPSWeek * 7*24*3600 + iSec;
476
477 // Check observation epoch
478 // -----------------------
479 if (!_rawFile && !dynamic_cast<gpssDecoder*>(decoder())) {
480 int week;
481 double sec;
482 currentGPSWeeks(week, sec);
483 long currTime = week * 7*24*3600 + long(sec);
484 const double maxDt = 600.0;
485 if (fabs(currTime - obsTime) > maxDt) {
486 emit( newMessage(_staID + ": Wrong observation epoch(s)", false) );
487 continue;
488 }
489 }
490
491 // Check observations coming twice (e.g. KOUR0 Problem)
492 // ----------------------------------------------------
493 QMap<QString, long>::const_iterator it = _prnLastEpo.find(prn);
494 if (it != _prnLastEpo.end()) {
495 long oldTime = it.value();
496 if (obsTime < oldTime) {
497 emit( newMessage(_staID +
498 ": old observation " + prn.toAscii(), false));
499 continue;
500 }
501 else if (obsTime == oldTime) {
502 emit( newMessage(_staID +
503 ": observation coming more than once " + prn.toAscii(), false));
504 continue;
505 }
506 }
507 _prnLastEpo[prn] = obsTime;
508
509 decoder()->dumpRinexEpoch(obs, _format);
510
511 // PPP Client
512 // ----------
513#ifndef MLS_SOFTWARE
514 if (_PPPclient) {
515 _PPPclient->putNewObs(obs);
516 }
517#endif
518
519 // Emit new observation signal
520 // ---------------------------
521 if (!_isToBeDeleted) {
522 emit newObs(_staID, firstObs, obs);
523 }
524 firstObs = false;
525 }
526 decoder()->_obsList.clear();
527 }
528 catch (Exception& exc) {
529 emit(newMessage(_staID + " " + exc.what(), true));
530 _isToBeDeleted = true;
531 }
532 catch (...) {
533 emit(newMessage(_staID + " bncGetThread exception", true));
534 _isToBeDeleted = true;
535 }
536 }
537}
538
539// Try Re-Connect
540////////////////////////////////////////////////////////////////////////////
541t_irc bncGetThread::tryReconnect() {
542
543 // Easy Return
544 // -----------
545 if (_query && _query->status() == bncNetQuery::running) {
546 _nextSleep = 0;
547 QMapIterator<QString, GPSDecoder*> itDec(_decoders);
548 while (itDec.hasNext()) {
549 itDec.next();
550 GPSDecoder* decoder = itDec.value();
551 decoder->setRinexReconnectFlag(false);
552 }
553 return success;
554 }
555
556 // Start a new query
557 // -----------------
558 if (!_rawFile) {
559
560 sleep(_nextSleep);
561 if (_nextSleep == 0) {
562 _nextSleep = 1;
563 }
564 else {
565 _nextSleep = 2 * _nextSleep;
566 if (_nextSleep > 256) {
567 _nextSleep = 256;
568 }
569#ifdef MLS_SOFTWARE
570 if (_nextSleep > 4) {
571 _nextSleep = 4;
572 }
573#endif
574 }
575
576 delete _query;
577 if (_ntripVersion == "U") {
578 _query = new bncNetQueryUdp();
579 }
580 else if (_ntripVersion == "R") {
581 _query = new bncNetQueryRtp();
582 }
583 else if (_ntripVersion == "S") {
584 _query = new bncNetQueryS();
585 }
586 else if (_ntripVersion == "N") {
587 _query = new bncNetQueryV0();
588 }
589 else if (_ntripVersion == "UN") {
590 _query = new bncNetQueryUdp0();
591 }
592 else if (_ntripVersion == "2") {
593 _query = new bncNetQueryV2(false);
594 }
595 else if (_ntripVersion == "2s") {
596 _query = new bncNetQueryV2(true);
597 }
598 else {
599 _query = new bncNetQueryV1();
600 }
601 if (_nmea == "yes" && _serialNMEA != AUTO_NMEA) {
602 QByteArray gga = ggaString(_latitude, _longitude, "100.0");
603 _query->startRequest(_mountPoint, gga);
604 }
605 else {
606 _query->startRequest(_mountPoint, "");
607 }
608 if (_query->status() != bncNetQuery::running) {
609 return failure;
610 }
611 }
612
613 QMapIterator<QString, GPSDecoder*> itDec(_decoders);
614 while (itDec.hasNext()) {
615 itDec.next();
616 GPSDecoder* decoder = itDec.value();
617 decoder->setRinexReconnectFlag(false);
618 }
619
620 return success;
621}
622
623// RTCM scan output
624//////////////////////////////////////////////////////////////////////////////
625void bncGetThread::scanRTCM() {
626
627 bncSettings settings;
628 if ( Qt::CheckState(settings.value("scanRTCM").toInt()) == Qt::Checked ) {
629
630 if ( _miscMount == _staID || _miscMount == "ALL" ) {
631
632 // RTCM message types
633 // ------------------
634 for (int ii = 0; ii <decoder()->_typeList.size(); ii++) {
635 QString type = QString("%1 ").arg(decoder()->_typeList[ii]);
636 emit(newMessage(_staID + ": Received message type " + type.toAscii(), true));
637 }
638
639 // RTCMv3 antenna descriptor
640 // -------------------------
641 for (int ii=0;ii<decoder()->_antType.size();ii++) {
642 QString ant1 = QString("%1 ").arg(decoder()->_antType[ii]);
643 emit(newMessage(_staID + ": Antenna descriptor " + ant1.toAscii(), true));
644 }
645
646 // RTCM Antenna Coordinates
647 // ------------------------
648 for (int ii=0; ii <decoder()->_antList.size(); ii++) {
649 QByteArray antT;
650 if (decoder()->_antList[ii].type == GPSDecoder::t_antInfo::ARP) {
651 antT = "ARP";
652 }
653 else if (decoder()->_antList[ii].type == GPSDecoder::t_antInfo::APC) {
654 antT = "APC";
655 }
656 QByteArray ant1, ant2, ant3;
657 ant1 = QString("%1 ").arg(decoder()->_antList[ii].xx,0,'f',4).toAscii();
658 ant2 = QString("%1 ").arg(decoder()->_antList[ii].yy,0,'f',4).toAscii();
659 ant3 = QString("%1 ").arg(decoder()->_antList[ii].zz,0,'f',4).toAscii();
660 emit(newMessage(_staID + ": " + antT + " (ITRF) X " + ant1 + "m", true));
661 emit(newMessage(_staID + ": " + antT + " (ITRF) Y " + ant2 + "m", true));
662 emit(newMessage(_staID + ": " + antT + " (ITRF) Z " + ant3 + "m", true));
663 if (decoder()->_antList[ii].height_f) {
664 QByteArray ant4 = QString("%1 ").arg(decoder()->_antList[ii].height,0,'f',4).toAscii();
665 emit(newMessage(_staID + ": Antenna height above marker " + ant4 + "m", true));
666 }
667 emit(newAntCrd(_staID, decoder()->_antList[ii].xx,
668 decoder()->_antList[ii].yy, decoder()->_antList[ii].zz,
669 antT));
670 }
671 }
672 }
673
674#ifdef MLS_SOFTWARE
675 for (int ii=0; ii <decoder()->_antList.size(); ii++) {
676 QByteArray antT;
677 if (decoder()->_antList[ii].type == GPSDecoder::t_antInfo::ARP) {
678 antT = "ARP";
679 }
680 else if (decoder()->_antList[ii].type == GPSDecoder::t_antInfo::APC) {
681 antT = "APC";
682 }
683 emit(newAntCrd(_staID, decoder()->_antList[ii].xx,
684 decoder()->_antList[ii].yy, decoder()->_antList[ii].zz,
685 antT));
686 }
687
688 for (int ii = 0; ii <decoder()->_typeList.size(); ii++) {
689 emit(newRTCMMessage(_staID, decoder()->_typeList[ii]));
690 }
691#endif
692
693
694
695
696 decoder()->_typeList.clear();
697 decoder()->_antType.clear();
698 decoder()->_antList.clear();
699}
700
701// Handle Data from Serial Port
702////////////////////////////////////////////////////////////////////////////
703void bncGetThread::slotSerialReadyRead() {
704 if (_serialPort) {
705 int nb = _serialPort->bytesAvailable();
706 if (nb > 0) {
707 QByteArray data = _serialPort->read(nb);
708
709 if (_serialNMEA == AUTO_NMEA) {
710 int i1 = data.indexOf("$GPGGA");
711 if (i1 != -1) {
712 int i2 = data.indexOf("*", i1);
713 if (i2 != -1 && data.size() > i2 + 1) {
714 QByteArray gga = data.mid(i1,i2-i1+3);
715 _query->sendNMEA(gga);
716 }
717 }
718 }
719
720 if (_serialOutFile) {
721 _serialOutFile->write(data);
722 _serialOutFile->flush();
723 }
724 }
725 }
726}
727
728//
729//////////////////////////////////////////////////////////////////////////////
730void bncGetThread::slotNewEphGPS(gpsephemeris gpseph) {
731 RTCM2Decoder* decoder2 = dynamic_cast<RTCM2Decoder*>(decoder());
732 RTCM3Decoder* decoder3 = dynamic_cast<RTCM3Decoder*>(decoder());
733
734 if ( decoder2 ) {
735 QMutexLocker locker(&_mutex);
736
737 string storedPRN;
738 vector<int> IODs;
739
740 if ( decoder2->storeEph(gpseph, storedPRN, IODs) ) {
741#ifdef DEBUG_RTCM2_2021
742 QString msg = _staID + QString(": stored eph %1 IODs").arg(storedPRN.c_str());
743
744 for (unsigned ii = 0; ii < IODs.size(); ii++) {
745 msg += QString(" %1").arg(IODs[ii],4);
746 }
747
748 emit(newMessage(msg.toAscii()));
749#endif
750 }
751 }
752
753 if ( decoder3 ) {
754 QMutexLocker locker(&_mutex);
755
756 if ( decoder3->storeEph(gpseph) ) {
757#ifdef DEBUG_RTCM3
758 QString msg = _staID + QString(": RTCM3Decoder, stored eph for satellite %1").arg(gpseph.satellite);
759 emit(newMessage(msg.toAscii(),true));
760#endif
761 }
762 }
763}
764
Note: See TracBrowser for help on using the repository browser.