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

Last change on this file since 9674 was 9508, checked in by stuerze, 3 years ago

some changes regarding PPP

  • Property svn:keywords set to Author Date Id Rev URL;svn:eol-style=native
  • Property svn:mime-type set to text/plain
File size: 3.7 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 "pppObsPool.h"
18
19using namespace BNC_PPP;
20using namespace std;
21
22// Constructor
23/////////////////////////////////////////////////////////////////////////////
24t_pppObsPool::t_epoch::t_epoch(const bncTime& epoTime, vector<t_pppSatObs*>& obsVector,
25 bool pseudoObsIono, const QMap<char, t_pppRefSat*>& refSatMap) {
26 _epoTime = epoTime;
27 _pseudoObsIono = pseudoObsIono;
28 for (unsigned ii = 0; ii < obsVector.size(); ii++) {
29 _obsVector.push_back(obsVector[ii]);
30 }
31 obsVector.clear();
32
33 QMapIterator<char, t_pppRefSat*> it(refSatMap);
34 while (it.hasNext()) {
35 it.next();
36 char sys = it.key();
37 t_pppRefSat* refSat = it.value();
38 _refSatMap[sys] = new t_pppRefSat(refSat->prn(), refSat->stecValue());
39 }
40 //refSatMap.clear();
41}
42
43// Destructor
44/////////////////////////////////////////////////////////////////////////////
45t_pppObsPool::t_epoch::~t_epoch() {
46 for (unsigned ii = 0; ii < _obsVector.size(); ii++) {
47 delete _obsVector[ii];
48 }
49
50 QMapIterator<char, t_pppRefSat*> it(_refSatMap);
51 while (it.hasNext()) {
52 it.next();
53 delete it.value();
54 }
55 _refSatMap.clear();
56}
57
58// Constructor
59/////////////////////////////////////////////////////////////////////////////
60t_pppObsPool::t_pppObsPool() {
61 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
62 _satCodeBiases[ii] = 0;
63 }
64 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
65 _satPhaseBiases[ii] = 0;
66 }
67 _vTec = 0;
68 _refSatChangeRequiredMap['G'] = false;
69 _refSatChangeRequiredMap['R'] = false;
70 _refSatChangeRequiredMap['E'] = false;
71 _refSatChangeRequiredMap['C'] = false;
72
73}
74
75// Destructor
76/////////////////////////////////////////////////////////////////////////////
77t_pppObsPool::~t_pppObsPool() {
78 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
79 delete _satCodeBiases[ii];
80 }
81 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
82 delete _satPhaseBiases[ii];
83 }
84 delete _vTec;
85 while (_epochs.size() > 0) {
86 delete _epochs.front();
87 _epochs.pop_front();
88 }
89}
90
91//
92/////////////////////////////////////////////////////////////////////////////
93void t_pppObsPool::putCodeBias(t_satCodeBias* satCodeBias) {
94 int iPrn = satCodeBias->_prn.toInt();
95 delete _satCodeBiases[iPrn];
96 _satCodeBiases[iPrn] = satCodeBias;
97}
98
99//
100/////////////////////////////////////////////////////////////////////////////
101void t_pppObsPool::putPhaseBias(t_satPhaseBias* satPhaseBias) {
102 int iPrn = satPhaseBias->_prn.toInt();
103 delete _satPhaseBiases[iPrn];
104 _satPhaseBiases[iPrn] = satPhaseBias;
105}
106
107//
108/////////////////////////////////////////////////////////////////////////////
109void t_pppObsPool::putTec(t_vTec* vTec) {
110 delete _vTec;
111 _vTec = new t_vTec(*vTec);
112 delete vTec;
113}
114
115//
116/////////////////////////////////////////////////////////////////////////////
117void t_pppObsPool::putEpoch(const bncTime& epoTime, vector<t_pppSatObs*>& obsVector,
118 bool pseudoObsIono, const QMap<char, t_pppRefSat*>& refSatMap) {
119 const unsigned MAXSIZE = 2;
120 _epochs.push_back(new t_epoch(epoTime, obsVector, pseudoObsIono, refSatMap));
121
122 if (_epochs.size() > MAXSIZE) {
123 delete _epochs.front();
124 _epochs.pop_front();
125 }
126}
127
128//
129/////////////////////////////////////////////////////////////////////////////
130void t_pppObsPool::deleteLastEpoch() {
131
132 if (!_epochs.empty()) {
133 delete _epochs.back();
134 _epochs.pop_back();
135 }
136}
Note: See TracBrowser for help on using the repository browser.