source: ntrip/trunk/BNC/src/bnccore.cpp@ 7026

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

minor fixes to allow seperate GPS-only and GLONASS-only data sets in RINEX version 2 navigation files

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: t_bncCore
30 *
31 * Purpose: This class implements the main application
32 *
33 * Author: L. Mervart
34 *
35 * Created: 29-Aug-2006
36 *
37 * Changes:
38 *
39 * -----------------------------------------------------------------------*/
40
41#include <iostream>
42#include <sstream>
43#include <QMessageBox>
44#include <cmath>
45
46#include "bnccore.h"
47#include "bncutils.h"
48#include "bncrinex.h"
49#include "bncsettings.h"
50#include "bncversion.h"
51#include "ephemeris.h"
52#include "rinex/rnxobsfile.h"
53#include "rinex/rnxnavfile.h"
54#include "pppMain.h"
55
56#ifdef USE_COMBINATION
57# include "combination/bnccomb.h"
58#endif
59
60using namespace std;
61
62// Singleton
63////////////////////////////////////////////////////////////////////////////
64t_bncCore* t_bncCore::instance() {
65 static t_bncCore _bncCore;
66 return &_bncCore;
67}
68
69// Constructor
70////////////////////////////////////////////////////////////////////////////
71t_bncCore::t_bncCore() : _ephUser(false) {
72 _GUIenabled = true;
73 _logFileFlag = 0;
74 _logFile = 0;
75 _logStream = 0;
76 _rawFile = 0;
77 _caster = 0;
78#ifdef USE_COMBINATION
79 _bncComb = 0;
80#endif
81
82 // Eph file(s)
83 // -----------
84 _rinexVers = 0;
85 _ephFileGPS = 0;
86 _ephStreamGPS = 0;
87 _ephFileGlonass = 0;
88 _ephStreamGlonass = 0;
89 _ephFileGalileo = 0;
90 _ephStreamGalileo = 0;
91 _ephFileSBAS = 0;
92 _ephStreamSBAS = 0;
93
94 _portEph = 0;
95 _serverEph = 0;
96 _socketsEph = 0;
97
98 _portCorr = 0;
99 _serverCorr = 0;
100 _socketsCorr = 0;
101
102 _pgmName = QString(BNCPGMNAME).leftJustified(20, ' ', true);
103#ifdef WIN32
104 _userName = QString("${USERNAME}");
105#else
106 _userName = QString("${USER}");
107#endif
108 expandEnvVar(_userName);
109
110 _userName = _userName.leftJustified(20, ' ', true);
111 _dateAndTimeGPS = 0;
112 _mainWindow = 0;
113
114 _pppMain = new BNC_PPP::t_pppMain();
115 qRegisterMetaType< QVector<double> > ("QVector<double>");
116 qRegisterMetaType<bncTime> ("bncTime");
117 qRegisterMetaType<t_ephGPS> ("t_ephGPS");
118 qRegisterMetaType<t_ephGlo> ("t_ephGlo");
119 qRegisterMetaType<t_ephGal> ("t_ephGal");
120 qRegisterMetaType<t_ephSBAS> ("t_ephSBAS");
121 qRegisterMetaType<t_ephBDS> ("t_ephBDS");
122 qRegisterMetaType<QList<t_orbCorr> > ("QList<t_orbCorr>");
123 qRegisterMetaType<QList<t_clkCorr> > ("QList<t_clkCorr>");
124 qRegisterMetaType<QList<t_satCodeBias> > ("QList<t_satCodeBias>");
125 qRegisterMetaType<QList<t_satPhaseBias> > ("QList<t_satPhaseBias>");
126 qRegisterMetaType<t_vTec> ("t_vTec");
127
128}
129
130// Destructor
131////////////////////////////////////////////////////////////////////////////
132t_bncCore::~t_bncCore() {
133 delete _logStream;
134 delete _logFile;
135 delete _ephStreamGPS;
136 delete _ephFileGPS;
137 delete _serverEph;
138 delete _socketsEph;
139 delete _serverCorr;
140 delete _socketsCorr;
141 if (_rinexVers == 2) {
142 delete _ephStreamGlonass;
143 delete _ephFileGlonass;
144 }
145
146 delete _dateAndTimeGPS;
147 delete _rawFile;
148
149#ifdef USE_COMBINATION
150 delete _bncComb;
151#endif
152}
153
154// Write a Program Message
155////////////////////////////////////////////////////////////////////////////
156void t_bncCore::slotMessage(QByteArray msg, bool showOnScreen) {
157
158 QMutexLocker locker(&_mutexMessage);
159
160 messagePrivate(msg);
161 emit newMessage(msg, showOnScreen);
162}
163
164// Write a Program Message (private, no lock)
165////////////////////////////////////////////////////////////////////////////
166void t_bncCore::messagePrivate(const QByteArray& msg) {
167
168 // First time resolve the log file name
169 // ------------------------------------
170 QDate currDate = currentDateAndTimeGPS().date();
171 if (_logFileFlag == 0 || _fileDate != currDate) {
172 delete _logStream; _logStream = 0;
173 delete _logFile; _logFile = 0;
174 _logFileFlag = 1;
175 bncSettings settings;
176 QString logFileName = settings.value("logFile").toString();
177 if ( !logFileName.isEmpty() ) {
178 expandEnvVar(logFileName);
179 _logFile = new QFile(logFileName + "_" +
180 currDate.toString("yyMMdd").toAscii().data());
181 _fileDate = currDate;
182 if ( Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked) {
183 _logFile->open(QIODevice::WriteOnly | QIODevice::Append);
184 }
185 else {
186 _logFile->open(QIODevice::WriteOnly);
187 }
188 _logStream = new QTextStream();
189 _logStream->setDevice(_logFile);
190 }
191 }
192
193 if (_logStream) {
194 QByteArray msgLocal = msg;
195 if (msg.indexOf('\n') == 0) {
196 *_logStream << endl;
197 msgLocal = msg.mid(1);
198 }
199 *_logStream << currentDateAndTimeGPS().toString("yy-MM-dd hh:mm:ss ").toAscii().data();
200 *_logStream << msgLocal.data() << endl;
201 _logStream->flush();
202 _logFile->flush();
203 }
204}
205
206//
207////////////////////////////////////////////////////////////////////////////
208t_irc t_bncCore::checkPrintEph(t_eph* eph) {
209 QMutexLocker locker(&_mutex);
210 t_irc ircPut = _ephUser.putNewEph(eph, true);
211 if (eph->checkState() == t_eph::bad) {
212 messagePrivate("WRONG EPHEMERIS\n" + eph->toString(3.0).toAscii());
213 return failure;
214 }
215 printEphHeader();
216 printEph(*eph, (ircPut == success));
217 return success;
218}
219
220// New GPS Ephemeris
221////////////////////////////////////////////////////////////////////////////
222void t_bncCore::slotNewGPSEph(t_ephGPS eph) {
223 if (checkPrintEph(&eph) == success) {
224 emit newGPSEph(eph);
225 }
226}
227
228// New Glonass Ephemeris
229////////////////////////////////////////////////////////////////////////////
230void t_bncCore::slotNewGlonassEph(t_ephGlo eph) {
231 if (checkPrintEph(&eph) == success) {
232 emit newGlonassEph(eph);
233 }
234}
235
236// New Galileo Ephemeris
237////////////////////////////////////////////////////////////////////////////
238void t_bncCore::slotNewGalileoEph(t_ephGal eph) {
239 if (checkPrintEph(&eph) == success) {
240 emit newGalileoEph(eph);
241 }
242}
243
244// New SBAS Ephemeris
245////////////////////////////////////////////////////////////////////////////
246void t_bncCore::slotNewSBASEph(t_ephSBAS eph) {
247 if (checkPrintEph(&eph) == success) {
248 emit newSBASEph(eph);
249 }
250}
251
252// New BDS Ephemeris
253////////////////////////////////////////////////////////////////////////////
254void t_bncCore::slotNewBDSEph(t_ephBDS eph) {
255 if (checkPrintEph(&eph) == success) {
256 emit newBDSEph(eph);
257 }
258}
259
260// Print Header of the output File(s)
261////////////////////////////////////////////////////////////////////////////
262void t_bncCore::printEphHeader() {
263
264 bncSettings settings;
265
266 // Initialization
267 // --------------
268 if (_rinexVers == 0) {
269
270 if ( Qt::CheckState(settings.value("ephV3").toInt()) == Qt::Checked) {
271 _rinexVers = 3;
272 }
273 else {
274 _rinexVers = 2;
275 }
276
277 _ephPath = settings.value("ephPath").toString();
278
279 if ( !_ephPath.isEmpty() ) {
280 if ( _ephPath[_ephPath.length()-1] != QDir::separator() ) {
281 _ephPath += QDir::separator();
282 }
283 expandEnvVar(_ephPath);
284 }
285 }
286
287 // (Re-)Open output File(s)
288 // ------------------------
289 if (!_ephPath.isEmpty()) {
290
291 QDateTime datTim = currentDateAndTimeGPS();
292
293 QString ephFileNameGPS = _ephPath + "BRDC" +
294 QString("%1").arg(datTim.date().dayOfYear(), 3, 10, QChar('0'));
295
296 QString hlpStr = bncRinex::nextEpochStr(datTim,
297 settings.value("ephIntr").toString());
298
299 if (_rinexVers == 3) {
300 ephFileNameGPS += hlpStr + datTim.toString(".yyP");
301 }
302 else {
303 ephFileNameGPS += hlpStr + datTim.toString(".yyN");
304 }
305
306 if (_ephFileNameGPS == ephFileNameGPS) {
307 return;
308 }
309 else {
310 _ephFileNameGPS = ephFileNameGPS;
311 }
312
313 delete _ephStreamGPS;
314 delete _ephFileGPS;
315
316 QFlags<QIODevice::OpenModeFlag> appendFlagGPS;
317 QFlags<QIODevice::OpenModeFlag> appendFlagGlonass;
318
319 if ( Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked &&
320 QFile::exists(ephFileNameGPS) ) {
321 appendFlagGPS = QIODevice::Append;
322 }
323
324 _ephFileGPS = new QFile(ephFileNameGPS);
325 _ephFileGPS->open(QIODevice::WriteOnly | appendFlagGPS);
326 _ephStreamGPS = new QTextStream();
327 _ephStreamGPS->setDevice(_ephFileGPS);
328
329 if (_rinexVers == 3) {
330 _ephFileGlonass = _ephFileGPS;
331 _ephStreamGlonass = _ephStreamGPS;
332 _ephFileGalileo = _ephFileGPS;
333 _ephStreamGalileo = _ephStreamGPS;
334 _ephFileSBAS = _ephFileGPS;
335 _ephStreamSBAS = _ephStreamGPS;
336 }
337 else if (_rinexVers == 2) {
338 QString ephFileNameGlonass = _ephPath + "BRDC" +
339 QString("%1").arg(datTim.date().dayOfYear(), 3, 10, QChar('0')) +
340 hlpStr + datTim.toString(".yyG");
341
342 delete _ephStreamGlonass;
343 delete _ephFileGlonass;
344
345 if ( Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked &&
346 QFile::exists(ephFileNameGlonass) ) {
347 appendFlagGlonass = QIODevice::Append;
348 }
349
350 _ephFileGlonass = new QFile(ephFileNameGlonass);
351 _ephFileGlonass->open(QIODevice::WriteOnly | appendFlagGlonass);
352 _ephStreamGlonass = new QTextStream();
353 _ephStreamGlonass->setDevice(_ephFileGlonass);
354 }
355
356 // Header - RINEX Version 3
357 // ------------------------
358 if (_rinexVers == 3) {
359 if ( ! (appendFlagGPS & QIODevice::Append)) {
360 QString line;
361 line.sprintf(
362 "%9.2f%11sN: GNSS NAV DATA M: Mixed%12sRINEX VERSION / TYPE\n",
363 3.0, "", "");
364 *_ephStreamGPS << line;
365
366 QString hlp = currentDateAndTimeGPS().toString("yyyyMMdd hhmmss UTC").leftJustified(20, ' ', true);
367 *_ephStreamGPS << _pgmName.toAscii().data()
368 << _userName.toAscii().data()
369 << hlp.toAscii().data()
370 << "PGM / RUN BY / DATE" << endl;
371
372 line.sprintf("%60sEND OF HEADER\n", "");
373 *_ephStreamGPS << line;
374
375 _ephStreamGPS->flush();
376 }
377 }
378
379 // Headers - RINEX Version 2
380 // -------------------------
381 else if (_rinexVers == 2) {
382 if (! (appendFlagGPS & QIODevice::Append)) {
383 QString line;
384 line.sprintf("%9.2f%11sN: GPS NAV DATA%25sRINEX VERSION / TYPE\n",
385 t_rnxNavFile::defaultRnxNavVersion2, "", "");
386 *_ephStreamGPS << line;
387
388 QString hlp = currentDateAndTimeGPS().date().toString("dd-MMM-yyyy").leftJustified(20, ' ', true);
389 *_ephStreamGPS << _pgmName.toAscii().data()
390 << _userName.toAscii().data()
391 << hlp.toAscii().data()
392 << "PGM / RUN BY / DATE" << endl;
393
394 line.sprintf("%60sEND OF HEADER\n", "");
395 *_ephStreamGPS << line;
396
397 _ephStreamGPS->flush();
398 }
399 if (! (appendFlagGlonass & QIODevice::Append)) {
400 QString line;
401 line.sprintf("%9.2f%11sG: GLONASS NAV DATA%21sRINEX VERSION / TYPE\n",
402 t_rnxNavFile::defaultRnxNavVersion2, "", "");
403 *_ephStreamGlonass << line;
404
405 QString hlp = currentDateAndTimeGPS().date().toString("dd-MMM-yyyy").leftJustified(20, ' ', true);
406 *_ephStreamGlonass << _pgmName.toAscii().data()
407 << _userName.toAscii().data()
408 << hlp.toAscii().data()
409 << "PGM / RUN BY / DATE" << endl;
410
411 line.sprintf("%60sEND OF HEADER\n", "");
412 *_ephStreamGlonass << line;
413
414 _ephStreamGlonass->flush();
415 }
416 }
417 }
418}
419
420// Print One Ephemeris
421////////////////////////////////////////////////////////////////////////////
422void t_bncCore::printEph(const t_eph& eph, bool printFile) {
423
424 QString strV2 = eph.toString(t_rnxNavFile::defaultRnxNavVersion2);
425 QString strV3 = eph.toString(t_rnxObsHeader::defaultRnxObsVersion3);
426
427 if (_rinexVers == 2 && eph.type() == t_eph::GLONASS) {
428 printOutputEph(printFile, _ephStreamGlonass, strV2, strV3);
429 }
430 else if(_rinexVers == 2 && eph.type() == t_eph::GPS) {
431 printOutputEph(printFile, _ephStreamGPS, strV2, strV3);
432 }
433 else if (_rinexVers == 3) {
434 printOutputEph(printFile, _ephStreamGPS, strV2, strV3);
435 }
436}
437
438// Output
439////////////////////////////////////////////////////////////////////////////
440void t_bncCore::printOutputEph(bool printFile, QTextStream* stream,
441 const QString& strV2, const QString& strV3) {
442
443 // Output into file
444 // ----------------
445 if (printFile && stream) {
446 if (_rinexVers == 2) {
447 *stream << strV2.toAscii();
448 }
449 else {
450 *stream << strV3.toAscii();
451 }
452 stream->flush();
453 }
454
455 // Output into the socket
456 // ----------------------
457 if (_socketsEph) {
458 QMutableListIterator<QTcpSocket*> is(*_socketsEph);
459 while (is.hasNext()) {
460 QTcpSocket* sock = is.next();
461 if (sock->state() == QAbstractSocket::ConnectedState) {
462 if (sock->write(strV3.toAscii()) == -1) {
463 delete sock;
464 is.remove();
465 }
466 }
467 else if (sock->state() != QAbstractSocket::ConnectingState) {
468 delete sock;
469 is.remove();
470 }
471 }
472 }
473}
474
475// Set Port Number
476////////////////////////////////////////////////////////////////////////////
477void t_bncCore::setPortEph(int port) {
478 _portEph = port;
479 if (_portEph != 0) {
480 delete _serverEph;
481 _serverEph = new QTcpServer;
482 if ( !_serverEph->listen(QHostAddress::Any, _portEph) ) {
483 slotMessage("t_bncCore: Cannot listen on ephemeris port", true);
484 }
485 connect(_serverEph, SIGNAL(newConnection()), this, SLOT(slotNewConnectionEph()));
486 delete _socketsEph;
487 _socketsEph = new QList<QTcpSocket*>;
488 }
489}
490
491// Set Port Number
492////////////////////////////////////////////////////////////////////////////
493void t_bncCore::setPortCorr(int port) {
494 _portCorr = port;
495 if (_portCorr != 0) {
496 delete _serverCorr;
497 _serverCorr = new QTcpServer;
498 if ( !_serverCorr->listen(QHostAddress::Any, _portCorr) ) {
499 slotMessage("t_bncCore: Cannot listen on correction port", true);
500 }
501 connect(_serverCorr, SIGNAL(newConnection()), this, SLOT(slotNewConnectionCorr()));
502 delete _socketsCorr;
503 _socketsCorr = new QList<QTcpSocket*>;
504 }
505}
506
507// New Connection
508////////////////////////////////////////////////////////////////////////////
509void t_bncCore::slotNewConnectionEph() {
510 _socketsEph->push_back( _serverEph->nextPendingConnection() );
511}
512
513// New Connection
514////////////////////////////////////////////////////////////////////////////
515void t_bncCore::slotNewConnectionCorr() {
516 _socketsCorr->push_back( _serverCorr->nextPendingConnection() );
517}
518
519//
520////////////////////////////////////////////////////////////////////////////
521void t_bncCore::slotQuit() {
522 delete _caster; _caster = 0;
523 qApp->quit();
524}
525
526//
527////////////////////////////////////////////////////////////////////////////
528void t_bncCore::slotNewOrbCorrections(QList<t_orbCorr> orbCorrections) {
529 QMutexLocker locker(&_mutex);
530 emit newOrbCorrections(orbCorrections);
531 if (_socketsCorr) {
532 ostringstream out;
533 t_orbCorr::writeEpoch(&out, orbCorrections);
534 QMutableListIterator<QTcpSocket*> is(*_socketsCorr);
535 while (is.hasNext()) {
536 QTcpSocket* sock = is.next();
537 if (sock->state() == QAbstractSocket::ConnectedState) {
538 if (sock->write(out.str().c_str()) == -1) {
539 delete sock;
540 is.remove();
541 }
542 }
543 else if (sock->state() != QAbstractSocket::ConnectingState) {
544 delete sock;
545 is.remove();
546 }
547 }
548 }
549}
550
551//
552////////////////////////////////////////////////////////////////////////////
553void t_bncCore::slotNewClkCorrections(QList<t_clkCorr> clkCorrections) {
554 QMutexLocker locker(&_mutex);
555 emit newClkCorrections(clkCorrections);
556 if (_socketsCorr) {
557 ostringstream out;
558 t_clkCorr::writeEpoch(&out, clkCorrections);
559 QMutableListIterator<QTcpSocket*> is(*_socketsCorr);
560 while (is.hasNext()) {
561 QTcpSocket* sock = is.next();
562 if (sock->state() == QAbstractSocket::ConnectedState) {
563 if (sock->write(out.str().c_str()) == -1) {
564 delete sock;
565 is.remove();
566 }
567 }
568 else if (sock->state() != QAbstractSocket::ConnectingState) {
569 delete sock;
570 is.remove();
571 }
572 }
573 }
574}
575
576//
577////////////////////////////////////////////////////////////////////////////
578void t_bncCore::slotNewCodeBiases(QList<t_satCodeBias> codeBiases) {
579 QMutexLocker locker(&_mutex);
580 emit newCodeBiases(codeBiases);
581 if (_socketsCorr) {
582 ostringstream out;
583 t_satCodeBias::writeEpoch(&out, codeBiases);
584 QMutableListIterator<QTcpSocket*> is(*_socketsCorr);
585 while (is.hasNext()) {
586 QTcpSocket* sock = is.next();
587 if (sock->state() == QAbstractSocket::ConnectedState) {
588 if (sock->write(out.str().c_str()) == -1) {
589 delete sock;
590 is.remove();
591 }
592 }
593 else if (sock->state() != QAbstractSocket::ConnectingState) {
594 delete sock;
595 is.remove();
596 }
597 }
598 }
599}
600
601//
602////////////////////////////////////////////////////////////////////////////
603void t_bncCore::slotNewPhaseBiases(QList<t_satPhaseBias> phaseBiases) {
604 QMutexLocker locker(&_mutex);
605 emit newPhaseBiases(phaseBiases);
606 if (_socketsCorr) {
607 ostringstream out;
608 t_satPhaseBias::writeEpoch(&out, phaseBiases);
609 QMutableListIterator<QTcpSocket*> is(*_socketsCorr);
610 while (is.hasNext()) {
611 QTcpSocket* sock = is.next();
612 if (sock->state() == QAbstractSocket::ConnectedState) {
613 if (sock->write(out.str().c_str()) == -1) {
614 delete sock;
615 is.remove();
616 }
617 }
618 else if (sock->state() != QAbstractSocket::ConnectingState) {
619 delete sock;
620 is.remove();
621 }
622 }
623 }
624}
625
626//
627////////////////////////////////////////////////////////////////////////////
628void t_bncCore::slotNewTec(t_vTec vTec) {
629 QMutexLocker locker(&_mutex);
630 emit newTec(vTec);
631 if (_socketsCorr) {
632 ostringstream out;
633 t_vTec::write(&out, vTec);
634 QMutableListIterator<QTcpSocket*> is(*_socketsCorr);
635 while (is.hasNext()) {
636 QTcpSocket* sock = is.next();
637 if (sock->state() == QAbstractSocket::ConnectedState) {
638 if (sock->write(out.str().c_str()) == -1) {
639 delete sock;
640 is.remove();
641 }
642 }
643 else if (sock->state() != QAbstractSocket::ConnectingState) {
644 delete sock;
645 is.remove();
646 }
647 }
648 }
649}
650
651//
652////////////////////////////////////////////////////////////////////////////
653void t_bncCore::setConfFileName(const QString& confFileName) {
654 if (confFileName.isEmpty()) {
655 _confFileName = QDir::homePath() + QDir::separator()
656 + ".config" + QDir::separator()
657 + qApp->organizationName() + QDir::separator()
658 + qApp->applicationName() + ".bnc";
659 }
660 else {
661 _confFileName = confFileName;
662 }
663}
664
665// Raw Output
666////////////////////////////////////////////////////////////////////////////
667void t_bncCore::writeRawData(const QByteArray& data, const QByteArray& staID,
668 const QByteArray& format) {
669
670 QMutexLocker locker(&_mutex);
671
672 if (!_rawFile) {
673 bncSettings settings;
674 QByteArray fileName = settings.value("rawOutFile").toByteArray();
675 if (!fileName.isEmpty()) {
676 _rawFile = new bncRawFile(fileName, staID, bncRawFile::output);
677 }
678 }
679
680 if (_rawFile) {
681 _rawFile->writeRawData(data, staID, format);
682 }
683}
684
685//
686////////////////////////////////////////////////////////////////////////////
687void t_bncCore::initCombination() {
688#ifdef USE_COMBINATION
689 _bncComb = new bncComb();
690 if (_bncComb->nStreams() < 1) {
691 delete _bncComb;
692 _bncComb = 0;
693 }
694#endif
695}
696
697//
698////////////////////////////////////////////////////////////////////////////
699void t_bncCore::stopCombination() {
700#ifdef USE_COMBINATION
701 delete _bncComb;
702 _bncComb = 0;
703#endif
704}
705
706//
707////////////////////////////////////////////////////////////////////////////
708bool t_bncCore::dateAndTimeGPSSet() const {
709 QMutexLocker locker(&_mutexDateAndTimeGPS);
710 if (_dateAndTimeGPS) {
711 return true;
712 }
713 else {
714 return false;
715 }
716}
717
718//
719////////////////////////////////////////////////////////////////////////////
720QDateTime t_bncCore::dateAndTimeGPS() const {
721 QMutexLocker locker(&_mutexDateAndTimeGPS);
722 if (_dateAndTimeGPS) {
723 return *_dateAndTimeGPS;
724 }
725 else {
726 return QDateTime();
727 }
728}
729
730//
731////////////////////////////////////////////////////////////////////////////
732void t_bncCore::setDateAndTimeGPS(QDateTime dateTime) {
733 QMutexLocker locker(&_mutexDateAndTimeGPS);
734 delete _dateAndTimeGPS;
735 _dateAndTimeGPS = new QDateTime(dateTime);
736}
737
738//
739////////////////////////////////////////////////////////////////////////////
740void t_bncCore::startPPP() {
741 _pppMain->start();
742}
743
744//
745////////////////////////////////////////////////////////////////////////////
746void t_bncCore::stopPPP() {
747 _pppMain->stop();
748 emit stopRinexPPP();
749}
750
Note: See TracBrowser for help on using the repository browser.