[280] | 1 | // Part of BNC, a utility for retrieving decoding and
|
---|
[464] | 2 | // converting GNSS data streams from NTRIP broadcasters.
|
---|
[280] | 3 | //
|
---|
[464] | 4 | // Copyright (C) 2007
|
---|
[280] | 5 | // German Federal Agency for Cartography and Geodesy (BKG)
|
---|
| 6 | // http://www.bkg.bund.de
|
---|
[464] | 7 | // Czech Technical University Prague, Department of Geodesy
|
---|
[280] | 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.
|
---|
[35] | 24 |
|
---|
| 25 | #ifndef BNCGETTHREAD_H
|
---|
| 26 | #define BNCGETTHREAD_H
|
---|
| 27 |
|
---|
| 28 | #include <QThread>
|
---|
| 29 | #include <QtNetwork>
|
---|
[651] | 30 | #include <QDateTime>
|
---|
[1137] | 31 | #include <QFile>
|
---|
[35] | 32 |
|
---|
| 33 | #include "RTCM/GPSDecoder.h"
|
---|
[2492] | 34 | #include "rtcm3torinex.h"
|
---|
[138] | 35 | #include "bncconst.h"
|
---|
[1812] | 36 | #include "bncnetquery.h"
|
---|
[2142] | 37 | #include "bnctime.h"
|
---|
[2519] | 38 | #include "bncrawfile.h"
|
---|
[35] | 39 |
|
---|
[1319] | 40 | class QextSerialPort;
|
---|
[1558] | 41 | class latencyChecker;
|
---|
[2035] | 42 | class bncPPPclient;
|
---|
[3577] | 43 | #ifdef PPP_DLL_INTERFACE
|
---|
| 44 | class t_dllInterface;
|
---|
| 45 | #endif
|
---|
[408] | 46 |
|
---|
[35] | 47 | class bncGetThread : public QThread {
|
---|
| 48 | Q_OBJECT
|
---|
| 49 |
|
---|
| 50 | public:
|
---|
[2519] | 51 | bncGetThread(bncRawFile* rawFile);
|
---|
[278] | 52 | bncGetThread(const QUrl& mountPoint,
|
---|
[366] | 53 | const QByteArray& format,
|
---|
| 54 | const QByteArray& latitude,
|
---|
| 55 | const QByteArray& longitude,
|
---|
[1353] | 56 | const QByteArray& nmea,
|
---|
[3527] | 57 | const QByteArray& ntripVersion);
|
---|
[1138] | 58 |
|
---|
[1812] | 59 | bncNetQuery::queryStatus queryStatus() {
|
---|
| 60 | if (_query) {
|
---|
| 61 | return _query->status();
|
---|
| 62 | }
|
---|
| 63 | else {
|
---|
| 64 | return bncNetQuery::init;
|
---|
| 65 | }
|
---|
| 66 | }
|
---|
| 67 |
|
---|
[1525] | 68 | protected:
|
---|
[35] | 69 | ~bncGetThread();
|
---|
| 70 |
|
---|
[1525] | 71 | public:
|
---|
[1390] | 72 | void terminate();
|
---|
| 73 |
|
---|
[88] | 74 | QByteArray staID() const {return _staID;}
|
---|
[1163] | 75 | QUrl mountPoint() const {return _mountPoint;}
|
---|
| 76 | QByteArray latitude() const {return _latitude;}
|
---|
| 77 | QByteArray longitude() const {return _longitude;}
|
---|
[1423] | 78 | QByteArray ntripVersion() const {return _ntripVersion;}
|
---|
[88] | 79 |
|
---|
[35] | 80 | signals:
|
---|
[628] | 81 | void newBytes(QByteArray staID, double nbyte);
|
---|
[1974] | 82 | void newLatency(QByteArray staID, double clate);
|
---|
[2711] | 83 | void newObs(QByteArray staID, bool firstObs, t_obs obs);
|
---|
[3595] | 84 | void newAntCrd(QByteArray staID, double xx, double yy, double zz,
|
---|
| 85 | double hh, QByteArray antType);
|
---|
[1299] | 86 | void newMessage(QByteArray msg, bool showOnScreen);
|
---|
[2356] | 87 | void newRTCMMessage(QByteArray staID, int msgID);
|
---|
[1556] | 88 | void getThreadFinished(QByteArray staID);
|
---|
[2145] | 89 | void newPosition(bncTime time, double x, double y, double z);
|
---|
[2182] | 90 | void newNMEAstr(QByteArray str);
|
---|
[35] | 91 |
|
---|
[2528] | 92 | public:
|
---|
[35] | 93 | virtual void run();
|
---|
[138] | 94 |
|
---|
[1607] | 95 | private slots:
|
---|
| 96 | void slotSerialReadyRead();
|
---|
| 97 |
|
---|
[35] | 98 | private:
|
---|
[1710] | 99 | enum t_serialNMEA {NO_NMEA, MANUAL_NMEA, AUTO_NMEA};
|
---|
[3523] | 100 | t_irc initDecoder();
|
---|
| 101 | GPSDecoder* decoder();
|
---|
[1710] | 102 |
|
---|
[1140] | 103 | void initialize();
|
---|
[1555] | 104 | t_irc tryReconnect();
|
---|
| 105 | void scanRTCM();
|
---|
| 106 |
|
---|
[3560] | 107 | QMap<QString, GPSDecoder*> _decodersRaw;
|
---|
| 108 | GPSDecoder* _decoder;
|
---|
[3523] | 109 | bncNetQuery* _query;
|
---|
| 110 | QUrl _mountPoint;
|
---|
| 111 | QByteArray _staID;
|
---|
| 112 | QByteArray _format;
|
---|
| 113 | QByteArray _latitude;
|
---|
| 114 | QByteArray _longitude;
|
---|
| 115 | QByteArray _height;
|
---|
| 116 | QByteArray _nmea;
|
---|
| 117 | QByteArray _ntripVersion;
|
---|
| 118 | int _nextSleep;
|
---|
| 119 | int _iMount;
|
---|
| 120 | bncRawFile* _rawFile;
|
---|
| 121 | QextSerialPort* _serialPort;
|
---|
| 122 | bool _isToBeDeleted;
|
---|
| 123 | latencyChecker* _latencyChecker;
|
---|
| 124 | QString _miscMount;
|
---|
| 125 | QFile* _serialOutFile;
|
---|
| 126 | t_serialNMEA _serialNMEA;
|
---|
| 127 | bncPPPclient* _PPPclient;
|
---|
| 128 | bool _rawOutput;
|
---|
| 129 | QMap<QString, long> _prnLastEpo;
|
---|
[3577] | 130 | #ifdef PPP_DLL_INTERFACE
|
---|
| 131 | t_dllInterface* _dllInterface;
|
---|
| 132 | #endif
|
---|
[4476] | 133 | QMap<char, QVector<QString> > _rnxTypes;
|
---|
[35] | 134 | };
|
---|
| 135 |
|
---|
| 136 | #endif
|
---|