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

Last change on this file since 1944 was 1928, checked in by mervart, 16 years ago

* empty log message *

File size: 19.5 KB
RevLine 
[280]1// Part of BNC, a utility for retrieving decoding and
[464]2// converting GNSS data streams from NTRIP broadcasters.
[280]3//
[464]4// Copyright (C) 2007
[280]5// German Federal Agency for Cartography and Geodesy (BKG)
6// http://www.bkg.bund.de
[464]7// Czech Technical University Prague, Department of Geodesy
[280]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.
[35]24
25/* -------------------------------------------------------------------------
[93]26 * BKG NTRIP Client
[35]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
[277]41#include <stdlib.h>
[1044]42#include <iomanip>
[1218]43#include <sstream>
[277]44
[35]45#include <QFile>
46#include <QTextStream>
47#include <QtNetwork>
[356]48#include <QTime>
[35]49
50#include "bncgetthread.h"
[192]51#include "bnctabledlg.h"
[243]52#include "bncapp.h"
[352]53#include "bncutils.h"
[408]54#include "bncrinex.h"
[423]55#include "bnczerodecoder.h"
[1621]56#include "bncnetqueryv0.h"
[1387]57#include "bncnetqueryv1.h"
58#include "bncnetqueryv2.h"
[1410]59#include "bncnetqueryrtp.h"
[1721]60#include "bncnetqueryudp.h"
[1779]61#include "bncnetqueryudp0.h"
[1753]62#include "bncnetquerys.h"
[1535]63#include "bncsettings.h"
[1558]64#include "latencychecker.h"
[65]65
[243]66#include "RTCM/RTCM2Decoder.h"
[297]67#include "RTCM3/RTCM3Decoder.h"
[293]68#include "RTIGS/RTIGSDecoder.h"
[1310]69#include "GPSS/gpssDecoder.h"
[1318]70#include "serial/qextserialport.h"
[35]71
72using namespace std;
73
[1143]74// Constructor 1
[35]75////////////////////////////////////////////////////////////////////////////
[1138]76bncGetThread::bncGetThread(const QByteArray& rawInpFileName,
77 const QByteArray& format) {
78
79 _rawInpFile = new QFile(rawInpFileName);
80 _rawInpFile->open(QIODevice::ReadOnly);
[1555]81 _format = format;
82 _staID = rawInpFileName.mid(
83 rawInpFileName.lastIndexOf(QDir::separator())+1,4);
[1147]84
[1555]85 initialize();
[1138]86}
87
[1143]88// Constructor 2
89////////////////////////////////////////////////////////////////////////////
[278]90bncGetThread::bncGetThread(const QUrl& mountPoint,
[366]91 const QByteArray& format,
92 const QByteArray& latitude,
93 const QByteArray& longitude,
[1353]94 const QByteArray& nmea,
[1770]95 const QByteArray& ntripVersion, const QByteArray& extraStaID) {
[1555]96 _rawInpFile = 0;
97 _mountPoint = mountPoint;
[1770]98 _staID = (extraStaID.size() == 0 ? mountPoint.path().mid(1).toAscii() : extraStaID);
[1555]99 _format = format;
100 _latitude = latitude;
101 _longitude = longitude;
102 _nmea = nmea;
[1353]103 _ntripVersion = ntripVersion;
[1139]104
105 initialize();
106}
107
[1555]108// Initialization (common part of the constructor)
[1143]109////////////////////////////////////////////////////////////////////////////
[1139]110void bncGetThread::initialize() {
111
[1555]112 setTerminationEnabled(true);
113
[1225]114 bncApp* app = (bncApp*) qApp;
115
[1555]116 connect(this, SIGNAL(newMessage(QByteArray,bool)),
117 app, SLOT(slotMessage(const QByteArray,bool)));
118
[1525]119 _isToBeDeleted = false;
[1555]120 _decoder = 0;
121 _query = 0;
122 _nextSleep = 0;
123 _rawOutFile = 0;
[255]124
[1574]125 bncSettings settings;
[1595]126
[1574]127 _miscMount = settings.value("miscMount").toString();
128
[408]129 // RINEX writer
130 // ------------
131 _samplingRate = settings.value("rnxSampl").toInt();
132 if ( settings.value("rnxPath").toString().isEmpty() ) {
133 _rnx = 0;
[1555]134 if (_rawInpFile) {
135 cerr << "no RINEX path specified" << endl;
136 ::exit(1);
137 }
[408]138 }
139 else {
[1353]140 _rnx = new bncRinex(_staID, _mountPoint, _format, _latitude,
[1639]141 _longitude, _nmea, _ntripVersion);
[408]142 }
143
[1555]144 // Serial Port
145 // -----------
[1710]146 _serialNMEA = NO_NMEA;
147 _serialOutFile = 0;
148 _serialPort = 0;
149
[1327]150 if (settings.value("serialMountPoint").toString() == _staID) {
[1710]151 _serialPort = new QextSerialPort(settings.value("serialPortName").toString() );
152 _serialPort->setTimeout(0,100);
153
154 // Baud Rate
155 // ---------
[1330]156 QString hlp = settings.value("serialBaudRate").toString();
157 if (hlp == "110") {
158 _serialPort->setBaudRate(BAUD110);
159 }
160 else if (hlp == "300") {
161 _serialPort->setBaudRate(BAUD300);
162 }
163 else if (hlp == "600") {
164 _serialPort->setBaudRate(BAUD600);
165 }
166 else if (hlp == "1200") {
167 _serialPort->setBaudRate(BAUD1200);
168 }
169 else if (hlp == "2400") {
170 _serialPort->setBaudRate(BAUD2400);
171 }
172 else if (hlp == "4800") {
173 _serialPort->setBaudRate(BAUD4800);
174 }
175 else if (hlp == "9600") {
176 _serialPort->setBaudRate(BAUD9600);
177 }
178 else if (hlp == "19200") {
179 _serialPort->setBaudRate(BAUD19200);
180 }
181 else if (hlp == "38400") {
182 _serialPort->setBaudRate(BAUD38400);
183 }
184 else if (hlp == "57600") {
185 _serialPort->setBaudRate(BAUD57600);
186 }
187 else if (hlp == "115200") {
188 _serialPort->setBaudRate(BAUD115200);
189 }
[1710]190
191 // Parity
192 // ------
[1330]193 hlp = settings.value("serialParity").toString();
194 if (hlp == "NONE") {
195 _serialPort->setParity(PAR_NONE);
196 }
197 else if (hlp == "ODD") {
198 _serialPort->setParity(PAR_ODD);
199 }
200 else if (hlp == "EVEN") {
201 _serialPort->setParity(PAR_EVEN);
202 }
203 else if (hlp == "SPACE") {
204 _serialPort->setParity(PAR_SPACE);
205 }
[1710]206
207 // Data Bits
208 // ---------
[1330]209 hlp = settings.value("serialDataBits").toString();
210 if (hlp == "5") {
211 _serialPort->setDataBits(DATA_5);
212 }
213 else if (hlp == "6") {
214 _serialPort->setDataBits(DATA_6);
215 }
216 else if (hlp == "7") {
217 _serialPort->setDataBits(DATA_7);
218 }
219 else if (hlp == "8") {
220 _serialPort->setDataBits(DATA_8);
221 }
222 hlp = settings.value("serialStopBits").toString();
223 if (hlp == "1") {
224 _serialPort->setStopBits(STOP_1);
225 }
226 else if (hlp == "2") {
227 _serialPort->setStopBits(STOP_2);
228 }
[1710]229
230 // Flow Control
231 // ------------
232 hlp = settings.value("serialFlowControl").toString();
[1711]233 if (hlp == "XONXOFF") {
[1710]234 _serialPort->setFlowControl(FLOW_XONXOFF);
235 }
236 else if (hlp == "HARDWARE") {
237 _serialPort->setFlowControl(FLOW_HARDWARE);
238 }
[1711]239 else {
240 _serialPort->setFlowControl(FLOW_OFF);
241 }
[1710]242
243 // Open Serial Port
244 // ----------------
[1326]245 _serialPort->open(QIODevice::ReadWrite|QIODevice::Unbuffered);
[1331]246 if (!_serialPort->isOpen()) {
247 delete _serialPort;
248 _serialPort = 0;
[1451]249 emit(newMessage((_staID + ": Cannot open serial port\n"), true));
[1331]250 }
[1606]251 connect(_serialPort, SIGNAL(readyRead()),
252 this, SLOT(slotSerialReadyRead()));
253
[1710]254 // Automatic NMEA
255 // --------------
256 if (settings.value("serialAutoNMEA").toString() == "Auto") {
257 _serialNMEA = AUTO_NMEA;
258
259 QString fName = settings.value("serialFileNMEA").toString();
260 if (!fName.isEmpty()) {
261 _serialOutFile = new QFile(fName);
262 if ( Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked) {
263 _serialOutFile->open(QIODevice::WriteOnly | QIODevice::Append);
264 }
265 else {
266 _serialOutFile->open(QIODevice::WriteOnly);
267 }
[1634]268 }
[1606]269 }
[1710]270
271 // Manual NMEA
272 // -----------
273 else {
274 _serialNMEA = MANUAL_NMEA;
[1636]275 }
[1318]276 }
277
[1137]278 // Raw Output
279 // ----------
[1140]280 // QByteArray rawOutFileName = "./" + _staID + ".raw";
281 // _rawOutFile = new QFile(rawOutFileName);
282 // _rawOutFile->open(QIODevice::WriteOnly);
[1137]283
[1555]284
285 // Instantiate the decoder
286 // -----------------------
[1744]287 if (_format.indexOf("RTCM_2") != -1 || _format.indexOf("RTCM2") != -1 ||
288 _format.indexOf("RTCM 2") != -1 ) {
[1555]289 emit(newMessage(_staID + ": Get data in RTCM 2.x format", true));
290 _decoder = new RTCM2Decoder(_staID.data());
291 }
[1744]292 else if (_format.indexOf("RTCM_3") != -1 || _format.indexOf("RTCM3") != -1 ||
293 _format.indexOf("RTCM 3") != -1 ) {
[1555]294 emit(newMessage(_staID + ": Get data in RTCM 3.x format", true));
295 _decoder = new RTCM3Decoder(_staID);
296 connect((RTCM3Decoder*) _decoder, SIGNAL(newMessage(QByteArray,bool)),
297 this, SIGNAL(newMessage(QByteArray,bool)));
298 }
299 else if (_format.indexOf("RTIGS") != -1) {
300 emit(newMessage(_staID + ": Get data in RTIGS format", true));
301 _decoder = new RTIGSDecoder();
302 }
303 else if (_format.indexOf("GPSS") != -1 || _format.indexOf("BNC") != -1) {
304 emit(newMessage(_staID + ": Get Data in GPSS format", true));
305 _decoder = new gpssDecoder();
306 }
307 else if (_format.indexOf("ZERO") != -1) {
308 emit(newMessage(_staID + ": Get data in original format", true));
309 _decoder = new bncZeroDecoder(_staID);
310 }
311 else {
312 emit(newMessage(_staID + ": Unknown data format " + _format, true));
313 _isToBeDeleted = true;
314 delete this;
315 }
316
[1558]317 _latencyChecker = new latencyChecker(_staID);
[1557]318
[319]319 msleep(100); //sleep 0.1 sec
[35]320}
321
322// Destructor
323////////////////////////////////////////////////////////////////////////////
324bncGetThread::~bncGetThread() {
[1928]325
326 if (isRunning()) {
327 wait();
328 }
329
[1527]330 if (_query) {
331 _query->stop();
[1708]332 _query->deleteLater();
[1527]333 }
[617]334 delete _decoder;
[1044]335 delete _rnx;
[1138]336 delete _rawInpFile;
337 delete _rawOutFile;
[1607]338 delete _serialOutFile;
[1328]339 delete _serialPort;
[1557]340 delete _latencyChecker;
[1556]341 emit getThreadFinished(_staID);
[35]342}
343
[1390]344//
345////////////////////////////////////////////////////////////////////////////
346void bncGetThread::terminate() {
[1525]347 _isToBeDeleted = true;
[1559]348 if (!isRunning()) {
349 delete this;
350 }
[1390]351}
352
[136]353// Run
354////////////////////////////////////////////////////////////////////////////
355void bncGetThread::run() {
356
[35]357 while (true) {
[629]358 try {
[1555]359 if (_isToBeDeleted) {
360 QThread::exit(0);
361 this->deleteLater();
362 return;
[629]363 }
[621]364
[1555]365 if (tryReconnect() != success) {
[1572]366 _latencyChecker->checkReconnect();
[1555]367 continue;
[621]368 }
[1555]369
370 // Delete old observations
371 // -----------------------
372 QListIterator<p_obs> itOld(_decoder->_obsList);
373 while (itOld.hasNext()) {
374 delete itOld.next();
375 }
[621]376 _decoder->_obsList.clear();
377
[1555]378 // Read Data
379 // ---------
[1377]380 QByteArray data;
381 if (_query) {
382 _query->waitForReadyRead(data);
[1138]383 }
384 else if (_rawInpFile) {
[1146]385 const qint64 maxBytes = 1024;
[1555]386 data = _rawInpFile->read(maxBytes);
387 if (data.isEmpty()) {
388 cout << "no more data" << endl;
389 ::exit(0);
390 }
[1138]391 }
[1555]392 qint64 nBytes = data.size();
[1138]393
[1555]394 // Timeout, reconnect
395 // ------------------
396 if (nBytes == 0) {
[1576]397 _latencyChecker->checkReconnect();
[1555]398 emit(newMessage(_staID + ": Data timeout, reconnecting", true));
399 continue;
400 }
401 else {
[567]402 emit newBytes(_staID, nBytes);
[1555]403 }
[567]404
[1555]405 // Output Data
406 // -----------
407 if (_rawOutFile) {
408 _rawOutFile->write(data);
409 _rawOutFile->flush();
410 }
411 if (_serialPort) {
[1633]412 slotSerialReadyRead();
[1555]413 _serialPort->write(data);
414 }
415
416 // Decode Data
417 // -----------
418 vector<string> errmsg;
[1562]419 t_irc irc = _decoder->Decode(data.data(), data.size(), errmsg);
[1137]420
[1555]421 // Perform various scans and checks
422 // --------------------------------
[1562]423 _latencyChecker->checkOutage(irc == success);
424 _latencyChecker->checkObsLatency(_decoder->_obsList);
[1567]425 _latencyChecker->checkCorrLatency(_decoder->corrGPSEpochTime());
426
[1555]427 scanRTCM();
[1138]428
[1555]429 // Loop over all observations (observations output)
430 // ------------------------------------------------
431 QListIterator<p_obs> it(_decoder->_obsList);
432 while (it.hasNext()) {
433 p_obs obs = it.next();
434
435 // Check observation epoch
436 // -----------------------
437 if (!_rawInpFile && !dynamic_cast<gpssDecoder*>(_decoder)) {
438 int week;
439 double sec;
440 currentGPSWeeks(week, sec);
441 const double secPerWeek = 7.0 * 24.0 * 3600.0;
442
443 if (week < obs->_o.GPSWeek) {
444 week += 1;
445 sec -= secPerWeek;
[1218]446 }
[1555]447 if (week > obs->_o.GPSWeek) {
448 week -= 1;
449 sec += secPerWeek;
[650]450 }
[1555]451 double dt = fabs(sec - obs->_o.GPSWeeks);
452 const double maxDt = 600.0;
453 if (week != obs->_o.GPSWeek || dt > maxDt) {
454 emit( newMessage(_staID + ": Wrong observation epoch(s)", true) );
455 delete obs;
456 continue;
[940]457 }
[686]458 }
[1555]459
460 // RINEX Output
461 // ------------
462 if (_rnx) {
463 long iSec = long(floor(obs->_o.GPSWeeks+0.5));
464 long newTime = obs->_o.GPSWeek * 7*24*3600 + iSec;
465 if (_samplingRate == 0 || iSec % _samplingRate == 0) {
466 _rnx->deepCopy(obs);
[1271]467 }
[1555]468 _rnx->dumpEpoch(newTime);
[1271]469 }
[1555]470
471 // Emit new observation signal
472 // ---------------------------
473 bool firstObs = (obs == _decoder->_obsList.first());
474 obs->_status = t_obs::posted;
475 emit newObs(_staID, firstObs, obs);
[249]476 }
[1555]477 _decoder->_obsList.clear();
[35]478 }
[1555]479 catch (...) {
[1559]480 emit(newMessage(_staID + "bncGetThread exception", true));
481 _isToBeDeleted = true;
[1555]482 }
[35]483 }
484}
485
[136]486// Try Re-Connect
487////////////////////////////////////////////////////////////////////////////
[1555]488t_irc bncGetThread::tryReconnect() {
489
490 // Easy Return
491 // -----------
492 if (_query && _query->status() == bncNetQuery::running) {
493 _nextSleep = 0;
[1709]494 if (_rnx) {
495 _rnx->setReconnectFlag(false);
496 }
[1555]497 return success;
[408]498 }
[1555]499
500 // Start a new query
501 // -----------------
502 if (!_rawInpFile) {
503
[138]504 sleep(_nextSleep);
[1555]505 if (_nextSleep == 0) {
506 _nextSleep = 1;
[138]507 }
508 else {
[1555]509 _nextSleep = 2 * _nextSleep;
[442]510 if (_nextSleep > 256) {
511 _nextSleep = 256;
[152]512 }
[1816]513#ifdef MLS_SOFTWARE
[1817]514 if (_nextSleep > 4) {
515 _nextSleep = 4;
[1816]516 }
517#endif
[138]518 }
[1555]519
520 delete _query;
[1722]521 if (_ntripVersion == "U") {
[1721]522 _query = new bncNetQueryUdp();
523 }
[1722]524 else if (_ntripVersion == "R") {
[1555]525 _query = new bncNetQueryRtp();
526 }
[1744]527 else if (_ntripVersion == "S") {
[1753]528 _query = new bncNetQueryS();
[1744]529 }
[1621]530 else if (_ntripVersion == "N") {
531 _query = new bncNetQueryV0();
532 }
[1779]533 else if (_ntripVersion == "UN") {
534 _query = new bncNetQueryUdp0();
535 }
[1555]536 else if (_ntripVersion == "2") {
537 _query = new bncNetQueryV2();
538 }
539 else {
540 _query = new bncNetQueryV1();
541 }
[1710]542 if (_nmea == "yes" && _serialNMEA != AUTO_NMEA) {
543 QByteArray gga = ggaString(_latitude, _longitude, "100.0");
[1555]544 _query->startRequest(_mountPoint, gga);
545 }
546 else {
547 _query->startRequest(_mountPoint, "");
548 }
549 if (_query->status() != bncNetQuery::running) {
550 return failure;
551 }
[138]552 }
[658]553
[1555]554 if (_rnx) {
555 _rnx->setReconnectFlag(true);
[658]556 }
[1555]557
558 return success;
[658]559}
[1044]560
[1555]561// RTCM scan output
[1044]562//////////////////////////////////////////////////////////////////////////////
[1555]563void bncGetThread::scanRTCM() {
[1044]564
[1555]565 bncSettings settings;
[1574]566 if ( Qt::CheckState(settings.value("scanRTCM").toInt()) == Qt::Checked ) {
567
568 if ( _miscMount == _staID || _miscMount == "ALL" ) {
569
[1575]570 // RTCM message types
571 // ------------------
[1574]572 for (int ii = 0; ii <_decoder->_typeList.size(); ii++) {
573 QString type = QString("%1 ").arg(_decoder->_typeList[ii]);
574 emit(newMessage(_staID + ": Received message type " + type.toAscii(), true));
575 }
[1044]576
[1574]577 // RTCMv3 antenna descriptor
578 // -------------------------
579 for (int ii=0;ii<_decoder->_antType.size();ii++) {
580 QString ant1 = QString("%1 ").arg(_decoder->_antType[ii]);
581 emit(newMessage(_staID + ": Antenna descriptor " + ant1.toAscii(), true));
582 }
[1555]583
[1575]584 // RTCM Antenna Coordinates
585 // ------------------------
[1574]586 for (int ii=0; ii <_decoder->_antList.size(); ii++) {
587 QByteArray antT;
588 if (_decoder->_antList[ii].type == GPSDecoder::t_antInfo::ARP) {
589 antT = "ARP";
590 }
591 else if (_decoder->_antList[ii].type == GPSDecoder::t_antInfo::APC) {
592 antT = "APC";
593 }
[1575]594 QByteArray ant1, ant2, ant3;
595 ant1 = QString("%1 ").arg(_decoder->_antList[ii].xx,0,'f',4).toAscii();
596 ant2 = QString("%1 ").arg(_decoder->_antList[ii].yy,0,'f',4).toAscii();
597 ant3 = QString("%1 ").arg(_decoder->_antList[ii].zz,0,'f',4).toAscii();
598 emit(newMessage(_staID + ": " + antT + " (ITRF) X " + ant1 + "m", true));
599 emit(newMessage(_staID + ": " + antT + " (ITRF) Y " + ant2 + "m", true));
600 emit(newMessage(_staID + ": " + antT + " (ITRF) Z " + ant3 + "m", true));
601 if (_decoder->_antList[ii].height_f) {
602 QByteArray ant4 = QString("%1 ").arg(_decoder->_antList[ii].height,0,'f',4).toAscii();
603 emit(newMessage(_staID + ": Antenna height above marker " + ant4 + "m", true));
604 }
[1574]605 emit(newAntCrd(_staID, _decoder->_antList[ii].xx,
606 _decoder->_antList[ii].yy, _decoder->_antList[ii].zz,
607 antT));
[1218]608 }
609 }
[1044]610 }
[1575]611
[1770]612#ifdef MLS_SOFTWARE
613 for (int ii=0; ii <_decoder->_antList.size(); ii++) {
614 QByteArray antT;
615 if (_decoder->_antList[ii].type == GPSDecoder::t_antInfo::ARP) {
616 antT = "ARP";
617 }
618 else if (_decoder->_antList[ii].type == GPSDecoder::t_antInfo::APC) {
619 antT = "APC";
620 }
621 emit(newAntCrd(_staID, _decoder->_antList[ii].xx,
622 _decoder->_antList[ii].yy, _decoder->_antList[ii].zz,
623 antT));
624 }
625#endif
626
627
628
629
[1555]630 _decoder->_typeList.clear();
631 _decoder->_antType.clear();
632 _decoder->_antList.clear();
[1044]633}
[1555]634
[1606]635// Handle Data from Serial Port
636////////////////////////////////////////////////////////////////////////////
637void bncGetThread::slotSerialReadyRead() {
[1607]638 if (_serialPort) {
[1633]639 int nb = _serialPort->bytesAvailable();
640 if (nb > 0) {
641 QByteArray data = _serialPort->read(nb);
[1711]642
643 if (_serialNMEA == AUTO_NMEA) {
[1725]644 int i1 = data.indexOf("$GPGGA");
645 if (i1 != -1) {
646 int i2 = data.indexOf("*", i1);
647 if (i2 != -1 && data.size() > i2 + 1) {
648 QByteArray gga = data.mid(i1,i2-i1+3);
649 _query->sendNMEA(gga);
650 }
651 }
[1711]652 }
653
[1633]654 if (_serialOutFile) {
655 _serialOutFile->write(data);
656 _serialOutFile->flush();
657 }
[1607]658 }
659 }
[1606]660}
[1768]661
662//
663//////////////////////////////////////////////////////////////////////////////
664void bncGetThread::slotNewEphGPS(gpsephemeris gpseph) {
[1807]665 RTCM2Decoder* decoder2 = dynamic_cast<RTCM2Decoder*>(_decoder);
666 RTCM3Decoder* decoder3 = dynamic_cast<RTCM3Decoder*>(_decoder);
[1768]667
[1807]668 if ( decoder2 ) {
[1768]669 QMutexLocker locker(&_mutex);
670
671 string storedPRN;
672 vector<int> IODs;
673
[1807]674 if ( decoder2->storeEph(gpseph, storedPRN, IODs) ) {
[1768]675#ifdef DEBUG_RTCM2_2021
676 QString msg = _staID + QString(": stored eph %1 IODs").arg(storedPRN.c_str());
677
678 for (unsigned ii = 0; ii < IODs.size(); ii++) {
679 msg += QString(" %1").arg(IODs[ii],4);
680 }
681
682 emit(newMessage(msg.toAscii()));
683#endif
684 }
685 }
[1807]686
687 if ( decoder3 ) {
688 QMutexLocker locker(&_mutex);
689
690 if ( decoder3->storeEph(gpseph) ) {
[1813]691#ifdef DEBUG_RTCM3
[1807]692 QString msg = _staID + QString(": RTCM3Decoder, stored eph for satellite %1").arg(gpseph.satellite);
693 emit(newMessage(msg.toAscii(),true));
[1813]694#endif
[1807]695 }
696 }
[1768]697}
698
Note: See TracBrowser for help on using the repository browser.