source: ntrip/trunk/BNC/bncephuser.h@ 3794

Last change on this file since 3794 was 3751, checked in by mervart, 13 years ago
File size: 3.1 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 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 dotDotRao = 0.0;
53 eph = 0;
54 }
55
56 ~t_corr() {}
57
58 bool ready() {return tRao.valid() && tClk.valid();}
59
60 static bool relevantMessageType(int msgType) {
61 return ( msgType == COTYPE_GPSCOMBINED ||
62 msgType == COTYPE_GLONASSCOMBINED ||
63 msgType == COTYPE_GPSORBIT ||
64 msgType == COTYPE_GPSCLOCK ||
65 msgType == COTYPE_GLONASSORBIT ||
66 msgType == COTYPE_GLONASSCLOCK ||
67 msgType == COTYPE_GPSHR ||
68 msgType == COTYPE_GLONASSHR );
69 }
70
71 t_irc readLine(const QString& line);
72
73 QString prn;
74 bncTime tClk;
75 bncTime tRao;
76 int iod;
77 double dClk;
78 double dotDClk;
79 double dotDotDClk;
80 double hrClk;
81 ColumnVector rao;
82 ColumnVector dotRao;
83 ColumnVector dotDotRao;
84 const t_eph* eph;
85};
86
87class bncEphUser : public QObject {
88 Q_OBJECT
89
90 public:
91 bncEphUser(bool connectSlots = true);
92 virtual ~bncEphUser();
93
94 class t_ephPair {
95 public:
96 t_ephPair(t_eph* lastEph) {
97 last = lastEph;
98 prev = 0;
99 }
100 ~t_ephPair() {
101 delete last;
102 delete prev;
103 }
104 t_eph* last;
105 t_eph* prev;
106 };
107
108 const t_ephPair* ephPair(const QString& prn) {
109 if (_eph.contains(prn)) {
110 return _eph[prn];
111 }
112 else {
113 return 0;
114 }
115 }
116
117 t_irc putNewEph(t_eph* eph);
118
119 public slots:
120 void slotNewEphGPS(gpsephemeris gpseph);
121 void slotNewEphGlonass(glonassephemeris gloeph);
122 void slotNewEphGalileo(galileoephemeris galeph);
123
124 protected:
125 virtual void ephBufferChanged() {}
126 QMutex _mutex;
127 QMap<QString, t_ephPair*> _eph;
128};
129
130#endif
Note: See TracBrowser for help on using the repository browser.