[7237] | 1 | #ifndef OBSPOOL_H
|
---|
| 2 | #define OBSPOOL_H
|
---|
| 3 |
|
---|
| 4 | #include <vector>
|
---|
| 5 | #include <deque>
|
---|
[8905] | 6 | #include <QMap>
|
---|
[9386] | 7 | #include <iostream>
|
---|
[7237] | 8 | #include "pppSatObs.h"
|
---|
| 9 | #include "bnctime.h"
|
---|
[8905] | 10 | #include "pppRefSat.h"
|
---|
[7237] | 11 |
|
---|
| 12 | namespace BNC_PPP {
|
---|
| 13 |
|
---|
| 14 | class t_pppObsPool {
|
---|
[7288] | 15 | public:
|
---|
[7237] | 16 |
|
---|
| 17 | class t_epoch {
|
---|
| 18 | public:
|
---|
[8905] | 19 | t_epoch(const bncTime& epoTime, std::vector<t_pppSatObs*>& obsVector,
|
---|
| 20 | bool pseudoObsIono);
|
---|
[7237] | 21 | ~t_epoch();
|
---|
[8905] | 22 | std::vector<t_pppSatObs*>& obsVector() {return _obsVector;}
|
---|
[7237] | 23 | const std::vector<t_pppSatObs*>& obsVector() const {return _obsVector;}
|
---|
| 24 | const bncTime& epoTime() const {return _epoTime;}
|
---|
[8905] | 25 | bool pseudoObsIono() const {return _pseudoObsIono;}
|
---|
[7237] | 26 | private:
|
---|
[8905] | 27 | bncTime _epoTime;
|
---|
[7237] | 28 | std::vector<t_pppSatObs*> _obsVector;
|
---|
[8905] | 29 | bool _pseudoObsIono;
|
---|
[7237] | 30 | };
|
---|
| 31 |
|
---|
| 32 | t_pppObsPool();
|
---|
| 33 | ~t_pppObsPool();
|
---|
| 34 | void putCodeBias(t_satCodeBias* satCodeBias);
|
---|
[7288] | 35 | void putPhaseBias(t_satPhaseBias* satPhaseBias);
|
---|
[7249] | 36 | void putTec(t_vTec* _vTec);
|
---|
[7237] | 37 |
|
---|
[8905] | 38 | void putEpoch(const bncTime& epoTime, std::vector<t_pppSatObs*>& obsVector,
|
---|
| 39 | bool pseudoObs);
|
---|
[7237] | 40 |
|
---|
[8956] | 41 | void deleteLastEpoch();
|
---|
| 42 |
|
---|
[7288] | 43 | const t_satCodeBias* satCodeBias(const t_prn& prn) const {
|
---|
[7237] | 44 | return _satCodeBiases[prn.toInt()];
|
---|
| 45 | }
|
---|
[7288] | 46 | const t_satPhaseBias* satPhaseBias(const t_prn& prn) const {
|
---|
| 47 | return _satPhaseBiases[prn.toInt()];
|
---|
| 48 | }
|
---|
[7249] | 49 | const t_vTec* vTec() const {return _vTec;}
|
---|
[7237] | 50 |
|
---|
| 51 | t_epoch* lastEpoch() {
|
---|
| 52 | if (_epochs.size()) {
|
---|
| 53 | return _epochs.back();
|
---|
| 54 | }
|
---|
| 55 | else {
|
---|
| 56 | return 0;
|
---|
| 57 | }
|
---|
| 58 | }
|
---|
| 59 |
|
---|
[9386] | 60 | // RefSatMap of the current epoch
|
---|
| 61 | // ==============================
|
---|
| 62 | void initRefSatMapElement(char system) {_refSatMap[system] = new t_pppRefSat();}
|
---|
[8905] | 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;}
|
---|
[9386] | 72 | t_pppRefSat* getRefSatMapElement(char sys) {return _refSatMap[sys];}
|
---|
[8905] | 73 |
|
---|
[9386] | 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 | };
|
---|
[8905] | 87 | }
|
---|
| 88 |
|
---|
[9386] | 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 | }
|
---|
[8956] | 107 |
|
---|
[9386] | 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 | }
|
---|
[8956] | 126 |
|
---|
[7237] | 127 | private:
|
---|
[8905] | 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;
|
---|
[9386] | 133 | QMap<char, bool> _refSatChangeRequiredMap;
|
---|
| 134 | QMap<char, bool> _refSatChangedMap;
|
---|
| 135 | QMap<char, t_prn> _refSatMapLastEpoch;
|
---|
[7237] | 136 | };
|
---|
| 137 |
|
---|
| 138 | }
|
---|
| 139 |
|
---|
| 140 | #endif
|
---|