source: ntrip/trunk/BNC/bncgetthread.h@ 3595

Last change on this file since 3595 was 3595, checked in by mervart, 12 years ago
File size: 4.0 KB
Line 
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 <QtNetwork>
30#include <QDateTime>
31#include <QFile>
32
33#include "RTCM/GPSDecoder.h"
34#include "rtcm3torinex.h"
35#include "bncconst.h"
36#include "bncnetquery.h"
37#include "bnctime.h"
38#include "bncrawfile.h"
39
40class QextSerialPort;
41class latencyChecker;
42class bncPPPclient;
43#ifdef PPP_DLL_INTERFACE
44class t_dllInterface;
45#endif
46
47class bncGetThread : public QThread {
48 Q_OBJECT
49
50 public:
51 bncGetThread(bncRawFile* rawFile);
52 bncGetThread(const QUrl& mountPoint,
53 const QByteArray& format,
54 const QByteArray& latitude,
55 const QByteArray& longitude,
56 const QByteArray& nmea,
57 const QByteArray& ntripVersion);
58
59 bncNetQuery::queryStatus queryStatus() {
60 if (_query) {
61 return _query->status();
62 }
63 else {
64 return bncNetQuery::init;
65 }
66 }
67
68 protected:
69 ~bncGetThread();
70
71 public:
72 void terminate();
73
74 QByteArray staID() const {return _staID;}
75 QUrl mountPoint() const {return _mountPoint;}
76 QByteArray latitude() const {return _latitude;}
77 QByteArray longitude() const {return _longitude;}
78 QByteArray ntripVersion() const {return _ntripVersion;}
79
80 signals:
81 void newBytes(QByteArray staID, double nbyte);
82 void newLatency(QByteArray staID, double clate);
83 void newObs(QByteArray staID, bool firstObs, t_obs obs);
84 void newAntCrd(QByteArray staID, double xx, double yy, double zz,
85 double hh, QByteArray antType);
86 void newMessage(QByteArray msg, bool showOnScreen);
87 void newRTCMMessage(QByteArray staID, int msgID);
88 void getThreadFinished(QByteArray staID);
89 void newPosition(bncTime time, double x, double y, double z);
90 void newNMEAstr(QByteArray str);
91
92 public:
93 virtual void run();
94
95 private slots:
96 void slotSerialReadyRead();
97
98 private:
99 enum t_serialNMEA {NO_NMEA, MANUAL_NMEA, AUTO_NMEA};
100 t_irc initDecoder();
101 GPSDecoder* decoder();
102
103 void initialize();
104 t_irc tryReconnect();
105 void scanRTCM();
106
107 QMap<QString, GPSDecoder*> _decodersRaw;
108 GPSDecoder* _decoder;
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;
130#ifdef PPP_DLL_INTERFACE
131 t_dllInterface* _dllInterface;
132#endif
133};
134
135#endif
Note: See TracBrowser for help on using the repository browser.