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

Last change on this file since 9921 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
RevLine 
[7237]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 *
[7288]13 * Changes:
[7237]14 *
15 * -----------------------------------------------------------------------*/
16
17#include "pppObsPool.h"
18
19using namespace BNC_PPP;
20using namespace std;
21
22// Constructor
23/////////////////////////////////////////////////////////////////////////////
[8905]24t_pppObsPool::t_epoch::t_epoch(const bncTime& epoTime, vector<t_pppSatObs*>& obsVector,
[9508]25 bool pseudoObsIono, const QMap<char, t_pppRefSat*>& refSatMap) {
[8905]26 _epoTime = epoTime;
27 _pseudoObsIono = pseudoObsIono;
[7237]28 for (unsigned ii = 0; ii < obsVector.size(); ii++) {
29 _obsVector.push_back(obsVector[ii]);
30 }
31 obsVector.clear();
[9508]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();
[7237]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 }
[9508]49
50 QMapIterator<char, t_pppRefSat*> it(_refSatMap);
51 while (it.hasNext()) {
52 it.next();
53 delete it.value();
54 }
55 _refSatMap.clear();
[7237]56}
57
58// Constructor
59/////////////////////////////////////////////////////////////////////////////
60t_pppObsPool::t_pppObsPool() {
61 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
62 _satCodeBiases[ii] = 0;
63 }
[7288]64 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
65 _satPhaseBiases[ii] = 0;
66 }
[7249]67 _vTec = 0;
[9386]68 _refSatChangeRequiredMap['G'] = false;
69 _refSatChangeRequiredMap['R'] = false;
70 _refSatChangeRequiredMap['E'] = false;
71 _refSatChangeRequiredMap['C'] = false;
72
[7237]73}
74
75// Destructor
76/////////////////////////////////////////////////////////////////////////////
77t_pppObsPool::~t_pppObsPool() {
78 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
79 delete _satCodeBiases[ii];
80 }
[7642]81 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
82 delete _satPhaseBiases[ii];
83 }
[7249]84 delete _vTec;
[7237]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/////////////////////////////////////////////////////////////////////////////
[7288]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/////////////////////////////////////////////////////////////////////////////
[7249]109void t_pppObsPool::putTec(t_vTec* vTec) {
[7643]110 delete _vTec;
[7249]111 _vTec = new t_vTec(*vTec);
[7643]112 delete vTec;
[7249]113}
114
115//
116/////////////////////////////////////////////////////////////////////////////
[8905]117void t_pppObsPool::putEpoch(const bncTime& epoTime, vector<t_pppSatObs*>& obsVector,
[9508]118 bool pseudoObsIono, const QMap<char, t_pppRefSat*>& refSatMap) {
[7237]119 const unsigned MAXSIZE = 2;
[9508]120 _epochs.push_back(new t_epoch(epoTime, obsVector, pseudoObsIono, refSatMap));
[8905]121
[7237]122 if (_epochs.size() > MAXSIZE) {
123 delete _epochs.front();
124 _epochs.pop_front();
125 }
126}
[8956]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.