[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,
|
---|
[9508] | 20 | bool pseudoObsIono, const QMap<char, t_pppRefSat*>& refSatMap);
|
---|
[7237] | 21 | ~t_epoch();
|
---|
[8905] | 22 | std::vector<t_pppSatObs*>& obsVector() {return _obsVector;}
|
---|
[7237] | 23 | const std::vector<t_pppSatObs*>& obsVector() const {return _obsVector;}
|
---|
[9508] | 24 | const QMap<char, t_pppRefSat*>& refSatMap() const {return _refSatMap;}
|
---|
[7237] | 25 | const bncTime& epoTime() const {return _epoTime;}
|
---|
[8905] | 26 | bool pseudoObsIono() const {return _pseudoObsIono;}
|
---|
[7237] | 27 | private:
|
---|
[8905] | 28 | bncTime _epoTime;
|
---|
[9508] | 29 | bool _pseudoObsIono;
|
---|
[7237] | 30 | std::vector<t_pppSatObs*> _obsVector;
|
---|
[9508] | 31 | QMap<char, t_pppRefSat*> _refSatMap;
|
---|
[7237] | 32 | };
|
---|
| 33 |
|
---|
| 34 | t_pppObsPool();
|
---|
| 35 | ~t_pppObsPool();
|
---|
| 36 | void putCodeBias(t_satCodeBias* satCodeBias);
|
---|
[7288] | 37 | void putPhaseBias(t_satPhaseBias* satPhaseBias);
|
---|
[7249] | 38 | void putTec(t_vTec* _vTec);
|
---|
[7237] | 39 |
|
---|
[8905] | 40 | void putEpoch(const bncTime& epoTime, std::vector<t_pppSatObs*>& obsVector,
|
---|
[9508] | 41 | bool pseudoObsIono, const QMap<char, t_pppRefSat*>& refSatMap);
|
---|
[7237] | 42 |
|
---|
[8956] | 43 | void deleteLastEpoch();
|
---|
| 44 |
|
---|
[7288] | 45 | const t_satCodeBias* satCodeBias(const t_prn& prn) const {
|
---|
[7237] | 46 | return _satCodeBiases[prn.toInt()];
|
---|
| 47 | }
|
---|
[7288] | 48 | const t_satPhaseBias* satPhaseBias(const t_prn& prn) const {
|
---|
| 49 | return _satPhaseBiases[prn.toInt()];
|
---|
| 50 | }
|
---|
[7249] | 51 | const t_vTec* vTec() const {return _vTec;}
|
---|
[7237] | 52 |
|
---|
| 53 | t_epoch* lastEpoch() {
|
---|
| 54 | if (_epochs.size()) {
|
---|
| 55 | return _epochs.back();
|
---|
| 56 | }
|
---|
| 57 | else {
|
---|
| 58 | return 0;
|
---|
| 59 | }
|
---|
| 60 | }
|
---|
| 61 |
|
---|
[9386] | 62 | // RefSat change required in current epoch
|
---|
| 63 | // =======================================
|
---|
| 64 | void setRefSatChangeRequired(char sys, bool refSatChangeRequired) {
|
---|
| 65 | _refSatChangeRequiredMap[sys] = refSatChangeRequired;
|
---|
| 66 | }
|
---|
| 67 | bool refSatChangeRequired() {
|
---|
| 68 | QMapIterator<char, bool> it(_refSatChangeRequiredMap);
|
---|
| 69 | while (it.hasNext()) {
|
---|
| 70 | it.next();
|
---|
| 71 | if (it.value() == true) {
|
---|
| 72 | return true;
|
---|
| 73 | }
|
---|
| 74 | }
|
---|
| 75 | return false;
|
---|
| 76 | }
|
---|
| 77 | bool refSatChangeRequired(char sys) {
|
---|
| 78 | return _refSatChangeRequiredMap[sys];
|
---|
| 79 | }
|
---|
[8956] | 80 |
|
---|
[9386] | 81 | // RefSat changed in current epoch (different from last epoch)
|
---|
| 82 | // ===========================================================
|
---|
| 83 | void setRefSatChanged(char sys, bool refSatChanged) {
|
---|
| 84 | _refSatChangedMap[sys] = refSatChanged;
|
---|
| 85 | }
|
---|
| 86 | bool refSatChanged() {
|
---|
| 87 | QMapIterator<char, bool> it(_refSatChangedMap);
|
---|
| 88 | while (it.hasNext()) {
|
---|
| 89 | it.next();
|
---|
| 90 | if (it.value() == true) {
|
---|
| 91 | return true;
|
---|
| 92 | }
|
---|
| 93 | }
|
---|
| 94 | return false;
|
---|
| 95 | }
|
---|
| 96 | bool refSatChanged(char sys) {
|
---|
| 97 | return _refSatChangedMap[sys];
|
---|
| 98 | }
|
---|
[8956] | 99 |
|
---|
[7237] | 100 | private:
|
---|
[8905] | 101 | t_satCodeBias* _satCodeBiases[t_prn::MAXPRN+1];
|
---|
| 102 | t_satPhaseBias* _satPhaseBiases[t_prn::MAXPRN+1];
|
---|
| 103 | t_vTec* _vTec;
|
---|
| 104 | std::deque<t_epoch*> _epochs;
|
---|
[9386] | 105 | QMap<char, bool> _refSatChangeRequiredMap;
|
---|
| 106 | QMap<char, bool> _refSatChangedMap;
|
---|
[7237] | 107 | };
|
---|
| 108 |
|
---|
| 109 | }
|
---|
| 110 |
|
---|
| 111 | #endif
|
---|