source: ntrip/trunk/BNC/bncpppclient.h@ 3635

Last change on this file since 3635 was 3635, checked in by mervart, 12 years ago
File size: 3.9 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 BNCPPPCLIENT_H
26#define BNCPPPCLIENT_H
27
28#include <queue>
29#include "bncephuser.h"
30#include "RTCM/GPSDecoder.h"
31
32class bncModel;
33class t_pppOpt;
34
35class t_satData {
36 public:
37 t_satData() {
38 obsIndex = 0;
39 }
40 ~t_satData() {}
41 bncTime tt;
42 QString prn;
43 double P1;
44 double P2;
45 double P5;
46 double P3;
47 double L1;
48 double L2;
49 double L5;
50 double L3;
51 ColumnVector xx;
52 ColumnVector vv;
53 double clk;
54 double eleSat;
55 double azSat;
56 double rho;
57 bool slipFlag;
58 double lambda3;
59 unsigned obsIndex;
60 char system() const {return prn.toAscii()[0];}
61};
62
63class t_epoData {
64 public:
65 t_epoData() {}
66
67 ~t_epoData() {
68 clear();
69 }
70
71 void clear() {
72 QMapIterator<QString, t_satData*> it(satData);
73 while (it.hasNext()) {
74 it.next();
75 delete it.value();
76 }
77 satData.clear();
78 }
79
80 void deepCopy(const t_epoData* from) {
81 clear();
82 tt = from->tt;
83 QMapIterator<QString, t_satData*> it(from->satData);
84 while (it.hasNext()) {
85 it.next();
86 satData[it.key()] = new t_satData(*it.value());
87 }
88 }
89
90 unsigned sizeSys(char system) const {
91 unsigned ans = 0;
92 QMapIterator<QString, t_satData*> it(satData);
93 while (it.hasNext()) {
94 it.next();
95 if (it.value()->system() == system) {
96 ++ans;
97 }
98 }
99 return ans;
100 }
101 unsigned sizeAll() const {return satData.size();}
102
103 bncTime tt;
104 QMap<QString, t_satData*> satData;
105};
106
107class t_bias {
108 public:
109 t_bias() {
110 p1 = 0.0;
111 p2 = 0.0;
112 c1 = 0.0;
113 }
114 bncTime tt;
115 double p1;
116 double p2;
117 double c1;
118};
119
120class bncPPPclient : public bncEphUser {
121 Q_OBJECT
122
123 public:
124 bncPPPclient(QByteArray staID, t_pppOpt* opt = 0);
125 ~bncPPPclient();
126 void putNewObs(const t_obs& pp);
127 static t_irc applyCorr(const bncTime& tt, const t_corr* cc, ColumnVector& xc,
128 ColumnVector& vv);
129 QByteArray staID() const {return _staID;}
130
131 public slots:
132 void slotNewCorrections(QList<QString> corrList);
133
134 signals:
135 void newMessage(QByteArray msg, bool showOnScreen);
136 void newPosition(bncTime time, double x, double y, double z);
137 void newNMEAstr(QByteArray str);
138
139 private:
140 class slipInfo {
141 public:
142 slipInfo() {
143 slipCntL1 = -1;
144 slipCntL2 = -1;
145 slipCntL5 = -1;
146 }
147 ~slipInfo(){}
148 int slipCntL1;
149 int slipCntL2;
150 int slipCntL5;
151 };
152
153 t_irc getSatPos(const bncTime& tt, const QString& prn,
154 ColumnVector& xc, ColumnVector& vv);
155 void processEpochs();
156 void processFrontEpoch();
157 t_irc cmpToT(t_satData* satData);
158
159 t_pppOpt* _opt;
160 bool _optOwner;
161 QByteArray _staID;
162 QMap<QString, t_corr*> _corr;
163 bncTime _corr_tt;
164 QMap<QString, t_bias*> _bias;
165 std::queue<t_epoData*> _epoData;
166 bncModel* _model;
167 QMap<QString, slipInfo> _slips;
168};
169
170#endif
Note: See TracBrowser for help on using the repository browser.