source: ntrip/trunk/BNC/src/PPP_free/pppClient.h@ 6099

Last change on this file since 6099 was 6099, checked in by mervart, 10 years ago
File size: 3.7 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 PPPCLIENT_H
26#define PPPCLIENT_H
27
28#include <vector>
29#include <QtCore>
30
31#include "pppInclude.h"
32#include "pppOptions.h"
33
34class bncEphUser;
35class t_eph;
36
37namespace BNC_PPP {
38
39class t_pppFilter;
40
41class t_satData {
42 public:
43 t_satData() {
44 obsIndex = 0;
45 P1 = 0.0;
46 P2 = 0.0;
47 P5 = 0.0;
48 P3 = 0.0;
49 L1 = 0.0;
50 L2 = 0.0;
51 L5 = 0.0;
52 L3 = 0.0;
53 }
54 ~t_satData() {}
55 bncTime tt;
56 QString prn;
57 double P1;
58 double P2;
59 double P5;
60 double P3;
61 double L1;
62 double L2;
63 double L5;
64 double L3;
65 ColumnVector xx;
66 ColumnVector vv;
67 double clk;
68 double eleSat;
69 double azSat;
70 double rho;
71 bool slipFlag;
72 double lambda3;
73 unsigned obsIndex;
74 char system() const {return prn.toAscii()[0];}
75};
76
77class t_epoData {
78 public:
79 t_epoData() {}
80
81 ~t_epoData() {
82 clear();
83 }
84
85 void clear() {
86 QMapIterator<QString, t_satData*> it(satData);
87 while (it.hasNext()) {
88 it.next();
89 delete it.value();
90 }
91 satData.clear();
92 tt.reset();
93 }
94
95 void deepCopy(const t_epoData* from) {
96 clear();
97 tt = from->tt;
98 QMapIterator<QString, t_satData*> it(from->satData);
99 while (it.hasNext()) {
100 it.next();
101 satData[it.key()] = new t_satData(*it.value());
102 }
103 }
104
105 unsigned sizeSys(char system) const {
106 unsigned ans = 0;
107 QMapIterator<QString, t_satData*> it(satData);
108 while (it.hasNext()) {
109 it.next();
110 if (it.value()->system() == system) {
111 ++ans;
112 }
113 }
114 return ans;
115 }
116 unsigned sizeAll() const {return satData.size();}
117
118 bncTime tt;
119 QMap<QString, t_satData*> satData;
120};
121
122class t_pppClient {
123 public:
124 t_pppClient(const t_pppOptions* opt);
125 ~t_pppClient();
126 void processEpoch(const std::vector<t_satObs*>& satObs, t_output* output);
127 void putEphemeris(const t_eph* eph);
128 void putOrbCorrections(const std::vector<t_orbCorr*>& corr);
129 void putClkCorrections(const std::vector<t_clkCorr*>& corr);
130 void putBiases(const std::vector<t_satBias*>& satBias);
131 QByteArray staID() const {return _staID;}
132 const t_pppOptions* opt() const {return _opt;}
133 static t_pppClient* instance();
134 std::ostringstream& log() {return *_log;}
135
136 private:
137 t_irc getSatPos(const bncTime& tt, const QString& prn, ColumnVector& xc, ColumnVector& vv);
138 void putNewObs(t_satData* satData);
139 t_irc cmpToT(t_satData* satData);
140
141 bncEphUser* _ephUser;
142 t_pppOptions* _opt;
143 QByteArray _staID;
144 t_epoData* _epoData;
145 t_pppFilter* _filter;
146 std::ostringstream* _log;
147};
148
149}
150
151#define LOG (BNC_PPP::t_pppClient::instance()->log())
152
153#endif
Note: See TracBrowser for help on using the repository browser.