[4757] | 1 |
|
---|
[5719] | 2 | // Part of BNC, a utility for retrieving decoding and
|
---|
| 3 | // converting GNSS data streams from NTRIP broadcasters.
|
---|
| 4 | //
|
---|
| 5 | // Copyright (C) 2007
|
---|
| 6 | // German Federal Agency for Cartography and Geodesy (BKG)
|
---|
| 7 | // http://www.bkg.bund.de
|
---|
| 8 | // Czech Technical University Prague, Department of Geodesy
|
---|
| 9 | // http://www.fsv.cvut.cz
|
---|
| 10 | //
|
---|
| 11 | // Email: euref-ip@bkg.bund.de
|
---|
| 12 | //
|
---|
| 13 | // This program is free software; you can redistribute it and/or
|
---|
| 14 | // modify it under the terms of the GNU General Public License
|
---|
| 15 | // as published by the Free Software Foundation, version 2.
|
---|
| 16 | //
|
---|
| 17 | // This program is distributed in the hope that it will be useful,
|
---|
| 18 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 19 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 20 | // GNU General Public License for more details.
|
---|
| 21 | //
|
---|
| 22 | // You should have received a copy of the GNU General Public License
|
---|
| 23 | // along with this program; if not, write to the Free Software
|
---|
| 24 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
---|
| 25 |
|
---|
| 26 | /* -------------------------------------------------------------------------
|
---|
| 27 | * BKG NTRIP Client
|
---|
| 28 | * -------------------------------------------------------------------------
|
---|
| 29 | *
|
---|
[5731] | 30 | * Class: t_pppThread, t_pppRun
|
---|
[5719] | 31 | *
|
---|
| 32 | * Purpose: Single PPP Client (running in its own thread)
|
---|
| 33 | *
|
---|
| 34 | * Author: L. Mervart
|
---|
| 35 | *
|
---|
| 36 | * Created: 29-Jul-2014
|
---|
| 37 | *
|
---|
| 38 | * Changes:
|
---|
| 39 | *
|
---|
| 40 | * -----------------------------------------------------------------------*/
|
---|
| 41 |
|
---|
| 42 |
|
---|
[4757] | 43 | #include <iostream>
|
---|
[4775] | 44 | #include <iomanip>
|
---|
[4757] | 45 | #include <string.h>
|
---|
| 46 |
|
---|
[5680] | 47 | #include "pppThread.h"
|
---|
[5068] | 48 | #include "bnccore.h"
|
---|
[4757] | 49 |
|
---|
[5719] | 50 | using namespace BNC;
|
---|
[4757] | 51 | using namespace std;
|
---|
| 52 |
|
---|
| 53 | // Constructor
|
---|
| 54 | ////////////////////////////////////////////////////////////////////////////
|
---|
[5721] | 55 | t_pppThread::t_pppThread(const t_options* opt) : QThread(0) {
|
---|
[5736] | 56 | _opt = opt;
|
---|
[4763] | 57 | }
|
---|
| 58 |
|
---|
| 59 | // Destructor
|
---|
| 60 | ////////////////////////////////////////////////////////////////////////////
|
---|
[5680] | 61 | t_pppThread::~t_pppThread() {
|
---|
[5731] | 62 | delete _pppRun;
|
---|
[5730] | 63 | cout << "~t_pppThread" << endl;
|
---|
[4763] | 64 | }
|
---|
| 65 |
|
---|
| 66 | // Run (virtual)
|
---|
| 67 | ////////////////////////////////////////////////////////////////////////////
|
---|
[5680] | 68 | void t_pppThread::run() {
|
---|
[5681] | 69 |
|
---|
[5736] | 70 | cout << _opt->_roverName << " run" << endl;
|
---|
[5729] | 71 |
|
---|
[5731] | 72 | _pppRun = new t_pppRun(_opt);
|
---|
| 73 | QThread::exec();
|
---|
| 74 |
|
---|
[5736] | 75 | cout << _opt->_roverName << " exit" << endl;
|
---|
[5731] | 76 | }
|
---|
| 77 |
|
---|
| 78 | // Constructor
|
---|
| 79 | ////////////////////////////////////////////////////////////////////////////
|
---|
[5736] | 80 | t_pppRun::t_pppRun(const t_options* opt) {
|
---|
[5731] | 81 | _opt = opt;
|
---|
| 82 |
|
---|
[5722] | 83 | if (BNC_CORE->caster()) {
|
---|
[5729] | 84 | connect(BNC_CORE->caster(), SIGNAL(newObs(QByteArray, QList<t_obs>)),
|
---|
| 85 | this, SLOT(slotNewObs(QByteArray, QList<t_obs>)));
|
---|
[4757] | 86 |
|
---|
[5722] | 87 | connect(BNC_CORE, SIGNAL(newEphGPS(gpsephemeris)),
|
---|
| 88 | this, SLOT(slotNewEphGPS(gpsephemeris)));
|
---|
| 89 |
|
---|
| 90 | connect(BNC_CORE, SIGNAL(newEphGlonass(glonassephemeris)),
|
---|
| 91 | this, SLOT(slotNewEphGlonass(glonassephemeris)));
|
---|
| 92 |
|
---|
| 93 | connect(BNC_CORE, SIGNAL(newEphGalileo(galileoephemeris)),
|
---|
| 94 | this, SLOT(slotNewEphGalileo(galileoephemeris)));
|
---|
[4757] | 95 |
|
---|
[5732] | 96 | connect(BNC_CORE, SIGNAL(newCorrections(QStringList)),
|
---|
| 97 | this, SLOT(slotNewCorrections(QStringList)));
|
---|
[5722] | 98 | }
|
---|
[5731] | 99 | }
|
---|
[5729] | 100 |
|
---|
[5731] | 101 | // Destructor
|
---|
| 102 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 103 | t_pppRun::~t_pppRun() {
|
---|
| 104 | cout << "~t_pppRun" << endl;
|
---|
[4757] | 105 | }
|
---|
| 106 |
|
---|
| 107 | //
|
---|
| 108 | ////////////////////////////////////////////////////////////////////////////
|
---|
[5731] | 109 | void t_pppRun::slotNewEphGPS(gpsephemeris gpseph) {
|
---|
[4757] | 110 | QMutexLocker locker(&_mutex);
|
---|
[5736] | 111 | cout << _opt->_roverName << " slotNewEphGPS" << endl;
|
---|
[4757] | 112 | }
|
---|
| 113 |
|
---|
| 114 | //
|
---|
| 115 | ////////////////////////////////////////////////////////////////////////////
|
---|
[5731] | 116 | void t_pppRun::slotNewEphGlonass(glonassephemeris gloeph) {
|
---|
[4757] | 117 | QMutexLocker locker(&_mutex);
|
---|
[5736] | 118 | cout << _opt->_roverName << " slotNewEphGlonass" << endl;
|
---|
[4757] | 119 | }
|
---|
| 120 |
|
---|
| 121 | //
|
---|
| 122 | ////////////////////////////////////////////////////////////////////////////
|
---|
[5731] | 123 | void t_pppRun::slotNewEphGalileo(galileoephemeris /* galeph */) {
|
---|
[5681] | 124 | QMutexLocker locker(&_mutex);
|
---|
[5736] | 125 | cout << _opt->_roverName << " slotNewEphGalileo" << endl;
|
---|
[4757] | 126 | }
|
---|
| 127 |
|
---|
| 128 | //
|
---|
| 129 | ////////////////////////////////////////////////////////////////////////////
|
---|
[5732] | 130 | void t_pppRun::slotNewCorrections(QStringList corrList) {
|
---|
[4757] | 131 | QMutexLocker locker(&_mutex);
|
---|
[5736] | 132 | cout << _opt->_roverName << " slotNewCorrections" << endl;
|
---|
[4757] | 133 | }
|
---|
| 134 | //
|
---|
| 135 | ////////////////////////////////////////////////////////////////////////////
|
---|
[5731] | 136 | void t_pppRun::slotNewObs(QByteArray staID, QList<t_obs> obsList) {
|
---|
[4757] | 137 | QMutexLocker locker(&_mutex);
|
---|
[5736] | 138 | cout << _opt->_roverName << " slotNewObs" << endl;
|
---|
[5589] | 139 | }
|
---|
[5525] | 140 |
|
---|