source: ntrip/trunk/BNC/src/PPP/pppObsPool.h@ 9497

Last change on this file since 9497 was 9386, checked in by stuerze, 3 years ago

update regarding PPP

  • Property svn:keywords set to Author Date Id Rev URL;svn:eol-style=native
  • Property svn:mime-type set to text/plain
File size: 3.9 KB
Line 
1#ifndef OBSPOOL_H
2#define OBSPOOL_H
3
4#include <vector>
5#include <deque>
6#include <QMap>
7#include <iostream>
8#include "pppSatObs.h"
9#include "bnctime.h"
10#include "pppRefSat.h"
11
12namespace BNC_PPP {
13
14class t_pppObsPool {
15 public:
16
17 class t_epoch {
18 public:
19 t_epoch(const bncTime& epoTime, std::vector<t_pppSatObs*>& obsVector,
20 bool pseudoObsIono);
21 ~t_epoch();
22 std::vector<t_pppSatObs*>& obsVector() {return _obsVector;}
23 const std::vector<t_pppSatObs*>& obsVector() const {return _obsVector;}
24 const bncTime& epoTime() const {return _epoTime;}
25 bool pseudoObsIono() const {return _pseudoObsIono;}
26 private:
27 bncTime _epoTime;
28 std::vector<t_pppSatObs*> _obsVector;
29 bool _pseudoObsIono;
30 };
31
32 t_pppObsPool();
33 ~t_pppObsPool();
34 void putCodeBias(t_satCodeBias* satCodeBias);
35 void putPhaseBias(t_satPhaseBias* satPhaseBias);
36 void putTec(t_vTec* _vTec);
37
38 void putEpoch(const bncTime& epoTime, std::vector<t_pppSatObs*>& obsVector,
39 bool pseudoObs);
40
41 void deleteLastEpoch();
42
43 const t_satCodeBias* satCodeBias(const t_prn& prn) const {
44 return _satCodeBiases[prn.toInt()];
45 }
46 const t_satPhaseBias* satPhaseBias(const t_prn& prn) const {
47 return _satPhaseBiases[prn.toInt()];
48 }
49 const t_vTec* vTec() const {return _vTec;}
50
51 t_epoch* lastEpoch() {
52 if (_epochs.size()) {
53 return _epochs.back();
54 }
55 else {
56 return 0;
57 }
58 }
59
60 // RefSatMap of the current epoch
61 // ==============================
62 void initRefSatMapElement(char system) {_refSatMap[system] = new t_pppRefSat();}
63 void clearRefSatMap() {
64 QMapIterator<char, t_pppRefSat*> it(_refSatMap);
65 while (it.hasNext()) {
66 it.next();
67 delete it.value();
68 }
69 _refSatMap.clear();
70 }
71 QMap<char, t_pppRefSat*> getRefSatMap() {return _refSatMap;}
72 t_pppRefSat* getRefSatMapElement(char sys) {return _refSatMap[sys];}
73
74
75 // RefSatMap of the last epoch
76 // ===========================
77 QMap<char, t_prn> getRefSatMapLastEpoch() {return _refSatMapLastEpoch;}
78 t_prn getRefSatMapElementLastEpoch(char sys) {return _refSatMapLastEpoch[sys];}
79 void setRefSatMapElementLastEpoch(char sys, t_prn prn) {_refSatMapLastEpoch[sys] = prn;}
80 void saveLastEpoRefSats() {
81 QMapIterator<char, t_pppRefSat*> it(getRefSatMap());
82 while (it.hasNext()) {
83 it.next();
84 t_prn prn = it.value()->prn();
85 setRefSatMapElementLastEpoch(prn.system(), prn);
86 };
87 }
88
89 // RefSat change required in current epoch
90 // =======================================
91 void setRefSatChangeRequired(char sys, bool refSatChangeRequired) {
92 _refSatChangeRequiredMap[sys] = refSatChangeRequired;
93 }
94 bool refSatChangeRequired() {
95 QMapIterator<char, bool> it(_refSatChangeRequiredMap);
96 while (it.hasNext()) {
97 it.next();
98 if (it.value() == true) {
99 return true;
100 }
101 }
102 return false;
103 }
104 bool refSatChangeRequired(char sys) {
105 return _refSatChangeRequiredMap[sys];
106 }
107
108 // RefSat changed in current epoch (different from last epoch)
109 // ===========================================================
110 void setRefSatChanged(char sys, bool refSatChanged) {
111 _refSatChangedMap[sys] = refSatChanged;
112 }
113 bool refSatChanged() {
114 QMapIterator<char, bool> it(_refSatChangedMap);
115 while (it.hasNext()) {
116 it.next();
117 if (it.value() == true) {
118 return true;
119 }
120 }
121 return false;
122 }
123 bool refSatChanged(char sys) {
124 return _refSatChangedMap[sys];
125 }
126
127 private:
128 t_satCodeBias* _satCodeBiases[t_prn::MAXPRN+1];
129 t_satPhaseBias* _satPhaseBiases[t_prn::MAXPRN+1];
130 t_vTec* _vTec;
131 std::deque<t_epoch*> _epochs;
132 QMap<char, t_pppRefSat*> _refSatMap;
133 QMap<char, bool> _refSatChangeRequiredMap;
134 QMap<char, bool> _refSatChangedMap;
135 QMap<char, t_prn> _refSatMapLastEpoch;
136};
137
138}
139
140#endif
Note: See TracBrowser for help on using the repository browser.