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

Last change on this file since 3528 was 3528, checked in by mervart, 12 years ago
File size: 21.5 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 return success;
324}
325
326// Current decoder in use
327////////////////////////////////////////////////////////////////////////////
328GPSDecoder* bncGetThread::decoder() {
329 if (_decoders.contains(_staID) || initDecoder() == success) {
330 return _decoders.value(_staID);
331 }
332 else {
333 return 0;
334 }
335}
336
337// Destructor
338////////////////////////////////////////////////////////////////////////////
339bncGetThread::~bncGetThread() {
340 if (isRunning()) {
341 wait();
342 }
343 if (_query) {
344 _query->stop();
345 _query->deleteLater();
346 }
347 delete _PPPclient;
348 QMapIterator<QString, GPSDecoder*> it(_decoders);
349 while (it.hasNext()) {
350 it.next();
351 delete it.value();
352 }
353 delete _rawFile;
354 delete _serialOutFile;
355 delete _serialPort;
356 delete _latencyChecker;
357 emit getThreadFinished(_staID);
358}
359
360//
361////////////////////////////////////////////////////////////////////////////
362void bncGetThread::terminate() {
363 _isToBeDeleted = true;
364 if (!isRunning()) {
365 delete this;
366 }
367}
368
369// Run
370////////////////////////////////////////////////////////////////////////////
371void bncGetThread::run() {
372
373 while (true) {
374 try {
375 if (_isToBeDeleted) {
376 QThread::exit(0);
377 this->deleteLater();
378 return;
379 }
380
381 if (tryReconnect() != success) {
382 _latencyChecker->checkReconnect();
383 continue;
384 }
385
386 // Delete old observations
387 // -----------------------
388 QMapIterator<QString, GPSDecoder*> itDec(_decoders);
389 while (itDec.hasNext()) {
390 itDec.next();
391 GPSDecoder* decoder = itDec.value();
392 decoder->_obsList.clear();
393 }
394
395 // Read Data
396 // ---------
397 QByteArray data;
398 if (_query) {
399 _query->waitForReadyRead(data);
400 }
401 else if (_rawFile) {
402 data = _rawFile->readChunk();
403 _format = _rawFile->format();
404 _staID = _rawFile->staID();
405
406 if (data.isEmpty()) {
407 cout << "no more data" << endl;
408 QThread::exit(0);
409 this->deleteLater();
410 return;
411 }
412 }
413 qint64 nBytes = data.size();
414
415 // Timeout, reconnect
416 // ------------------
417 if (nBytes == 0) {
418 _latencyChecker->checkReconnect();
419 emit(newMessage(_staID + ": Data timeout, reconnecting", true));
420 msleep(10000); //sleep 10 sec, G. Weber
421 continue;
422 }
423 else {
424 emit newBytes(_staID, nBytes);
425 }
426
427 // Output Data
428 // -----------
429 if (_rawOutput) {
430 bncApp* app = (bncApp*) qApp;
431 app->writeRawData(data, _staID, _format);
432 }
433
434 if (_serialPort) {
435 slotSerialReadyRead();
436 _serialPort->write(data);
437 }
438
439 // Decode Data
440 // -----------
441 vector<string> errmsg;
442 if (!decoder()) {
443 _isToBeDeleted = true;
444 continue;
445 }
446 decoder()->_obsList.clear();
447 t_irc irc = decoder()->Decode(data.data(), data.size(), errmsg);
448
449 // Perform various scans and checks
450 // --------------------------------
451 _latencyChecker->checkOutage(irc == success);
452 _latencyChecker->checkObsLatency(decoder()->_obsList);
453 _latencyChecker->checkCorrLatency(decoder()->corrGPSEpochTime());
454
455 emit newLatency(_staID, _latencyChecker->currentLatency());
456
457 scanRTCM();
458
459 // Loop over all observations (observations output)
460 // ------------------------------------------------
461 QListIterator<t_obs> it(decoder()->_obsList);
462 bool firstObs = true;
463 while (it.hasNext()) {
464 const t_obs& obs = it.next();
465
466 QString prn = QString("%1%2").arg(obs.satSys)
467 .arg(obs.satNum, 2, 10, QChar('0'));
468 long iSec = long(floor(obs.GPSWeeks+0.5));
469 long obsTime = obs.GPSWeek * 7*24*3600 + iSec;
470
471 // Check observation epoch
472 // -----------------------
473 if (!_rawFile && !dynamic_cast<gpssDecoder*>(decoder())) {
474 int week;
475 double sec;
476 currentGPSWeeks(week, sec);
477 long currTime = week * 7*24*3600 + long(sec);
478 const double maxDt = 600.0;
479 if (fabs(currTime - obsTime) > maxDt) {
480 emit( newMessage(_staID + ": Wrong observation epoch(s)", false) );
481 continue;
482 }
483 }
484
485 // Check observations coming twice (e.g. KOUR0 Problem)
486 // ----------------------------------------------------
487 QMap<QString, long>::const_iterator it = _prnLastEpo.find(prn);
488 if (it != _prnLastEpo.end()) {
489 long oldTime = it.value();
490 if (obsTime < oldTime) {
491 emit( newMessage(_staID +
492 ": old observation " + prn.toAscii(), false));
493 continue;
494 }
495 else if (obsTime == oldTime) {
496 emit( newMessage(_staID +
497 ": observation coming more than once " + prn.toAscii(), false));
498 continue;
499 }
500 }
501 _prnLastEpo[prn] = obsTime;
502
503 decoder()->dumpRinexEpoch(obs, _format);
504
505 // PPP Client
506 // ----------
507#ifndef MLS_SOFTWARE
508 if (_PPPclient) {
509 _PPPclient->putNewObs(obs);
510 }
511#endif
512
513 // Emit new observation signal
514 // ---------------------------
515 if (!_isToBeDeleted) {
516 emit newObs(_staID, firstObs, obs);
517 }
518 firstObs = false;
519 }
520 decoder()->_obsList.clear();
521 }
522 catch (Exception& exc) {
523 emit(newMessage(_staID + " " + exc.what(), true));
524 _isToBeDeleted = true;
525 }
526 catch (...) {
527 emit(newMessage(_staID + " bncGetThread exception", true));
528 _isToBeDeleted = true;
529 }
530 }
531}
532
533// Try Re-Connect
534////////////////////////////////////////////////////////////////////////////
535t_irc bncGetThread::tryReconnect() {
536
537 // Easy Return
538 // -----------
539 if (_query && _query->status() == bncNetQuery::running) {
540 _nextSleep = 0;
541 QMapIterator<QString, GPSDecoder*> itDec(_decoders);
542 while (itDec.hasNext()) {
543 itDec.next();
544 GPSDecoder* decoder = itDec.value();
545 decoder->setRinexReconnectFlag(false);
546 }
547 return success;
548 }
549
550 // Start a new query
551 // -----------------
552 if (!_rawFile) {
553
554 sleep(_nextSleep);
555 if (_nextSleep == 0) {
556 _nextSleep = 1;
557 }
558 else {
559 _nextSleep = 2 * _nextSleep;
560 if (_nextSleep > 256) {
561 _nextSleep = 256;
562 }
563#ifdef MLS_SOFTWARE
564 if (_nextSleep > 4) {
565 _nextSleep = 4;
566 }
567#endif
568 }
569
570 delete _query;
571 if (_ntripVersion == "U") {
572 _query = new bncNetQueryUdp();
573 }
574 else if (_ntripVersion == "R") {
575 _query = new bncNetQueryRtp();
576 }
577 else if (_ntripVersion == "S") {
578 _query = new bncNetQueryS();
579 }
580 else if (_ntripVersion == "N") {
581 _query = new bncNetQueryV0();
582 }
583 else if (_ntripVersion == "UN") {
584 _query = new bncNetQueryUdp0();
585 }
586 else if (_ntripVersion == "2") {
587 _query = new bncNetQueryV2(false);
588 }
589 else if (_ntripVersion == "2s") {
590 _query = new bncNetQueryV2(true);
591 }
592 else {
593 _query = new bncNetQueryV1();
594 }
595 if (_nmea == "yes" && _serialNMEA != AUTO_NMEA) {
596 QByteArray gga = ggaString(_latitude, _longitude, "100.0");
597 _query->startRequest(_mountPoint, gga);
598 }
599 else {
600 _query->startRequest(_mountPoint, "");
601 }
602 if (_query->status() != bncNetQuery::running) {
603 return failure;
604 }
605 }
606
607 QMapIterator<QString, GPSDecoder*> itDec(_decoders);
608 while (itDec.hasNext()) {
609 itDec.next();
610 GPSDecoder* decoder = itDec.value();
611 decoder->setRinexReconnectFlag(false);
612 }
613
614 return success;
615}
616
617// RTCM scan output
618//////////////////////////////////////////////////////////////////////////////
619void bncGetThread::scanRTCM() {
620
621 bncSettings settings;
622 if ( Qt::CheckState(settings.value("scanRTCM").toInt()) == Qt::Checked ) {
623
624 if ( _miscMount == _staID || _miscMount == "ALL" ) {
625
626 // RTCM message types
627 // ------------------
628 for (int ii = 0; ii <decoder()->_typeList.size(); ii++) {
629 QString type = QString("%1 ").arg(decoder()->_typeList[ii]);
630 emit(newMessage(_staID + ": Received message type " + type.toAscii(), true));
631 }
632
633 // RTCMv3 antenna descriptor
634 // -------------------------
635 for (int ii=0;ii<decoder()->_antType.size();ii++) {
636 QString ant1 = QString("%1 ").arg(decoder()->_antType[ii]);
637 emit(newMessage(_staID + ": Antenna descriptor " + ant1.toAscii(), true));
638 }
639
640 // RTCM Antenna Coordinates
641 // ------------------------
642 for (int ii=0; ii <decoder()->_antList.size(); ii++) {
643 QByteArray antT;
644 if (decoder()->_antList[ii].type == GPSDecoder::t_antInfo::ARP) {
645 antT = "ARP";
646 }
647 else if (decoder()->_antList[ii].type == GPSDecoder::t_antInfo::APC) {
648 antT = "APC";
649 }
650 QByteArray ant1, ant2, ant3;
651 ant1 = QString("%1 ").arg(decoder()->_antList[ii].xx,0,'f',4).toAscii();
652 ant2 = QString("%1 ").arg(decoder()->_antList[ii].yy,0,'f',4).toAscii();
653 ant3 = QString("%1 ").arg(decoder()->_antList[ii].zz,0,'f',4).toAscii();
654 emit(newMessage(_staID + ": " + antT + " (ITRF) X " + ant1 + "m", true));
655 emit(newMessage(_staID + ": " + antT + " (ITRF) Y " + ant2 + "m", true));
656 emit(newMessage(_staID + ": " + antT + " (ITRF) Z " + ant3 + "m", true));
657 if (decoder()->_antList[ii].height_f) {
658 QByteArray ant4 = QString("%1 ").arg(decoder()->_antList[ii].height,0,'f',4).toAscii();
659 emit(newMessage(_staID + ": Antenna height above marker " + ant4 + "m", true));
660 }
661 emit(newAntCrd(_staID, decoder()->_antList[ii].xx,
662 decoder()->_antList[ii].yy, decoder()->_antList[ii].zz,
663 antT));
664 }
665 }
666 }
667
668#ifdef MLS_SOFTWARE
669 for (int ii=0; ii <decoder()->_antList.size(); ii++) {
670 QByteArray antT;
671 if (decoder()->_antList[ii].type == GPSDecoder::t_antInfo::ARP) {
672 antT = "ARP";
673 }
674 else if (decoder()->_antList[ii].type == GPSDecoder::t_antInfo::APC) {
675 antT = "APC";
676 }
677 emit(newAntCrd(_staID, decoder()->_antList[ii].xx,
678 decoder()->_antList[ii].yy, decoder()->_antList[ii].zz,
679 antT));
680 }
681
682 for (int ii = 0; ii <decoder()->_typeList.size(); ii++) {
683 emit(newRTCMMessage(_staID, decoder()->_typeList[ii]));
684 }
685#endif
686
687
688
689
690 decoder()->_typeList.clear();
691 decoder()->_antType.clear();
692 decoder()->_antList.clear();
693}
694
695// Handle Data from Serial Port
696////////////////////////////////////////////////////////////////////////////
697void bncGetThread::slotSerialReadyRead() {
698 if (_serialPort) {
699 int nb = _serialPort->bytesAvailable();
700 if (nb > 0) {
701 QByteArray data = _serialPort->read(nb);
702
703 if (_serialNMEA == AUTO_NMEA) {
704 int i1 = data.indexOf("$GPGGA");
705 if (i1 != -1) {
706 int i2 = data.indexOf("*", i1);
707 if (i2 != -1 && data.size() > i2 + 1) {
708 QByteArray gga = data.mid(i1,i2-i1+3);
709 _query->sendNMEA(gga);
710 }
711 }
712 }
713
714 if (_serialOutFile) {
715 _serialOutFile->write(data);
716 _serialOutFile->flush();
717 }
718 }
719 }
720}
721
722//
723//////////////////////////////////////////////////////////////////////////////
724void bncGetThread::slotNewEphGPS(gpsephemeris gpseph) {
725 RTCM2Decoder* decoder2 = dynamic_cast<RTCM2Decoder*>(decoder());
726 RTCM3Decoder* decoder3 = dynamic_cast<RTCM3Decoder*>(decoder());
727
728 if ( decoder2 ) {
729 QMutexLocker locker(&_mutex);
730
731 string storedPRN;
732 vector<int> IODs;
733
734 if ( decoder2->storeEph(gpseph, storedPRN, IODs) ) {
735#ifdef DEBUG_RTCM2_2021
736 QString msg = _staID + QString(": stored eph %1 IODs").arg(storedPRN.c_str());
737
738 for (unsigned ii = 0; ii < IODs.size(); ii++) {
739 msg += QString(" %1").arg(IODs[ii],4);
740 }
741
742 emit(newMessage(msg.toAscii()));
743#endif
744 }
745 }
746
747 if ( decoder3 ) {
748 QMutexLocker locker(&_mutex);
749
750 if ( decoder3->storeEph(gpseph) ) {
751#ifdef DEBUG_RTCM3
752 QString msg = _staID + QString(": RTCM3Decoder, stored eph for satellite %1").arg(gpseph.satellite);
753 emit(newMessage(msg.toAscii(),true));
754#endif
755 }
756 }
757}
758
Note: See TracBrowser for help on using the repository browser.