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