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

Last change on this file since 5567 was 5567, checked in by mervart, 10 years ago
File size: 3.5 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 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;
53 streamID[0] = -1;
54 streamID[1] = -1;
55 streamID[2] = -1;
56 }
57
58 ~t_corr() {}
59
60 bool ready() {return tRao.valid() && tClk.valid();}
61
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 ||
68 msgType == COTYPE_GLONASSCLOCK ||
69 msgType == COTYPE_GPSHR ||
70 msgType == COTYPE_GLONASSHR );
71 }
72
73 t_irc readLine(const QString& line);
74
75 int messageType;
76 QString prn;
77 bncTime tClk;
78 bncTime tRao;
79 int iod;
80 double dClk;
81 double dotDClk;
82 double dotDotDClk;
83 double hrClk;
84 ColumnVector rao;
85 ColumnVector dotRao;
86 const t_eph* eph;
87 int streamID[3];
88};
89
90class 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
108class bncEphUser : public QObject {
109 Q_OBJECT
110
111 public:
112 bncEphUser(bool connectSlots = true);
113 virtual ~bncEphUser();
114
115 class t_ephPair {
116 public:
117 t_ephPair(t_eph* lastEph) {
118 last = lastEph;
119 prev = 0;
120 }
121 ~t_ephPair() {
122 delete last;
123 delete prev;
124 }
125 t_eph* last;
126 t_eph* prev;
127 };
128
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 }
137
138 t_irc putNewEph(t_eph* eph);
139
140 public slots:
141 void slotNewEphGPS(gpsephemeris gpseph);
142 void slotNewEphGlonass(glonassephemeris gloeph);
143 void slotNewEphGalileo(galileoephemeris galeph);
144
145 protected:
146 virtual void ephBufferChanged() {}
147 QMutex _mutex;
148 QMap<QString, t_ephPair*> _eph;
149};
150
151#endif
Note: See TracBrowser for help on using the repository browser.