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 |
|
---|
19 | using namespace BNC_PPP;
|
---|
20 | using namespace std;
|
---|
21 |
|
---|
22 | // Constructor
|
---|
23 | /////////////////////////////////////////////////////////////////////////////
|
---|
24 | t_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 | /////////////////////////////////////////////////////////////////////////////
|
---|
36 | t_pppObsPool::t_epoch::~t_epoch() {
|
---|
37 | for (unsigned ii = 0; ii < _obsVector.size(); ii++) {
|
---|
38 | delete _obsVector[ii];
|
---|
39 | }
|
---|
40 | }
|
---|
41 |
|
---|
42 | // Constructor
|
---|
43 | /////////////////////////////////////////////////////////////////////////////
|
---|
44 | t_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 | }
|
---|
53 |
|
---|
54 | // Destructor
|
---|
55 | /////////////////////////////////////////////////////////////////////////////
|
---|
56 | t_pppObsPool::~t_pppObsPool() {
|
---|
57 | for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
|
---|
58 | delete _satCodeBiases[ii];
|
---|
59 | }
|
---|
60 | for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
|
---|
61 | delete _satPhaseBiases[ii];
|
---|
62 | }
|
---|
63 | delete _vTec;
|
---|
64 | while (_epochs.size() > 0) {
|
---|
65 | delete _epochs.front();
|
---|
66 | _epochs.pop_front();
|
---|
67 | }
|
---|
68 | }
|
---|
69 |
|
---|
70 | //
|
---|
71 | /////////////////////////////////////////////////////////////////////////////
|
---|
72 | void t_pppObsPool::putCodeBias(t_satCodeBias* satCodeBias) {
|
---|
73 | int iPrn = satCodeBias->_prn.toInt();
|
---|
74 | delete _satCodeBiases[iPrn];
|
---|
75 | _satCodeBiases[iPrn] = satCodeBias;
|
---|
76 | }
|
---|
77 |
|
---|
78 | //
|
---|
79 | /////////////////////////////////////////////////////////////////////////////
|
---|
80 | void t_pppObsPool::putPhaseBias(t_satPhaseBias* satPhaseBias) {
|
---|
81 | int iPrn = satPhaseBias->_prn.toInt();
|
---|
82 | delete _satPhaseBiases[iPrn];
|
---|
83 | _satPhaseBiases[iPrn] = satPhaseBias;
|
---|
84 | }
|
---|
85 |
|
---|
86 | //
|
---|
87 | /////////////////////////////////////////////////////////////////////////////
|
---|
88 | void t_pppObsPool::putTec(t_vTec* vTec) {
|
---|
89 | delete _vTec;
|
---|
90 | _vTec = new t_vTec(*vTec);
|
---|
91 | delete vTec;
|
---|
92 | }
|
---|
93 |
|
---|
94 | //
|
---|
95 | /////////////////////////////////////////////////////////////////////////////
|
---|
96 | void t_pppObsPool::putEpoch(const bncTime& epoTime, vector<t_pppSatObs*>& obsVector,
|
---|
97 | bool pseudoObsIono) {
|
---|
98 | const unsigned MAXSIZE = 2;
|
---|
99 | _epochs.push_back(new t_epoch(epoTime, obsVector, pseudoObsIono));
|
---|
100 |
|
---|
101 | if (_epochs.size() > MAXSIZE) {
|
---|
102 | delete _epochs.front();
|
---|
103 | _epochs.pop_front();
|
---|
104 | }
|
---|
105 | }
|
---|