[5743] | 1 | /* -------------------------------------------------------------------------
|
---|
| 2 | * BKG NTRIP Client
|
---|
| 3 | * -------------------------------------------------------------------------
|
---|
| 4 | *
|
---|
[5828] | 5 | * Class: t_pppObsPool
|
---|
[5743] | 6 | *
|
---|
| 7 | * Purpose: Buffer with observations
|
---|
| 8 | *
|
---|
| 9 | * Author: L. Mervart
|
---|
| 10 | *
|
---|
| 11 | * Created: 29-Jul-2014
|
---|
| 12 | *
|
---|
| 13 | * Changes:
|
---|
| 14 | *
|
---|
| 15 | * -----------------------------------------------------------------------*/
|
---|
| 16 |
|
---|
[5810] | 17 | #include "pppObsPool.h"
|
---|
[5743] | 18 |
|
---|
[5814] | 19 | using namespace BNC_PPP;
|
---|
[5743] | 20 | using namespace std;
|
---|
| 21 |
|
---|
| 22 | // Constructor
|
---|
| 23 | /////////////////////////////////////////////////////////////////////////////
|
---|
[5826] | 24 | t_pppObsPool::t_epoch::t_epoch(const bncTime& epoTime, vector<t_pppSatObs*>& obsVector) {
|
---|
[5743] | 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 | /////////////////////////////////////////////////////////////////////////////
|
---|
[5826] | 34 | t_pppObsPool::t_epoch::~t_epoch() {
|
---|
[5743] | 35 | for (unsigned ii = 0; ii < _obsVector.size(); ii++) {
|
---|
| 36 | delete _obsVector[ii];
|
---|
| 37 | }
|
---|
| 38 | }
|
---|
| 39 |
|
---|
| 40 | // Constructor
|
---|
| 41 | /////////////////////////////////////////////////////////////////////////////
|
---|
[5826] | 42 | t_pppObsPool::t_pppObsPool() {
|
---|
[5743] | 43 | for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
|
---|
[6463] | 44 | _satCodeBiases[ii] = 0;
|
---|
[5743] | 45 | }
|
---|
| 46 | }
|
---|
| 47 |
|
---|
| 48 | // Destructor
|
---|
| 49 | /////////////////////////////////////////////////////////////////////////////
|
---|
[5826] | 50 | t_pppObsPool::~t_pppObsPool() {
|
---|
[5743] | 51 | for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
|
---|
[6463] | 52 | delete _satCodeBiases[ii];
|
---|
[5743] | 53 | }
|
---|
| 54 | while (_epochs.size() > 0) {
|
---|
| 55 | delete _epochs.front();
|
---|
| 56 | _epochs.pop_front();
|
---|
| 57 | }
|
---|
| 58 | }
|
---|
| 59 |
|
---|
| 60 | //
|
---|
| 61 | /////////////////////////////////////////////////////////////////////////////
|
---|
[6463] | 62 | void t_pppObsPool::putCodeBias(t_satCodeBias* satCodeBias) {
|
---|
| 63 | int iPrn = satCodeBias->_prn.toInt();
|
---|
| 64 | delete _satCodeBiases[iPrn];
|
---|
| 65 | _satCodeBiases[iPrn] = satCodeBias;
|
---|
[5743] | 66 | }
|
---|
| 67 |
|
---|
| 68 | //
|
---|
| 69 | /////////////////////////////////////////////////////////////////////////////
|
---|
[5826] | 70 | void t_pppObsPool::putEpoch(const bncTime& epoTime, vector<t_pppSatObs*>& obsVector) {
|
---|
[5743] | 71 | const unsigned MAXSIZE = 2;
|
---|
| 72 | _epochs.push_back(new t_epoch(epoTime, obsVector));
|
---|
| 73 | if (_epochs.size() > MAXSIZE) {
|
---|
| 74 | delete _epochs.front();
|
---|
| 75 | _epochs.pop_front();
|
---|
| 76 | }
|
---|
| 77 | }
|
---|