1 |
|
---|
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 | *
|
---|
30 | * Class: t_pppThread
|
---|
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 |
|
---|
43 | #include <iostream>
|
---|
44 | #include <iomanip>
|
---|
45 | #include <string.h>
|
---|
46 |
|
---|
47 | #include "pppThread.h"
|
---|
48 | #include "bnccore.h"
|
---|
49 |
|
---|
50 | using namespace BNC;
|
---|
51 | using namespace std;
|
---|
52 |
|
---|
53 | // Constructor
|
---|
54 | ////////////////////////////////////////////////////////////////////////////
|
---|
55 | t_pppThread::t_pppThread(const t_options* opt) : QThread(0) {
|
---|
56 | _opt = *opt;
|
---|
57 | }
|
---|
58 |
|
---|
59 | // Destructor
|
---|
60 | ////////////////////////////////////////////////////////////////////////////
|
---|
61 | t_pppThread::~t_pppThread() {
|
---|
62 | cout << "~t_pppThread" << endl;
|
---|
63 | }
|
---|
64 |
|
---|
65 | // Run (virtual)
|
---|
66 | ////////////////////////////////////////////////////////////////////////////
|
---|
67 | void t_pppThread::run() {
|
---|
68 |
|
---|
69 | cout << _opt._roverName << " run" << endl;
|
---|
70 |
|
---|
71 | // Connect to BNC Signals
|
---|
72 | // ----------------------
|
---|
73 | if (BNC_CORE->caster()) {
|
---|
74 | connect(BNC_CORE->caster(), SIGNAL(newObs(QByteArray, QList<t_obs>)),
|
---|
75 | this, SLOT(slotNewObs(QByteArray, QList<t_obs>)));
|
---|
76 |
|
---|
77 | connect(BNC_CORE, SIGNAL(newEphGPS(gpsephemeris)),
|
---|
78 | this, SLOT(slotNewEphGPS(gpsephemeris)));
|
---|
79 |
|
---|
80 | connect(BNC_CORE, SIGNAL(newEphGlonass(glonassephemeris)),
|
---|
81 | this, SLOT(slotNewEphGlonass(glonassephemeris)));
|
---|
82 |
|
---|
83 | connect(BNC_CORE, SIGNAL(newEphGalileo(galileoephemeris)),
|
---|
84 | this, SLOT(slotNewEphGalileo(galileoephemeris)));
|
---|
85 |
|
---|
86 | connect(BNC_CORE, SIGNAL(newCorrections(QList<QString>)),
|
---|
87 | this, SLOT(slotNewCorrections(QList<QString>)));
|
---|
88 | }
|
---|
89 |
|
---|
90 | // Start processing loop
|
---|
91 | // ---------------------
|
---|
92 | QThread::exec();
|
---|
93 |
|
---|
94 | cout << _opt._roverName << " exit" << endl;
|
---|
95 | }
|
---|
96 |
|
---|
97 | //
|
---|
98 | ////////////////////////////////////////////////////////////////////////////
|
---|
99 | void t_pppThread::slotNewEphGPS(gpsephemeris gpseph) {
|
---|
100 | QMutexLocker locker(&_mutex);
|
---|
101 | cout << _opt._roverName << " slotNewEphGPS" << endl;
|
---|
102 | }
|
---|
103 |
|
---|
104 | //
|
---|
105 | ////////////////////////////////////////////////////////////////////////////
|
---|
106 | void t_pppThread::slotNewEphGlonass(glonassephemeris gloeph) {
|
---|
107 | QMutexLocker locker(&_mutex);
|
---|
108 | cout << _opt._roverName << " slotNewEphGlonass" << endl;
|
---|
109 | }
|
---|
110 |
|
---|
111 | //
|
---|
112 | ////////////////////////////////////////////////////////////////////////////
|
---|
113 | void t_pppThread::slotNewEphGalileo(galileoephemeris /* galeph */) {
|
---|
114 | QMutexLocker locker(&_mutex);
|
---|
115 | cout << _opt._roverName << " slotNewEphGalileo" << endl;
|
---|
116 | }
|
---|
117 |
|
---|
118 | //
|
---|
119 | ////////////////////////////////////////////////////////////////////////////
|
---|
120 | void t_pppThread::slotNewCorrections(QList<QString> corrList) {
|
---|
121 | QMutexLocker locker(&_mutex);
|
---|
122 | cout << _opt._roverName << " slotNewCorrections" << endl;
|
---|
123 | }
|
---|
124 | //
|
---|
125 | ////////////////////////////////////////////////////////////////////////////
|
---|
126 | void t_pppThread::slotNewObs(QByteArray staID, QList<t_obs> obsList) {
|
---|
127 | QMutexLocker locker(&_mutex);
|
---|
128 | cout << _opt._roverName << " slotNewObs" << endl;
|
---|
129 | }
|
---|
130 |
|
---|