source: ntrip/trunk/BNC/src/PPP/pppObsPool.cpp@ 11024

Last change on this file since 11024 was 11009, checked in by stuerze, 10 days ago

updates regarding RTCM-SSR: metadata usage in PPP, if available

  • Property svn:keywords set to Author Date Id Rev URL;svn:eol-style=native
  • Property svn:mime-type set to text/plain
File size: 4.8 KB
Line 
1/* -------------------------------------------------------------------------
2 * BKG NTRIP Client
3 * -------------------------------------------------------------------------
4 *
5 * Class: t_pppObsPool
6 *
7 * Purpose: Buffer with observations
8 *
9 * Author: L. Mervart
10 *
11 * Created: 29-Jul-2014
12 *
13 * Changes:
14 *
15 * -----------------------------------------------------------------------*/
16
17#include <iomanip>
18#include "pppObsPool.h"
19#include "pppClient.h"
20
21using namespace BNC_PPP;
22using namespace std;
23
24// Constructor
25/////////////////////////////////////////////////////////////////////////////
26t_pppObsPool::t_epoch::t_epoch(const bncTime& epoTime, vector<t_pppSatObs*>& obsVector,
27 bool pseudoObsIono) {
28 _epoTime = epoTime;
29 _pseudoObsIono = pseudoObsIono;
30 for (unsigned ii = 0; ii < obsVector.size(); ii++) {
31 _obsVector.push_back(obsVector[ii]);
32 }
33 obsVector.clear();
34}
35
36// Destructor
37/////////////////////////////////////////////////////////////////////////////
38t_pppObsPool::t_epoch::~t_epoch() {
39 for (unsigned ii = 0; ii < _obsVector.size(); ii++) {
40 delete _obsVector[ii];
41 }
42}
43
44// Constructor
45/////////////////////////////////////////////////////////////////////////////
46t_pppObsPool::t_pppObsPool() {
47 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
48 _satCodeBiases[ii] = 0;
49 }
50 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
51 _satPhaseBiases[ii] = 0;
52 }
53 _vTec = 0;
54 _metaData = 0;
55}
56
57// Destructor
58/////////////////////////////////////////////////////////////////////////////
59t_pppObsPool::~t_pppObsPool() {
60 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
61 delete _satCodeBiases[ii];
62 }
63 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
64 delete _satPhaseBiases[ii];
65 }
66 delete _vTec;
67 delete _metaData;
68 while (_epochs.size() > 0) {
69 delete _epochs.front();
70 _epochs.pop_front();
71 }
72}
73
74//
75/////////////////////////////////////////////////////////////////////////////
76void t_pppObsPool::putCodeBias(t_satCodeBias* satCodeBias) {
77 int iPrn = satCodeBias->_prn.toInt();
78 delete _satCodeBiases[iPrn];
79 _satCodeBiases[iPrn] = satCodeBias;
80 if (OPT->_logMode > t_pppOptions::normal) {
81 LOG << "codeBias " << string(satCodeBias->_time) << ' ' << satCodeBias->_prn.toString();
82 for (const auto& bias : satCodeBias->_bias) {
83 LOG << " " << bias._rnxType2ch << ' ' << setw(7) << setprecision(3) << bias._value;
84 }
85 LOG << endl;
86 }
87}
88
89//
90/////////////////////////////////////////////////////////////////////////////
91void t_pppObsPool::putPhaseBias(t_satPhaseBias* satPhaseBias) {
92 int iPrn = satPhaseBias->_prn.toInt();
93 delete _satPhaseBiases[iPrn];
94 _satPhaseBiases[iPrn] = satPhaseBias;
95 if (OPT->_logMode > t_pppOptions::normal) {
96 LOG.setf(ios::fixed);
97 LOG << "phaseBias " << string(satPhaseBias->_time) << ' ' << satPhaseBias->_prn.toString()
98 << ' ' << setw(7) << setprecision(2) << satPhaseBias->_yaw * 180.0 / M_PI
99 << ' ' << setw(7) << setprecision(3) << satPhaseBias->_yawRate * 180.0 / M_PI;
100 for (const auto& bias : satPhaseBias->_bias) {
101 LOG << " " << bias._rnxType2ch << ' ' << setw(2) << bias._jumpCounter;
102 if (bias._fixIndicator) {
103 LOG << " x ";
104 }
105 else {
106 LOG << " . ";
107 }
108 LOG << setw(6) << setprecision(3) << bias._value;
109 }
110 LOG << endl;
111 }
112}
113
114//
115/////////////////////////////////////////////////////////////////////////////
116void t_pppObsPool::clearCodeBiases(char sys) {
117 for (unsigned iPrn = 1; iPrn <= t_prn::MAXPRN; ++iPrn) {
118 t_prn prn; prn.set(iPrn);
119 if (prn.system() == sys) {
120 delete _satCodeBiases[iPrn];
121 _satCodeBiases[iPrn] = 0;
122 }
123 }
124}
125
126//
127/////////////////////////////////////////////////////////////////////////////
128void t_pppObsPool::clearPhaseBiases(char sys) {
129 for (unsigned iPrn = 1; iPrn <= t_prn::MAXPRN; ++iPrn) {
130 t_prn prn; prn.set(iPrn);
131 if (prn.system() == sys) {
132 delete _satPhaseBiases[iPrn];
133 _satPhaseBiases[iPrn] = 0;
134 }
135 }
136}
137
138//
139/////////////////////////////////////////////////////////////////////////////
140void t_pppObsPool::putTec(t_vTec* vTec) {
141 delete _vTec;
142 _vTec = new t_vTec(*vTec);
143 delete vTec;
144}
145
146//
147/////////////////////////////////////////////////////////////////////////////
148void t_pppObsPool::putMetaData(t_metaData* metaData) {
149 delete _metaData;
150 _metaData = new t_metaData(*metaData);
151 delete metaData;
152}
153
154//
155/////////////////////////////////////////////////////////////////////////////
156void t_pppObsPool::putEpoch(const bncTime& epoTime, vector<t_pppSatObs*>& obsVector,
157 bool pseudoObsIono) {
158 const unsigned MAXSIZE = 2;
159 _epochs.push_back(new t_epoch(epoTime, obsVector, pseudoObsIono));
160
161 if (_epochs.size() > MAXSIZE) {
162 delete _epochs.front();
163 _epochs.pop_front();
164 }
165}
Note: See TracBrowser for help on using the repository browser.