[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 |
|
---|
| 19 | using namespace BNC_PPP;
|
---|
| 20 | using namespace std;
|
---|
| 21 |
|
---|
| 22 | // Constructor
|
---|
| 23 | /////////////////////////////////////////////////////////////////////////////
|
---|
[8905] | 24 | t_pppObsPool::t_epoch::t_epoch(const bncTime& epoTime, vector<t_pppSatObs*>& obsVector,
|
---|
| 25 | bool pseudoObsIono) {
|
---|
| 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();
|
---|
| 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 | }
|
---|
[7288] | 48 | for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
|
---|
| 49 | _satPhaseBiases[ii] = 0;
|
---|
| 50 | }
|
---|
[7249] | 51 | _vTec = 0;
|
---|
[8911] | 52 | _refSatChangeRequired = false;
|
---|
[7237] | 53 | }
|
---|
| 54 |
|
---|
| 55 | // Destructor
|
---|
| 56 | /////////////////////////////////////////////////////////////////////////////
|
---|
| 57 | t_pppObsPool::~t_pppObsPool() {
|
---|
| 58 | for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
|
---|
| 59 | delete _satCodeBiases[ii];
|
---|
| 60 | }
|
---|
[7642] | 61 | for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
|
---|
| 62 | delete _satPhaseBiases[ii];
|
---|
| 63 | }
|
---|
[7249] | 64 | delete _vTec;
|
---|
[7237] | 65 | while (_epochs.size() > 0) {
|
---|
| 66 | delete _epochs.front();
|
---|
| 67 | _epochs.pop_front();
|
---|
| 68 | }
|
---|
[8905] | 69 | clearRefSatMap();
|
---|
[7237] | 70 | }
|
---|
| 71 |
|
---|
| 72 | //
|
---|
| 73 | /////////////////////////////////////////////////////////////////////////////
|
---|
| 74 | void t_pppObsPool::putCodeBias(t_satCodeBias* satCodeBias) {
|
---|
| 75 | int iPrn = satCodeBias->_prn.toInt();
|
---|
| 76 | delete _satCodeBiases[iPrn];
|
---|
| 77 | _satCodeBiases[iPrn] = satCodeBias;
|
---|
| 78 | }
|
---|
| 79 |
|
---|
| 80 | //
|
---|
| 81 | /////////////////////////////////////////////////////////////////////////////
|
---|
[7288] | 82 | void t_pppObsPool::putPhaseBias(t_satPhaseBias* satPhaseBias) {
|
---|
| 83 | int iPrn = satPhaseBias->_prn.toInt();
|
---|
| 84 | delete _satPhaseBiases[iPrn];
|
---|
| 85 | _satPhaseBiases[iPrn] = satPhaseBias;
|
---|
| 86 | }
|
---|
| 87 |
|
---|
| 88 | //
|
---|
| 89 | /////////////////////////////////////////////////////////////////////////////
|
---|
[7249] | 90 | void t_pppObsPool::putTec(t_vTec* vTec) {
|
---|
[7643] | 91 | delete _vTec;
|
---|
[7249] | 92 | _vTec = new t_vTec(*vTec);
|
---|
[7643] | 93 | delete vTec;
|
---|
[7249] | 94 | }
|
---|
| 95 |
|
---|
| 96 | //
|
---|
| 97 | /////////////////////////////////////////////////////////////////////////////
|
---|
[8905] | 98 | void t_pppObsPool::putEpoch(const bncTime& epoTime, vector<t_pppSatObs*>& obsVector,
|
---|
| 99 | bool pseudoObsIono) {
|
---|
[7237] | 100 | const unsigned MAXSIZE = 2;
|
---|
[8905] | 101 |
|
---|
[8956] | 102 | _epochs.push_back(new t_epoch(epoTime, obsVector, pseudoObsIono));
|
---|
| 103 |
|
---|
[7237] | 104 | if (_epochs.size() > MAXSIZE) {
|
---|
| 105 | delete _epochs.front();
|
---|
| 106 | _epochs.pop_front();
|
---|
| 107 | }
|
---|
| 108 | }
|
---|
[8956] | 109 |
|
---|
| 110 | //
|
---|
| 111 | /////////////////////////////////////////////////////////////////////////////
|
---|
| 112 | void t_pppObsPool::deleteLastEpoch() {
|
---|
| 113 |
|
---|
| 114 | if (!_epochs.empty()) {
|
---|
| 115 | delete _epochs.back();
|
---|
| 116 | _epochs.pop_back();
|
---|
| 117 | }
|
---|
| 118 | }
|
---|