source: ntrip/trunk/BNC/src/PPP/pppObsPool.cpp@ 10076

Last change on this file since 10076 was 10034, checked in by stuerze, 20 months ago
  • Property svn:keywords set to Author Date Id Rev URL;svn:eol-style=native
  • Property svn:mime-type set to text/plain
File size: 2.9 KB
RevLine 
[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
19using namespace BNC_PPP;
20using namespace std;
21
22// Constructor
23/////////////////////////////////////////////////////////////////////////////
[8905]24t_pppObsPool::t_epoch::t_epoch(const bncTime& epoTime, vector<t_pppSatObs*>& obsVector,
[10034]25 bool pseudoObsIono) {
[8905]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/////////////////////////////////////////////////////////////////////////////
36t_pppObsPool::t_epoch::~t_epoch() {
37 for (unsigned ii = 0; ii < _obsVector.size(); ii++) {
38 delete _obsVector[ii];
39 }
40}
41
42// Constructor
43/////////////////////////////////////////////////////////////////////////////
44t_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;
[7237]52}
53
54// Destructor
55/////////////////////////////////////////////////////////////////////////////
56t_pppObsPool::~t_pppObsPool() {
57 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
58 delete _satCodeBiases[ii];
59 }
[7642]60 for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
61 delete _satPhaseBiases[ii];
62 }
[7249]63 delete _vTec;
[7237]64 while (_epochs.size() > 0) {
65 delete _epochs.front();
66 _epochs.pop_front();
67 }
68}
69
70//
71/////////////////////////////////////////////////////////////////////////////
72void t_pppObsPool::putCodeBias(t_satCodeBias* satCodeBias) {
73 int iPrn = satCodeBias->_prn.toInt();
74 delete _satCodeBiases[iPrn];
75 _satCodeBiases[iPrn] = satCodeBias;
76}
77
78//
79/////////////////////////////////////////////////////////////////////////////
[7288]80void t_pppObsPool::putPhaseBias(t_satPhaseBias* satPhaseBias) {
81 int iPrn = satPhaseBias->_prn.toInt();
82 delete _satPhaseBiases[iPrn];
83 _satPhaseBiases[iPrn] = satPhaseBias;
84}
85
86//
87/////////////////////////////////////////////////////////////////////////////
[7249]88void t_pppObsPool::putTec(t_vTec* vTec) {
[7643]89 delete _vTec;
[7249]90 _vTec = new t_vTec(*vTec);
[7643]91 delete vTec;
[7249]92}
93
94//
95/////////////////////////////////////////////////////////////////////////////
[8905]96void t_pppObsPool::putEpoch(const bncTime& epoTime, vector<t_pppSatObs*>& obsVector,
[10034]97 bool pseudoObsIono) {
[7237]98 const unsigned MAXSIZE = 2;
[10034]99 _epochs.push_back(new t_epoch(epoTime, obsVector, pseudoObsIono));
[8905]100
[7237]101 if (_epochs.size() > MAXSIZE) {
102 delete _epochs.front();
103 _epochs.pop_front();
104 }
105}
Note: See TracBrowser for help on using the repository browser.