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

Last change on this file since 8956 was 8956, checked in by stuerze, 2 years ago

update 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.1 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) {
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
34// Destructor
35/////////////////////////////////////////////////////////////////////////////
36t_pppObsPool::t_epoch::~t_epoch() {
37 for (unsigned ii = 0; ii < _obsVector.size(); ii++) {
38 delete _obsVector[ii];
39 }
40}
41
42// Constructor
43/////////////////////////////////////////////////////////////////////////////
44t_pppObsPool::t_pppObsPool() {
45 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
46 _satCodeBiases[ii] = 0;
47 }
48 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
49 _satPhaseBiases[ii] = 0;
50 }
51 _vTec = 0;
52 _refSatChangeRequired = false;
53}
54
55// Destructor
56/////////////////////////////////////////////////////////////////////////////
57t_pppObsPool::~t_pppObsPool() {
58 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
59 delete _satCodeBiases[ii];
60 }
61 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
62 delete _satPhaseBiases[ii];
63 }
64 delete _vTec;
65 while (_epochs.size() > 0) {
66 delete _epochs.front();
67 _epochs.pop_front();
68 }
69 clearRefSatMap();
70}
71
72//
73/////////////////////////////////////////////////////////////////////////////
74void t_pppObsPool::putCodeBias(t_satCodeBias* satCodeBias) {
75 int iPrn = satCodeBias->_prn.toInt();
76 delete _satCodeBiases[iPrn];
77 _satCodeBiases[iPrn] = satCodeBias;
78}
79
80//
81/////////////////////////////////////////////////////////////////////////////
82void t_pppObsPool::putPhaseBias(t_satPhaseBias* satPhaseBias) {
83 int iPrn = satPhaseBias->_prn.toInt();
84 delete _satPhaseBiases[iPrn];
85 _satPhaseBiases[iPrn] = satPhaseBias;
86}
87
88//
89/////////////////////////////////////////////////////////////////////////////
90void t_pppObsPool::putTec(t_vTec* vTec) {
91 delete _vTec;
92 _vTec = new t_vTec(*vTec);
93 delete vTec;
94}
95
96//
97/////////////////////////////////////////////////////////////////////////////
98void t_pppObsPool::putEpoch(const bncTime& epoTime, vector<t_pppSatObs*>& obsVector,
99 bool pseudoObsIono) {
100 const unsigned MAXSIZE = 2;
101
102 _epochs.push_back(new t_epoch(epoTime, obsVector, pseudoObsIono));
103
104 if (_epochs.size() > MAXSIZE) {
105 delete _epochs.front();
106 _epochs.pop_front();
107 }
108}
109
110//
111/////////////////////////////////////////////////////////////////////////////
112void t_pppObsPool::deleteLastEpoch() {
113
114 if (!_epochs.empty()) {
115 delete _epochs.back();
116 _epochs.pop_back();
117 }
118}
Note: See TracBrowser for help on using the repository browser.