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: bncPPPthread
|
---|
30 | *
|
---|
31 | * Purpose: Precise Point Positioning
|
---|
32 | *
|
---|
33 | * Author: L. Mervart
|
---|
34 | *
|
---|
35 | * Created: 21-Nov-2009
|
---|
36 | *
|
---|
37 | * Changes:
|
---|
38 | *
|
---|
39 | * -----------------------------------------------------------------------*/
|
---|
40 |
|
---|
41 | #include <iomanip>
|
---|
42 |
|
---|
43 | #include "bncpppthread.h"
|
---|
44 |
|
---|
45 | using namespace std;
|
---|
46 |
|
---|
47 | // Constructor
|
---|
48 | ////////////////////////////////////////////////////////////////////////////
|
---|
49 | bncPPPthread::bncPPPthread(QByteArray staID) {
|
---|
50 | _staID = staID;
|
---|
51 | _isToBeDeleted = false;
|
---|
52 | cout << "PPP Client " << _staID.data() << " constructor\n";
|
---|
53 | }
|
---|
54 |
|
---|
55 | // Destructor
|
---|
56 | ////////////////////////////////////////////////////////////////////////////
|
---|
57 | bncPPPthread::~bncPPPthread() {
|
---|
58 | if (isRunning()) {
|
---|
59 | wait();
|
---|
60 | }
|
---|
61 | cout << "PPP Client " << _staID.data() << " destructor\n";
|
---|
62 | }
|
---|
63 |
|
---|
64 | //
|
---|
65 | ////////////////////////////////////////////////////////////////////////////
|
---|
66 | void bncPPPthread::terminate() {
|
---|
67 | _isToBeDeleted = true;
|
---|
68 | if (!isRunning()) {
|
---|
69 | delete this;
|
---|
70 | }
|
---|
71 | }
|
---|
72 |
|
---|
73 | // Run
|
---|
74 | ////////////////////////////////////////////////////////////////////////////
|
---|
75 | void bncPPPthread::run() {
|
---|
76 | while (true) {
|
---|
77 | try {
|
---|
78 | if (_isToBeDeleted) {
|
---|
79 | QThread::exit(0);
|
---|
80 | this->deleteLater();
|
---|
81 | return;
|
---|
82 | }
|
---|
83 |
|
---|
84 | }
|
---|
85 | catch (...) {
|
---|
86 | emit(newMessage(_staID + "bncPPPthread exception", true));
|
---|
87 | _isToBeDeleted = true;
|
---|
88 | }
|
---|
89 | }
|
---|
90 | }
|
---|
91 |
|
---|
92 | //
|
---|
93 | ////////////////////////////////////////////////////////////////////////////
|
---|
94 | void bncPPPthread::slotNewEpochData(QList<p_obs> obsList) {
|
---|
95 | QMutexLocker locker(&_mutex);
|
---|
96 | cout << "PPP Client: new observations " << obsList.size() << endl;
|
---|
97 | }
|
---|
98 |
|
---|
99 | //
|
---|
100 | ////////////////////////////////////////////////////////////////////////////
|
---|
101 | void bncPPPthread::slotNewEphGPS(gpsephemeris gpseph) {
|
---|
102 | QMutexLocker locker(&_mutex);
|
---|
103 | cout << "PPP Client: new ephemeris " << gpseph.satellite << endl;
|
---|
104 | }
|
---|
105 |
|
---|
106 | //
|
---|
107 | ////////////////////////////////////////////////////////////////////////////
|
---|
108 | void bncPPPthread::slotNewCorrections(QList<QString> corrList) {
|
---|
109 | QMutexLocker locker(&_mutex);
|
---|
110 | cout << "PPP Client: new corrections " << corrList.size() << endl;
|
---|
111 | }
|
---|