[2904] | 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 BNCEPHUSER_H
|
---|
| 26 | #define BNCEPHUSER_H
|
---|
| 27 |
|
---|
| 28 | #include <QtCore>
|
---|
| 29 | #include <newmat.h>
|
---|
| 30 |
|
---|
| 31 | #include "bncconst.h"
|
---|
| 32 | #include "bnctime.h"
|
---|
| 33 | #include "RTCM3/ephemeris.h"
|
---|
| 34 |
|
---|
[2911] | 35 | extern "C" {
|
---|
| 36 | #include "clock_orbit_rtcm.h"
|
---|
| 37 | }
|
---|
| 38 |
|
---|
[2904] | 39 | class t_corr {
|
---|
| 40 | public:
|
---|
| 41 | t_corr() {
|
---|
[3751] | 42 | rao.ReSize(3);
|
---|
| 43 | dotRao.ReSize(3);
|
---|
| 44 | dotDotRao.ReSize(3);
|
---|
[4772] | 45 | messageType = 0;
|
---|
| 46 | iod = 0;
|
---|
| 47 | dClk = 0.0;
|
---|
| 48 | dotDClk = 0.0;
|
---|
| 49 | dotDotDClk = 0.0;
|
---|
| 50 | hrClk = 0.0;
|
---|
| 51 | rao = 0.0;
|
---|
| 52 | dotRao = 0.0;
|
---|
| 53 | dotDotRao = 0.0;
|
---|
| 54 | eph = 0;
|
---|
[2904] | 55 | }
|
---|
[3751] | 56 |
|
---|
| 57 | ~t_corr() {}
|
---|
[2911] | 58 |
|
---|
[3751] | 59 | bool ready() {return tRao.valid() && tClk.valid();}
|
---|
| 60 |
|
---|
[2911] | 61 | static bool relevantMessageType(int msgType) {
|
---|
| 62 | return ( msgType == COTYPE_GPSCOMBINED ||
|
---|
| 63 | msgType == COTYPE_GLONASSCOMBINED ||
|
---|
| 64 | msgType == COTYPE_GPSORBIT ||
|
---|
| 65 | msgType == COTYPE_GPSCLOCK ||
|
---|
| 66 | msgType == COTYPE_GLONASSORBIT ||
|
---|
[3491] | 67 | msgType == COTYPE_GLONASSCLOCK ||
|
---|
| 68 | msgType == COTYPE_GPSHR ||
|
---|
| 69 | msgType == COTYPE_GLONASSHR );
|
---|
[2911] | 70 | }
|
---|
| 71 |
|
---|
[2912] | 72 | t_irc readLine(const QString& line);
|
---|
[2911] | 73 |
|
---|
[4772] | 74 | int messageType;
|
---|
[2914] | 75 | QString prn;
|
---|
[3751] | 76 | bncTime tClk;
|
---|
| 77 | bncTime tRao;
|
---|
[2904] | 78 | int iod;
|
---|
| 79 | double dClk;
|
---|
| 80 | double dotDClk;
|
---|
| 81 | double dotDotDClk;
|
---|
[3496] | 82 | double hrClk;
|
---|
[2904] | 83 | ColumnVector rao;
|
---|
| 84 | ColumnVector dotRao;
|
---|
| 85 | ColumnVector dotDotRao;
|
---|
[3029] | 86 | const t_eph* eph;
|
---|
[2904] | 87 | };
|
---|
| 88 |
|
---|
| 89 | class bncEphUser : public QObject {
|
---|
| 90 | Q_OBJECT
|
---|
| 91 |
|
---|
| 92 | public:
|
---|
[3640] | 93 | bncEphUser(bool connectSlots = true);
|
---|
[3247] | 94 | virtual ~bncEphUser();
|
---|
[2904] | 95 |
|
---|
| 96 | class t_ephPair {
|
---|
| 97 | public:
|
---|
[3012] | 98 | t_ephPair(t_eph* lastEph) {
|
---|
| 99 | last = lastEph;
|
---|
[2904] | 100 | prev = 0;
|
---|
| 101 | }
|
---|
| 102 | ~t_ephPair() {
|
---|
| 103 | delete last;
|
---|
| 104 | delete prev;
|
---|
| 105 | }
|
---|
| 106 | t_eph* last;
|
---|
| 107 | t_eph* prev;
|
---|
| 108 | };
|
---|
| 109 |
|
---|
[3209] | 110 | const t_ephPair* ephPair(const QString& prn) {
|
---|
| 111 | if (_eph.contains(prn)) {
|
---|
| 112 | return _eph[prn];
|
---|
| 113 | }
|
---|
| 114 | else {
|
---|
| 115 | return 0;
|
---|
| 116 | }
|
---|
| 117 | }
|
---|
[3182] | 118 |
|
---|
[3671] | 119 | t_irc putNewEph(t_eph* eph);
|
---|
[3670] | 120 |
|
---|
[3182] | 121 | public slots:
|
---|
| 122 | void slotNewEphGPS(gpsephemeris gpseph);
|
---|
| 123 | void slotNewEphGlonass(glonassephemeris gloeph);
|
---|
| 124 | void slotNewEphGalileo(galileoephemeris galeph);
|
---|
| 125 |
|
---|
| 126 | protected:
|
---|
[3246] | 127 | virtual void ephBufferChanged() {}
|
---|
[2904] | 128 | QMutex _mutex;
|
---|
| 129 | QMap<QString, t_ephPair*> _eph;
|
---|
| 130 | };
|
---|
| 131 |
|
---|
| 132 | #endif
|
---|