[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 | /////////////////////////////////////////////////////////////////////////////
|
---|
| 24 | t_pppObsPool::t_epoch::t_epoch(const bncTime& epoTime, vector<t_pppSatObs*>& obsVector) {
|
---|
| 25 | _epoTime = epoTime;
|
---|
| 26 | for (unsigned ii = 0; ii < obsVector.size(); ii++) {
|
---|
| 27 | _obsVector.push_back(obsVector[ii]);
|
---|
| 28 | }
|
---|
| 29 | obsVector.clear();
|
---|
| 30 | }
|
---|
| 31 |
|
---|
| 32 | // Destructor
|
---|
| 33 | /////////////////////////////////////////////////////////////////////////////
|
---|
| 34 | t_pppObsPool::t_epoch::~t_epoch() {
|
---|
| 35 | for (unsigned ii = 0; ii < _obsVector.size(); ii++) {
|
---|
| 36 | delete _obsVector[ii];
|
---|
| 37 | }
|
---|
| 38 | }
|
---|
| 39 |
|
---|
| 40 | // Constructor
|
---|
| 41 | /////////////////////////////////////////////////////////////////////////////
|
---|
| 42 | t_pppObsPool::t_pppObsPool() {
|
---|
| 43 | for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
|
---|
| 44 | _satCodeBiases[ii] = 0;
|
---|
| 45 | }
|
---|
[7288] | 46 | for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
|
---|
| 47 | _satPhaseBiases[ii] = 0;
|
---|
| 48 | }
|
---|
[7249] | 49 | _vTec = 0;
|
---|
[7237] | 50 | }
|
---|
| 51 |
|
---|
| 52 | // Destructor
|
---|
| 53 | /////////////////////////////////////////////////////////////////////////////
|
---|
| 54 | t_pppObsPool::~t_pppObsPool() {
|
---|
| 55 | for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
|
---|
| 56 | delete _satCodeBiases[ii];
|
---|
| 57 | }
|
---|
[7642] | 58 | for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
|
---|
| 59 | delete _satPhaseBiases[ii];
|
---|
| 60 | }
|
---|
[7249] | 61 | delete _vTec;
|
---|
[7237] | 62 | while (_epochs.size() > 0) {
|
---|
| 63 | delete _epochs.front();
|
---|
| 64 | _epochs.pop_front();
|
---|
| 65 | }
|
---|
| 66 | }
|
---|
| 67 |
|
---|
| 68 | //
|
---|
| 69 | /////////////////////////////////////////////////////////////////////////////
|
---|
| 70 | void t_pppObsPool::putCodeBias(t_satCodeBias* satCodeBias) {
|
---|
| 71 | int iPrn = satCodeBias->_prn.toInt();
|
---|
| 72 | delete _satCodeBiases[iPrn];
|
---|
| 73 | _satCodeBiases[iPrn] = satCodeBias;
|
---|
| 74 | }
|
---|
| 75 |
|
---|
| 76 | //
|
---|
| 77 | /////////////////////////////////////////////////////////////////////////////
|
---|
[7288] | 78 | void t_pppObsPool::putPhaseBias(t_satPhaseBias* satPhaseBias) {
|
---|
| 79 | int iPrn = satPhaseBias->_prn.toInt();
|
---|
| 80 | delete _satPhaseBiases[iPrn];
|
---|
| 81 | _satPhaseBiases[iPrn] = satPhaseBias;
|
---|
| 82 | }
|
---|
| 83 |
|
---|
| 84 | //
|
---|
| 85 | /////////////////////////////////////////////////////////////////////////////
|
---|
[7249] | 86 | void t_pppObsPool::putTec(t_vTec* vTec) {
|
---|
[7643] | 87 | delete _vTec;
|
---|
[7249] | 88 | _vTec = new t_vTec(*vTec);
|
---|
[7643] | 89 | delete vTec;
|
---|
[7249] | 90 | }
|
---|
| 91 |
|
---|
| 92 | //
|
---|
| 93 | /////////////////////////////////////////////////////////////////////////////
|
---|
[7237] | 94 | void t_pppObsPool::putEpoch(const bncTime& epoTime, vector<t_pppSatObs*>& obsVector) {
|
---|
| 95 | const unsigned MAXSIZE = 2;
|
---|
| 96 | _epochs.push_back(new t_epoch(epoTime, obsVector));
|
---|
| 97 | if (_epochs.size() > MAXSIZE) {
|
---|
| 98 | delete _epochs.front();
|
---|
| 99 | _epochs.pop_front();
|
---|
| 100 | }
|
---|
| 101 | }
|
---|