[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);
|
---|
[4772] | 44 | messageType = 0;
|
---|
| 45 | iod = 0;
|
---|
| 46 | dClk = 0.0;
|
---|
| 47 | dotDClk = 0.0;
|
---|
| 48 | dotDotDClk = 0.0;
|
---|
| 49 | hrClk = 0.0;
|
---|
| 50 | rao = 0.0;
|
---|
| 51 | dotRao = 0.0;
|
---|
| 52 | eph = 0;
|
---|
[5567] | 53 | streamID[0] = -1;
|
---|
| 54 | streamID[1] = -1;
|
---|
| 55 | streamID[2] = -1;
|
---|
[2904] | 56 | }
|
---|
[3751] | 57 |
|
---|
| 58 | ~t_corr() {}
|
---|
[2911] | 59 |
|
---|
[3751] | 60 | bool ready() {return tRao.valid() && tClk.valid();}
|
---|
| 61 |
|
---|
[2911] | 62 | static bool relevantMessageType(int msgType) {
|
---|
| 63 | return ( msgType == COTYPE_GPSCOMBINED ||
|
---|
| 64 | msgType == COTYPE_GLONASSCOMBINED ||
|
---|
| 65 | msgType == COTYPE_GPSORBIT ||
|
---|
| 66 | msgType == COTYPE_GPSCLOCK ||
|
---|
| 67 | msgType == COTYPE_GLONASSORBIT ||
|
---|
[3491] | 68 | msgType == COTYPE_GLONASSCLOCK ||
|
---|
| 69 | msgType == COTYPE_GPSHR ||
|
---|
| 70 | msgType == COTYPE_GLONASSHR );
|
---|
[2911] | 71 | }
|
---|
| 72 |
|
---|
[2912] | 73 | t_irc readLine(const QString& line);
|
---|
[2911] | 74 |
|
---|
[4772] | 75 | int messageType;
|
---|
[2914] | 76 | QString prn;
|
---|
[3751] | 77 | bncTime tClk;
|
---|
| 78 | bncTime tRao;
|
---|
[2904] | 79 | int iod;
|
---|
| 80 | double dClk;
|
---|
| 81 | double dotDClk;
|
---|
| 82 | double dotDotDClk;
|
---|
[3496] | 83 | double hrClk;
|
---|
[2904] | 84 | ColumnVector rao;
|
---|
| 85 | ColumnVector dotRao;
|
---|
[3029] | 86 | const t_eph* eph;
|
---|
[5564] | 87 | int streamID[3];
|
---|
[2904] | 88 | };
|
---|
| 89 |
|
---|
[4784] | 90 | class t_bias {
|
---|
| 91 | public:
|
---|
| 92 | t_bias() {}
|
---|
| 93 | ~t_bias() {}
|
---|
| 94 | t_irc readLine(const QString& line);
|
---|
| 95 | double value(const QByteArray& rnxStr) const {
|
---|
| 96 | if (_value.contains(rnxStr)) {
|
---|
| 97 | return _value[rnxStr];
|
---|
| 98 | }
|
---|
| 99 | else {
|
---|
| 100 | return 0.0;
|
---|
| 101 | }
|
---|
| 102 | }
|
---|
| 103 | QString _prn;
|
---|
| 104 | bncTime _time;
|
---|
| 105 | QMap<QByteArray, double> _value;
|
---|
| 106 | };
|
---|
| 107 |
|
---|
[2904] | 108 | class bncEphUser : public QObject {
|
---|
| 109 | Q_OBJECT
|
---|
| 110 |
|
---|
| 111 | public:
|
---|
[3640] | 112 | bncEphUser(bool connectSlots = true);
|
---|
[3247] | 113 | virtual ~bncEphUser();
|
---|
[2904] | 114 |
|
---|
| 115 | class t_ephPair {
|
---|
| 116 | public:
|
---|
[3012] | 117 | t_ephPair(t_eph* lastEph) {
|
---|
| 118 | last = lastEph;
|
---|
[2904] | 119 | prev = 0;
|
---|
| 120 | }
|
---|
| 121 | ~t_ephPair() {
|
---|
| 122 | delete last;
|
---|
| 123 | delete prev;
|
---|
| 124 | }
|
---|
| 125 | t_eph* last;
|
---|
| 126 | t_eph* prev;
|
---|
| 127 | };
|
---|
| 128 |
|
---|
[3209] | 129 | const t_ephPair* ephPair(const QString& prn) {
|
---|
| 130 | if (_eph.contains(prn)) {
|
---|
| 131 | return _eph[prn];
|
---|
| 132 | }
|
---|
| 133 | else {
|
---|
| 134 | return 0;
|
---|
| 135 | }
|
---|
| 136 | }
|
---|
[3182] | 137 |
|
---|
[3671] | 138 | t_irc putNewEph(t_eph* eph);
|
---|
[3670] | 139 |
|
---|
[3182] | 140 | public slots:
|
---|
| 141 | void slotNewEphGPS(gpsephemeris gpseph);
|
---|
| 142 | void slotNewEphGlonass(glonassephemeris gloeph);
|
---|
| 143 | void slotNewEphGalileo(galileoephemeris galeph);
|
---|
| 144 |
|
---|
| 145 | protected:
|
---|
[3246] | 146 | virtual void ephBufferChanged() {}
|
---|
[2904] | 147 | QMutex _mutex;
|
---|
| 148 | QMap<QString, t_ephPair*> _eph;
|
---|
| 149 | };
|
---|
| 150 |
|
---|
| 151 | #endif
|
---|