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

Last change on this file since 6519 was 6519, checked in by mervart, 9 years ago
File size: 21.2 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_ephCompass> ("t_ephCompass");
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// New GPS Ephemeris
207////////////////////////////////////////////////////////////////////////////
208void t_bncCore::slotNewGPSEph(t_ephGPS eph) {
209 QMutexLocker locker(&_mutex);
210
211 t_irc irc = _ephUser.putNewEph(&eph, true);
212 if (eph.checkState() == t_eph::bad) {
213 return;
214 }
215
216 emit newGPSEph(eph);
217
218 printEphHeader();
219 printEph(eph, (irc == success));
220}
221
222// New Glonass Ephemeris
223////////////////////////////////////////////////////////////////////////////
224void t_bncCore::slotNewGlonassEph(t_ephGlo eph) {
225 QMutexLocker locker(&_mutex);
226
227 t_irc irc = _ephUser.putNewEph(&eph, true);
228 if (eph.checkState() == t_eph::bad) {
229 return;
230 }
231
232 emit newGlonassEph(eph);
233
234 printEphHeader();
235 printEph(eph, (irc == success));
236}
237
238// New Galileo Ephemeris
239////////////////////////////////////////////////////////////////////////////
240void t_bncCore::slotNewGalileoEph(t_ephGal eph) {
241 QMutexLocker locker(&_mutex);
242
243 t_irc irc = _ephUser.putNewEph(&eph, true);
244 if (eph.checkState() == t_eph::bad) {
245 return;
246 }
247
248 emit newGalileoEph(eph);
249
250 printEphHeader();
251 printEph(eph, (irc == success));
252}
253
254// New SBAS Ephemeris
255////////////////////////////////////////////////////////////////////////////
256void t_bncCore::slotNewSBASEph(t_ephSBAS eph) {
257 QMutexLocker locker(&_mutex);
258
259 t_irc irc = _ephUser.putNewEph(&eph, true);
260 if (eph.checkState() == t_eph::bad) {
261 return;
262 }
263
264 emit newSBASEph(eph);
265
266 printEphHeader();
267 printEph(eph, (irc == success));
268}
269
270
271// Print Header of the output File(s)
272////////////////////////////////////////////////////////////////////////////
273void t_bncCore::printEphHeader() {
274
275 bncSettings settings;
276
277 // Initialization
278 // --------------
279 if (_rinexVers == 0) {
280
281 if ( Qt::CheckState(settings.value("ephV3").toInt()) == Qt::Checked) {
282 _rinexVers = 3;
283 }
284 else {
285 _rinexVers = 2;
286 }
287
288 _ephPath = settings.value("ephPath").toString();
289
290 if ( !_ephPath.isEmpty() ) {
291 if ( _ephPath[_ephPath.length()-1] != QDir::separator() ) {
292 _ephPath += QDir::separator();
293 }
294 expandEnvVar(_ephPath);
295 }
296 }
297
298 // (Re-)Open output File(s)
299 // ------------------------
300 if (!_ephPath.isEmpty()) {
301
302 QDateTime datTim = currentDateAndTimeGPS();
303
304 QString ephFileNameGPS = _ephPath + "BRDC" +
305 QString("%1").arg(datTim.date().dayOfYear(), 3, 10, QChar('0'));
306
307 QString hlpStr = bncRinex::nextEpochStr(datTim,
308 settings.value("ephIntr").toString());
309
310 if (_rinexVers == 3) {
311 ephFileNameGPS += hlpStr + datTim.toString(".yyP");
312 }
313 else {
314 ephFileNameGPS += hlpStr + datTim.toString(".yyN");
315 }
316
317 if (_ephFileNameGPS == ephFileNameGPS) {
318 return;
319 }
320 else {
321 _ephFileNameGPS = ephFileNameGPS;
322 }
323
324 delete _ephStreamGPS;
325 delete _ephFileGPS;
326
327 QFlags<QIODevice::OpenModeFlag> appendFlagGPS;
328 QFlags<QIODevice::OpenModeFlag> appendFlagGlonass;
329
330 if ( Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked &&
331 QFile::exists(ephFileNameGPS) ) {
332 appendFlagGPS = QIODevice::Append;
333 }
334
335 _ephFileGPS = new QFile(ephFileNameGPS);
336 _ephFileGPS->open(QIODevice::WriteOnly | appendFlagGPS);
337 _ephStreamGPS = new QTextStream();
338 _ephStreamGPS->setDevice(_ephFileGPS);
339
340 if (_rinexVers == 3) {
341 _ephFileGlonass = _ephFileGPS;
342 _ephStreamGlonass = _ephStreamGPS;
343 _ephFileGalileo = _ephFileGPS;
344 _ephStreamGalileo = _ephStreamGPS;
345 _ephFileSBAS = _ephFileGPS;
346 _ephStreamSBAS = _ephStreamGPS;
347 }
348 else if (_rinexVers == 2) {
349 QString ephFileNameGlonass = _ephPath + "BRDC" +
350 QString("%1").arg(datTim.date().dayOfYear(), 3, 10, QChar('0')) +
351 hlpStr + datTim.toString(".yyG");
352
353 delete _ephStreamGlonass;
354 delete _ephFileGlonass;
355
356 if ( Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked &&
357 QFile::exists(ephFileNameGlonass) ) {
358 appendFlagGlonass = QIODevice::Append;
359 }
360
361 _ephFileGlonass = new QFile(ephFileNameGlonass);
362 _ephFileGlonass->open(QIODevice::WriteOnly | appendFlagGlonass);
363 _ephStreamGlonass = new QTextStream();
364 _ephStreamGlonass->setDevice(_ephFileGlonass);
365 }
366
367 // Header - RINEX Version 3
368 // ------------------------
369 if (_rinexVers == 3) {
370 if ( ! (appendFlagGPS & QIODevice::Append)) {
371 QString line;
372 line.sprintf(
373 "%9.2f%11sN: GNSS NAV DATA M: Mixed%12sRINEX VERSION / TYPE\n",
374 3.0, "", "");
375 *_ephStreamGPS << line;
376
377 QString hlp = currentDateAndTimeGPS().toString("yyyyMMdd hhmmss UTC").leftJustified(20, ' ', true);
378 *_ephStreamGPS << _pgmName.toAscii().data()
379 << _userName.toAscii().data()
380 << hlp.toAscii().data()
381 << "PGM / RUN BY / DATE" << endl;
382
383 line.sprintf("%60sEND OF HEADER\n", "");
384 *_ephStreamGPS << line;
385
386 _ephStreamGPS->flush();
387 }
388 }
389
390 // Headers - RINEX Version 2
391 // -------------------------
392 else if (_rinexVers == 2) {
393 if (! (appendFlagGPS & QIODevice::Append)) {
394 QString line;
395 line.sprintf("%9.2f%11sN: GPS NAV DATA%25sRINEX VERSION / TYPE\n",
396 t_rnxNavFile::defaultRnxNavVersion2, "", "");
397 *_ephStreamGPS << line;
398
399 QString hlp = currentDateAndTimeGPS().date().toString("dd-MMM-yyyy").leftJustified(20, ' ', true);
400 *_ephStreamGPS << _pgmName.toAscii().data()
401 << _userName.toAscii().data()
402 << hlp.toAscii().data()
403 << "PGM / RUN BY / DATE" << endl;
404
405 line.sprintf("%60sEND OF HEADER\n", "");
406 *_ephStreamGPS << line;
407
408 _ephStreamGPS->flush();
409 }
410 if (! (appendFlagGlonass & QIODevice::Append)) {
411 QString line;
412 line.sprintf("%9.2f%11sG: GLONASS NAV DATA%21sRINEX VERSION / TYPE\n",
413 t_rnxNavFile::defaultRnxNavVersion2, "", "");
414 *_ephStreamGlonass << line;
415
416 QString hlp = currentDateAndTimeGPS().date().toString("dd-MMM-yyyy").leftJustified(20, ' ', true);
417 *_ephStreamGlonass << _pgmName.toAscii().data()
418 << _userName.toAscii().data()
419 << hlp.toAscii().data()
420 << "PGM / RUN BY / DATE" << endl;
421
422 line.sprintf("%60sEND OF HEADER\n", "");
423 *_ephStreamGlonass << line;
424
425 _ephStreamGlonass->flush();
426 }
427 }
428 }
429}
430
431// Print One Ephemeris
432////////////////////////////////////////////////////////////////////////////
433void t_bncCore::printEph(const t_eph& eph, bool printFile) {
434
435 QString strV2 = eph.toString(t_rnxNavFile::defaultRnxNavVersion2);
436 QString strV3 = eph.toString(t_rnxObsHeader::defaultRnxObsVersion3);
437
438 printOutputEph(printFile, _ephStreamGlonass, strV2, strV3);
439}
440
441// Output
442////////////////////////////////////////////////////////////////////////////
443void t_bncCore::printOutputEph(bool printFile, QTextStream* stream,
444 const QString& strV2, const QString& strV3) {
445
446 // Output into file
447 // ----------------
448 if (printFile && stream) {
449 if (_rinexVers == 2) {
450 *stream << strV2.toAscii();
451 }
452 else {
453 *stream << strV3.toAscii();
454 }
455 stream->flush();
456 }
457
458 // Output into the socket
459 // ----------------------
460 if (_socketsEph) {
461 QMutableListIterator<QTcpSocket*> is(*_socketsEph);
462 while (is.hasNext()) {
463 QTcpSocket* sock = is.next();
464 if (sock->state() == QAbstractSocket::ConnectedState) {
465 if (sock->write(strV3.toAscii()) == -1) {
466 delete sock;
467 is.remove();
468 }
469 }
470 else if (sock->state() != QAbstractSocket::ConnectingState) {
471 delete sock;
472 is.remove();
473 }
474 }
475 }
476}
477
478// Set Port Number
479////////////////////////////////////////////////////////////////////////////
480void t_bncCore::setPortEph(int port) {
481 _portEph = port;
482 if (_portEph != 0) {
483 delete _serverEph;
484 _serverEph = new QTcpServer;
485 if ( !_serverEph->listen(QHostAddress::Any, _portEph) ) {
486 slotMessage("t_bncCore: Cannot listen on ephemeris port", true);
487 }
488 connect(_serverEph, SIGNAL(newConnection()), this, SLOT(slotNewConnectionEph()));
489 delete _socketsEph;
490 _socketsEph = new QList<QTcpSocket*>;
491 }
492}
493
494// Set Port Number
495////////////////////////////////////////////////////////////////////////////
496void t_bncCore::setPortCorr(int port) {
497 _portCorr = port;
498 if (_portCorr != 0) {
499 delete _serverCorr;
500 _serverCorr = new QTcpServer;
501 if ( !_serverCorr->listen(QHostAddress::Any, _portCorr) ) {
502 slotMessage("t_bncCore: Cannot listen on correction port", true);
503 }
504 connect(_serverCorr, SIGNAL(newConnection()), this, SLOT(slotNewConnectionCorr()));
505 delete _socketsCorr;
506 _socketsCorr = new QList<QTcpSocket*>;
507 }
508}
509
510// New Connection
511////////////////////////////////////////////////////////////////////////////
512void t_bncCore::slotNewConnectionEph() {
513 _socketsEph->push_back( _serverEph->nextPendingConnection() );
514}
515
516// New Connection
517////////////////////////////////////////////////////////////////////////////
518void t_bncCore::slotNewConnectionCorr() {
519 _socketsCorr->push_back( _serverCorr->nextPendingConnection() );
520}
521
522//
523////////////////////////////////////////////////////////////////////////////
524void t_bncCore::slotQuit() {
525 delete _caster; _caster = 0;
526 qApp->quit();
527}
528
529//
530////////////////////////////////////////////////////////////////////////////
531void t_bncCore::slotNewOrbCorrections(QList<t_orbCorr> orbCorrections) {
532 QMutexLocker locker(&_mutex);
533 emit newOrbCorrections(orbCorrections);
534 if (_socketsCorr) {
535 ostringstream out;
536 t_orbCorr::writeEpoch(&out, orbCorrections);
537 QMutableListIterator<QTcpSocket*> is(*_socketsCorr);
538 while (is.hasNext()) {
539 QTcpSocket* sock = is.next();
540 if (sock->state() == QAbstractSocket::ConnectedState) {
541 if (sock->write(out.str().c_str()) == -1) {
542 delete sock;
543 is.remove();
544 }
545 }
546 else if (sock->state() != QAbstractSocket::ConnectingState) {
547 delete sock;
548 is.remove();
549 }
550 }
551 }
552}
553
554//
555////////////////////////////////////////////////////////////////////////////
556void t_bncCore::slotNewClkCorrections(QList<t_clkCorr> clkCorrections) {
557 QMutexLocker locker(&_mutex);
558 emit newClkCorrections(clkCorrections);
559 if (_socketsCorr) {
560 ostringstream out;
561 t_clkCorr::writeEpoch(&out, clkCorrections);
562 QMutableListIterator<QTcpSocket*> is(*_socketsCorr);
563 while (is.hasNext()) {
564 QTcpSocket* sock = is.next();
565 if (sock->state() == QAbstractSocket::ConnectedState) {
566 if (sock->write(out.str().c_str()) == -1) {
567 delete sock;
568 is.remove();
569 }
570 }
571 else if (sock->state() != QAbstractSocket::ConnectingState) {
572 delete sock;
573 is.remove();
574 }
575 }
576 }
577}
578
579//
580////////////////////////////////////////////////////////////////////////////
581void t_bncCore::slotNewCodeBiases(QList<t_satCodeBias> codeBiases) {
582 QMutexLocker locker(&_mutex);
583 emit newCodeBiases(codeBiases);
584 if (_socketsCorr) {
585 ostringstream out;
586 t_satCodeBias::writeEpoch(&out, codeBiases);
587 QMutableListIterator<QTcpSocket*> is(*_socketsCorr);
588 while (is.hasNext()) {
589 QTcpSocket* sock = is.next();
590 if (sock->state() == QAbstractSocket::ConnectedState) {
591 if (sock->write(out.str().c_str()) == -1) {
592 delete sock;
593 is.remove();
594 }
595 }
596 else if (sock->state() != QAbstractSocket::ConnectingState) {
597 delete sock;
598 is.remove();
599 }
600 }
601 }
602}
603
604//
605////////////////////////////////////////////////////////////////////////////
606void t_bncCore::slotNewPhaseBiases(QList<t_satPhaseBias> phaseBiases) {
607 QMutexLocker locker(&_mutex);
608 emit newPhaseBiases(phaseBiases);
609 if (_socketsCorr) {
610 ostringstream out;
611 t_satPhaseBias::writeEpoch(&out, phaseBiases);
612 QMutableListIterator<QTcpSocket*> is(*_socketsCorr);
613 while (is.hasNext()) {
614 QTcpSocket* sock = is.next();
615 if (sock->state() == QAbstractSocket::ConnectedState) {
616 if (sock->write(out.str().c_str()) == -1) {
617 delete sock;
618 is.remove();
619 }
620 }
621 else if (sock->state() != QAbstractSocket::ConnectingState) {
622 delete sock;
623 is.remove();
624 }
625 }
626 }
627}
628
629//
630////////////////////////////////////////////////////////////////////////////
631void t_bncCore::slotNewTec(t_vTec vTec) {
632 QMutexLocker locker(&_mutex);
633 emit newTec(vTec);
634 if (_socketsCorr) {
635 ostringstream out;
636 t_vTec::write(&out, vTec);
637 QMutableListIterator<QTcpSocket*> is(*_socketsCorr);
638 while (is.hasNext()) {
639 QTcpSocket* sock = is.next();
640 if (sock->state() == QAbstractSocket::ConnectedState) {
641 if (sock->write(out.str().c_str()) == -1) {
642 delete sock;
643 is.remove();
644 }
645 }
646 else if (sock->state() != QAbstractSocket::ConnectingState) {
647 delete sock;
648 is.remove();
649 }
650 }
651 }
652}
653
654//
655////////////////////////////////////////////////////////////////////////////
656void t_bncCore::setConfFileName(const QString& confFileName) {
657 if (confFileName.isEmpty()) {
658 _confFileName = QDir::homePath() + QDir::separator()
659 + ".config" + QDir::separator()
660 + qApp->organizationName() + QDir::separator()
661 + qApp->applicationName() + ".bnc";
662 }
663 else {
664 _confFileName = confFileName;
665 }
666}
667
668// Raw Output
669////////////////////////////////////////////////////////////////////////////
670void t_bncCore::writeRawData(const QByteArray& data, const QByteArray& staID,
671 const QByteArray& format) {
672
673 QMutexLocker locker(&_mutex);
674
675 if (!_rawFile) {
676 bncSettings settings;
677 QByteArray fileName = settings.value("rawOutFile").toByteArray();
678 if (!fileName.isEmpty()) {
679 _rawFile = new bncRawFile(fileName, staID, bncRawFile::output);
680 }
681 }
682
683 if (_rawFile) {
684 _rawFile->writeRawData(data, staID, format);
685 }
686}
687
688//
689////////////////////////////////////////////////////////////////////////////
690void t_bncCore::initCombination() {
691#ifdef USE_COMBINATION
692 _bncComb = new bncComb();
693 if (_bncComb->nStreams() < 1) {
694 delete _bncComb;
695 _bncComb = 0;
696 }
697#endif
698}
699
700//
701////////////////////////////////////////////////////////////////////////////
702void t_bncCore::stopCombination() {
703#ifdef USE_COMBINATION
704 delete _bncComb;
705 _bncComb = 0;
706#endif
707}
708
709//
710////////////////////////////////////////////////////////////////////////////
711bool t_bncCore::dateAndTimeGPSSet() const {
712 QMutexLocker locker(&_mutexDateAndTimeGPS);
713 if (_dateAndTimeGPS) {
714 return true;
715 }
716 else {
717 return false;
718 }
719}
720
721//
722////////////////////////////////////////////////////////////////////////////
723QDateTime t_bncCore::dateAndTimeGPS() const {
724 QMutexLocker locker(&_mutexDateAndTimeGPS);
725 if (_dateAndTimeGPS) {
726 return *_dateAndTimeGPS;
727 }
728 else {
729 return QDateTime();
730 }
731}
732
733//
734////////////////////////////////////////////////////////////////////////////
735void t_bncCore::setDateAndTimeGPS(QDateTime dateTime) {
736 QMutexLocker locker(&_mutexDateAndTimeGPS);
737 delete _dateAndTimeGPS;
738 _dateAndTimeGPS = new QDateTime(dateTime);
739}
740
741//
742////////////////////////////////////////////////////////////////////////////
743void t_bncCore::startPPP() {
744 _pppMain->start();
745}
746
747//
748////////////////////////////////////////////////////////////////////////////
749void t_bncCore::stopPPP() {
750 _pppMain->stop();
751 emit stopRinexPPP();
752}
753
Note: See TracBrowser for help on using the repository browser.