source: ntrip/trunk/BNC/src/bncephuser.h@ 5564

Last change on this file since 5564 was 5564, checked in by mervart, 10 years ago
File size: 3.6 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 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
35extern "C" {
36#include "clock_orbit_rtcm.h"
37}
38
39class t_corr {
40 public:
41 t_corr() {
42 rao.ReSize(3);
43 dotRao.ReSize(3);
44 dotDotRao.ReSize(3);
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;
55 streamID[0] = 0;
56 streamID[0] = 0;
57 streamID[0] = 0;
58 }
59
60 ~t_corr() {}
61
62 bool ready() {return tRao.valid() && tClk.valid();}
63
64 static bool relevantMessageType(int msgType) {
65 return ( msgType == COTYPE_GPSCOMBINED ||
66 msgType == COTYPE_GLONASSCOMBINED ||
67 msgType == COTYPE_GPSORBIT ||
68 msgType == COTYPE_GPSCLOCK ||
69 msgType == COTYPE_GLONASSORBIT ||
70 msgType == COTYPE_GLONASSCLOCK ||
71 msgType == COTYPE_GPSHR ||
72 msgType == COTYPE_GLONASSHR );
73 }
74
75 t_irc readLine(const QString& line);
76
77 int messageType;
78 QString prn;
79 bncTime tClk;
80 bncTime tRao;
81 int iod;
82 double dClk;
83 double dotDClk;
84 double dotDotDClk;
85 double hrClk;
86 ColumnVector rao;
87 ColumnVector dotRao;
88 ColumnVector dotDotRao;
89 const t_eph* eph;
90 int streamID[3];
91};
92
93class t_bias {
94 public:
95 t_bias() {}
96 ~t_bias() {}
97 t_irc readLine(const QString& line);
98 double value(const QByteArray& rnxStr) const {
99 if (_value.contains(rnxStr)) {
100 return _value[rnxStr];
101 }
102 else {
103 return 0.0;
104 }
105 }
106 QString _prn;
107 bncTime _time;
108 QMap<QByteArray, double> _value;
109};
110
111class bncEphUser : public QObject {
112 Q_OBJECT
113
114 public:
115 bncEphUser(bool connectSlots = true);
116 virtual ~bncEphUser();
117
118 class t_ephPair {
119 public:
120 t_ephPair(t_eph* lastEph) {
121 last = lastEph;
122 prev = 0;
123 }
124 ~t_ephPair() {
125 delete last;
126 delete prev;
127 }
128 t_eph* last;
129 t_eph* prev;
130 };
131
132 const t_ephPair* ephPair(const QString& prn) {
133 if (_eph.contains(prn)) {
134 return _eph[prn];
135 }
136 else {
137 return 0;
138 }
139 }
140
141 t_irc putNewEph(t_eph* eph);
142
143 public slots:
144 void slotNewEphGPS(gpsephemeris gpseph);
145 void slotNewEphGlonass(glonassephemeris gloeph);
146 void slotNewEphGalileo(galileoephemeris galeph);
147
148 protected:
149 virtual void ephBufferChanged() {}
150 QMutex _mutex;
151 QMap<QString, t_ephPair*> _eph;
152};
153
154#endif
Note: See TracBrowser for help on using the repository browser.