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 | _refSatChangeRequiredMap['G'] = false;
|
---|
53 | _refSatChangeRequiredMap['R'] = false;
|
---|
54 | _refSatChangeRequiredMap['E'] = false;
|
---|
55 | _refSatChangeRequiredMap['C'] = false;
|
---|
56 |
|
---|
57 | }
|
---|
58 |
|
---|
59 | // Destructor
|
---|
60 | /////////////////////////////////////////////////////////////////////////////
|
---|
61 | t_pppObsPool::~t_pppObsPool() {
|
---|
62 | for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
|
---|
63 | delete _satCodeBiases[ii];
|
---|
64 | }
|
---|
65 | for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
|
---|
66 | delete _satPhaseBiases[ii];
|
---|
67 | }
|
---|
68 | delete _vTec;
|
---|
69 | while (_epochs.size() > 0) {
|
---|
70 | delete _epochs.front();
|
---|
71 | _epochs.pop_front();
|
---|
72 | }
|
---|
73 | clearRefSatMap();
|
---|
74 | }
|
---|
75 |
|
---|
76 | //
|
---|
77 | /////////////////////////////////////////////////////////////////////////////
|
---|
78 | void t_pppObsPool::putCodeBias(t_satCodeBias* satCodeBias) {
|
---|
79 | int iPrn = satCodeBias->_prn.toInt();
|
---|
80 | delete _satCodeBiases[iPrn];
|
---|
81 | _satCodeBiases[iPrn] = satCodeBias;
|
---|
82 | }
|
---|
83 |
|
---|
84 | //
|
---|
85 | /////////////////////////////////////////////////////////////////////////////
|
---|
86 | void t_pppObsPool::putPhaseBias(t_satPhaseBias* satPhaseBias) {
|
---|
87 | int iPrn = satPhaseBias->_prn.toInt();
|
---|
88 | delete _satPhaseBiases[iPrn];
|
---|
89 | _satPhaseBiases[iPrn] = satPhaseBias;
|
---|
90 | }
|
---|
91 |
|
---|
92 | //
|
---|
93 | /////////////////////////////////////////////////////////////////////////////
|
---|
94 | void t_pppObsPool::putTec(t_vTec* vTec) {
|
---|
95 | delete _vTec;
|
---|
96 | _vTec = new t_vTec(*vTec);
|
---|
97 | delete vTec;
|
---|
98 | }
|
---|
99 |
|
---|
100 | //
|
---|
101 | /////////////////////////////////////////////////////////////////////////////
|
---|
102 | void t_pppObsPool::putEpoch(const bncTime& epoTime, vector<t_pppSatObs*>& obsVector,
|
---|
103 | bool pseudoObsIono) {
|
---|
104 | const unsigned MAXSIZE = 2;
|
---|
105 |
|
---|
106 | _epochs.push_back(new t_epoch(epoTime, obsVector, pseudoObsIono));
|
---|
107 |
|
---|
108 | if (_epochs.size() > MAXSIZE) {
|
---|
109 | delete _epochs.front();
|
---|
110 | _epochs.pop_front();
|
---|
111 | }
|
---|
112 | }
|
---|
113 |
|
---|
114 | //
|
---|
115 | /////////////////////////////////////////////////////////////////////////////
|
---|
116 | void t_pppObsPool::deleteLastEpoch() {
|
---|
117 |
|
---|
118 | if (!_epochs.empty()) {
|
---|
119 | delete _epochs.back();
|
---|
120 | _epochs.pop_back();
|
---|
121 | }
|
---|
122 | }
|
---|