[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>
|
---|
[35] | 31 |
|
---|
| 32 | #include "RTCM/GPSDecoder.h"
|
---|
[138] | 33 | #include "bncconst.h"
|
---|
[35] | 34 |
|
---|
[408] | 35 | class bncRinex;
|
---|
| 36 |
|
---|
[35] | 37 | class bncGetThread : public QThread {
|
---|
| 38 | Q_OBJECT
|
---|
| 39 |
|
---|
| 40 | public:
|
---|
[278] | 41 | bncGetThread(const QUrl& mountPoint,
|
---|
[366] | 42 | const QByteArray& format,
|
---|
| 43 | const QByteArray& latitude,
|
---|
| 44 | const QByteArray& longitude,
|
---|
| 45 | const QByteArray& nmea, int iMount);
|
---|
[35] | 46 | ~bncGetThread();
|
---|
| 47 |
|
---|
[366] | 48 | static QTcpSocket* request(const QUrl& mountPoint, QByteArray& latitude, QByteArray& longitude,
|
---|
| 49 | QByteArray& nmea, int timeOut, QString& msg);
|
---|
[88] | 50 |
|
---|
| 51 | QByteArray staID() const {return _staID;}
|
---|
| 52 |
|
---|
[35] | 53 | signals:
|
---|
[628] | 54 | void newBytes(QByteArray staID, double nbyte);
|
---|
| 55 | void newObs(QByteArray staID, bool firstObs, p_obs obs);
|
---|
| 56 | void error(QByteArray staID);
|
---|
| 57 | void newMessage(QByteArray msg);
|
---|
[35] | 58 |
|
---|
| 59 | protected:
|
---|
| 60 | virtual void run();
|
---|
[138] | 61 |
|
---|
[35] | 62 | private:
|
---|
[138] | 63 | t_irc initRun();
|
---|
| 64 | void message(const QString&);
|
---|
| 65 | void exit(int exitCode = 0);
|
---|
| 66 | void tryReconnect();
|
---|
[658] | 67 | void callScript(const char* _comment);
|
---|
[136] | 68 | GPSDecoder* _decoder;
|
---|
[35] | 69 | QTcpSocket* _socket;
|
---|
[88] | 70 | QUrl _mountPoint;
|
---|
| 71 | QByteArray _staID;
|
---|
[255] | 72 | QByteArray _staID_orig;
|
---|
[59] | 73 | QByteArray _format;
|
---|
[366] | 74 | QByteArray _latitude;
|
---|
| 75 | QByteArray _longitude;
|
---|
| 76 | QByteArray _nmea;
|
---|
[668] | 77 | QString _adviseScript;
|
---|
[696] | 78 | QString _begDateCor;
|
---|
| 79 | QString _begTimeCor;
|
---|
| 80 | QString _begDateOut;
|
---|
| 81 | QString _begTimeOut;
|
---|
| 82 | QString _endDateCor;
|
---|
| 83 | QString _endTimeCor;
|
---|
| 84 | QString _endDateOut;
|
---|
| 85 | QString _endTimeOut;
|
---|
[723] | 86 | bool _makePause;
|
---|
[686] | 87 | int _obsRate;
|
---|
[658] | 88 | int _inspSegm;
|
---|
[668] | 89 | int _adviseFail;
|
---|
| 90 | int _adviseReco;
|
---|
[728] | 91 | int _perfIntr;
|
---|
[136] | 92 | int _timeOut;
|
---|
[138] | 93 | int _nextSleep;
|
---|
[278] | 94 | int _iMount;
|
---|
[408] | 95 | int _samplingRate;
|
---|
| 96 | bncRinex* _rnx;
|
---|
[651] | 97 | QDateTime _decodeFailure;
|
---|
[658] | 98 | QDateTime _decodeStart;
|
---|
| 99 | QDateTime _decodeStop;
|
---|
| 100 | QDateTime _decodePause;
|
---|
| 101 | QDateTime _decodeTime;
|
---|
[699] | 102 | QDateTime _decodeSucc;
|
---|
[672] | 103 | QMutex _mutex;
|
---|
[35] | 104 | };
|
---|
| 105 |
|
---|
| 106 | #endif
|
---|