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 | #ifndef BNCGETTHREAD_H
|
---|
26 | #define BNCGETTHREAD_H
|
---|
27 |
|
---|
28 | #include <QThread>
|
---|
29 | #include <QDateTime>
|
---|
30 | #include <QFile>
|
---|
31 | #include <QTcpServer>
|
---|
32 | #include <QUrl>
|
---|
33 |
|
---|
34 | #include "bncconst.h"
|
---|
35 | #include "bncnetquery.h"
|
---|
36 | #include "bnctime.h"
|
---|
37 | #include "bncrawfile.h"
|
---|
38 | #include "satObs.h"
|
---|
39 | #include "rinex/rnxobsfile.h"
|
---|
40 |
|
---|
41 | class GPSDecoder;
|
---|
42 | class QextSerialPort;
|
---|
43 | class latencyChecker;
|
---|
44 |
|
---|
45 | class bncGetThread : public QThread {
|
---|
46 | Q_OBJECT
|
---|
47 |
|
---|
48 | public:
|
---|
49 | bncGetThread(bncRawFile* rawFile);
|
---|
50 | bncGetThread(const QUrl& mountPoint,
|
---|
51 | const QByteArray& format,
|
---|
52 | const QByteArray& latitude,
|
---|
53 | const QByteArray& longitude,
|
---|
54 | const QByteArray& nmea,
|
---|
55 | const QByteArray& ntripVersion);
|
---|
56 |
|
---|
57 | bncNetQuery::queryStatus queryStatus() {
|
---|
58 | if (_query) {
|
---|
59 | return _query->status();
|
---|
60 | }
|
---|
61 | else {
|
---|
62 | return bncNetQuery::init;
|
---|
63 | }
|
---|
64 | }
|
---|
65 |
|
---|
66 | protected:
|
---|
67 | ~bncGetThread();
|
---|
68 |
|
---|
69 | public:
|
---|
70 | void terminate();
|
---|
71 |
|
---|
72 | QByteArray staID() const {return _staID;}
|
---|
73 | QUrl mountPoint() const {return _mountPoint;}
|
---|
74 | QByteArray latitude() const {return _latitude;}
|
---|
75 | QByteArray longitude() const {return _longitude;}
|
---|
76 | QByteArray ntripVersion() const {return _ntripVersion;}
|
---|
77 |
|
---|
78 | signals:
|
---|
79 | void newBytes(QByteArray staID, double nbyte);
|
---|
80 | void newRawData(QByteArray staID, QByteArray data);
|
---|
81 | void newLatency(QByteArray staID, double clate);
|
---|
82 | void newObs(QByteArray staID, QList<t_satObs> obsList);
|
---|
83 | void newAntCrd(QByteArray staID, double xx, double yy, double zz,
|
---|
84 | double hh, QByteArray antType);
|
---|
85 | void newMessage(QByteArray msg, bool showOnScreen);
|
---|
86 | void newRTCMMessage(QByteArray staID, int msgID);
|
---|
87 | void getThreadFinished(QByteArray staID);
|
---|
88 |
|
---|
89 | public:
|
---|
90 | virtual void run();
|
---|
91 |
|
---|
92 | public slots:
|
---|
93 | void slotNewNMEAstr(QByteArray staID, QByteArray str);
|
---|
94 |
|
---|
95 | private slots:
|
---|
96 | void slotSerialReadyRead();
|
---|
97 | void slotNewNMEAConnection();
|
---|
98 |
|
---|
99 | private:
|
---|
100 | enum t_serialNMEA {NO_NMEA, MANUAL_NMEA, AUTO_NMEA};
|
---|
101 | t_irc initDecoder();
|
---|
102 | GPSDecoder* decoder();
|
---|
103 |
|
---|
104 | void initialize();
|
---|
105 | t_irc tryReconnect();
|
---|
106 | void miscScanRTCM();
|
---|
107 |
|
---|
108 | QMap<QString, GPSDecoder*> _decodersRaw;
|
---|
109 | GPSDecoder* _decoder;
|
---|
110 | bncNetQuery* _query;
|
---|
111 | QUrl _mountPoint;
|
---|
112 | QByteArray _staID;
|
---|
113 | QByteArray _format;
|
---|
114 | QByteArray _latitude;
|
---|
115 | QByteArray _longitude;
|
---|
116 | QByteArray _height;
|
---|
117 | QByteArray _nmea;
|
---|
118 | QByteArray _ntripVersion;
|
---|
119 | QByteArray _manualNMEAString;
|
---|
120 | QDateTime _lastNMEA;
|
---|
121 | int _NMEASampl;
|
---|
122 | int _nextSleep;
|
---|
123 | int _iMount;
|
---|
124 | int _ssrEpoch;
|
---|
125 | bncRawFile* _rawFile;
|
---|
126 | QextSerialPort* _serialPort;
|
---|
127 | bool _isToBeDeleted;
|
---|
128 | bool _rtcmObs;
|
---|
129 | bool _rtcmSsrOrb;
|
---|
130 | bool _rtcmSsrClk;
|
---|
131 | bool _rtcmSsrOrbClk;
|
---|
132 | bool _rtcmSsrCbi;
|
---|
133 | bool _rtcmSsrPbi;
|
---|
134 | bool _rtcmSsrVtec;
|
---|
135 | bool _rtcmSsrUra;
|
---|
136 | bool _rtcmSsrHr;
|
---|
137 | bool _rtcmSsrIgs;
|
---|
138 | latencyChecker* _latencyChecker;
|
---|
139 | QString _miscMount;
|
---|
140 | QFile* _serialOutFile;
|
---|
141 | t_serialNMEA _serialNMEA;
|
---|
142 | bool _rawOutput;
|
---|
143 | bool _latencycheck;
|
---|
144 | QMap<QString, bncTime> _prnLastEpo;
|
---|
145 | QMap<char, QVector<QString> > _rnxTypes;
|
---|
146 | QStringList _gloSlots;
|
---|
147 | QList<QTcpSocket*>* _nmeaSockets;
|
---|
148 | QMap<QByteArray, int> _nmeaPortsMap;
|
---|
149 | QTcpServer* _nmeaServer;
|
---|
150 | };
|
---|
151 |
|
---|
152 | #endif
|
---|