Changeset 6017 in ntrip for trunk/BNC/src/PPP
- Timestamp:
- Aug 21, 2014, 8:44:50 AM (11 years ago)
- Location:
- trunk/BNC/src/PPP
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/BNC/src/PPP/pppInclude.h ¶
r6016 r6017 38 38 public: 39 39 t_frqObs() { 40 _freq = 0.0; 40 41 _code = 0.0; 41 42 _codeValid = false; … … 51 52 } 52 53 std::string _rnxType2ch; 54 double _freq; 53 55 double _code; 54 56 bool _codeValid; … … 122 124 }; 123 125 124 class t_frequency {125 public:126 enum type {dummy = 0, G1, G2, G5, R1, R2,127 E1, // E1 / 1575.42128 E5, // E5a / 1176.45129 E7, // E5b / 1207.140130 E8, // E5(E5a+E5b) / 1191.795131 E6, // E6 / 1278.75132 maxFr};133 134 static std::string toString(type tt) {135 if (tt == G1) return "G1";136 else if (tt == G2) return "G2";137 else if (tt == G5) return "G5";138 else if (tt == R1) return "R1";139 else if (tt == R2) return "R2";140 else if (tt == E1) return "E1";141 else if (tt == E5) return "E5";142 else if (tt == E6) return "E6";143 else if (tt == E7) return "E7";144 else if (tt == E8) return "E8";145 return std::string();146 }147 };148 149 150 126 class t_lc { 151 127 public: -
TabularUnified trunk/BNC/src/PPP/pppSatObs.cpp ¶
r6015 r6017 59 59 //////////////////////////////////////////////////////////////////////////// 60 60 t_pppSatObs::t_pppSatObs(const t_satObs& pppSatObs) { 61 _prn = pppSatObs._prn; 62 _time = pppSatObs._time; 63 _outlier 64 for (unsigned ii = 0; ii < pppSatObs._obs.size(); ii++) {65 _ allObs.push_back(new t_frqObs(*pppSatObs._obs[ii]));66 } 67 prepareObs(); 61 _prn = pppSatObs._prn; 62 _time = pppSatObs._time; 63 _outlier = false; 64 for (unsigned ii = 0; ii < t_frequency::max; ii++) { 65 _obs[ii] = 0; 66 } 67 prepareObs(pppSatObs); 68 68 } 69 69 … … 71 71 //////////////////////////////////////////////////////////////////////////// 72 72 t_pppSatObs::~t_pppSatObs() { 73 for (unsigned ii = 0; ii < _allObs.size(); ii++) { 74 delete _allObs[ii]; 75 } 76 } 77 78 // 79 //////////////////////////////////////////////////////////////////////////// 80 void t_pppSatObs::prepareObs() { 73 for (unsigned iFreq = 1; iFreq < t_frequency::max; iFreq++) { 74 delete _obs[iFreq]; 75 } 76 } 77 78 // 79 //////////////////////////////////////////////////////////////////////////// 80 void t_pppSatObs::prepareObs(const t_satObs& pppSatObs) { 81 81 82 _model.reset(); 82 _valid = true; 83 _validObs1 = 0; 84 _validObs2 = 0; 85 86 bool dualFreq = OPT->dualFreqRequired(_prn.system()); 87 88 // Select two pseudoranges and two phase observations 89 // -------------------------------------------------- 83 84 // Select pseudoranges and phase observations 85 // ------------------------------------------ 90 86 const string preferredAttrib = "CWP_"; 91 for (unsigned iPref = 0; iPref < preferredAttrib.length(); iPref++) { 92 string obsType1 = (preferredAttrib[iPref] == '_') ? string("1") : string("1") + preferredAttrib[iPref]; 93 string obsType2 = (preferredAttrib[iPref] == '_') ? string("2") : string("2") + preferredAttrib[iPref]; 94 if (_validObs1 == 0) { 95 for (unsigned ii = 0; ii < _allObs.size(); ii++) { 96 t_frqObs* obs = _allObs[ii]; 97 if (obs->_rnxType2ch == obsType1 && obs->_codeValid && obs->_phaseValid) { 98 _validObs1 = obs; 99 } 100 } 101 } 102 if (dualFreq) { 103 if (_validObs2 == 0) { 104 for (unsigned ii = 0; ii < _allObs.size(); ii++) { 105 t_frqObs* obs = _allObs[ii]; 106 if (obs->_rnxType2ch == obsType2 && obs->_codeValid && obs->_phaseValid) { 107 _validObs2 = obs; 87 88 for (unsigned iFreq = 1; iFreq < t_frequency::max; iFreq++) { 89 string frqNum = t_frequency::toString(t_frequency::type(iFreq)).substr(1); 90 for (unsigned iPref = 0; iPref < preferredAttrib.length(); iPref++) { 91 string obsType = (preferredAttrib[iPref] == '_') ? frqNum : frqNum + preferredAttrib[iPref]; 92 if (_obs[iFreq] == 0) { 93 for (unsigned ii = 0; ii < pppSatObs._obs.size(); ii++) { 94 const t_frqObs* obs = pppSatObs._obs[ii]; 95 if (obs->_rnxType2ch == obsType && obs->_codeValid && obs->_phaseValid) { 96 _obs[iFreq] = new t_frqObs(*obs); 108 97 } 109 98 } … … 111 100 } 112 101 } 113 114 if (_validObs1 == 0 || (dualFreq && _validObs2 == 0)) {115 _valid = false;116 return;117 }118 102 119 103 // Find Glonass Channel Number -
TabularUnified trunk/BNC/src/PPP/pppSatObs.h ¶
r5916 r6017 16 16 t_pppSatObs(const t_satObs& satObs); 17 17 ~t_pppSatObs(); 18 bool isValid() const {return _valid;}19 void prepareObs();20 18 const t_prn& prn() const {return _prn;} 21 19 const ColumnVector& xc() const {return _xcSat;} … … 42 40 43 41 bool slip() const { 44 for (unsigned ii = 0; ii <_allObs.size(); ii++) {45 if (_ allObs[ii]->_slip) {42 for (unsigned ii = 1; ii < t_frequency::max; ii++) { 43 if (_obs[ii] && _obs[ii]->_slip) { 46 44 return true; 47 45 } … … 52 50 int slipCounter() const { 53 51 int cnt = -1; 54 for (unsigned ii = 0; ii <_allObs.size(); ii++) {55 if (_ allObs[ii]->_slipCounter > cnt) {56 cnt = _ allObs[ii]->_slipCounter;52 for (unsigned ii = 1; ii < t_frequency::max; ii++) { 53 if (_obs[ii] && _obs[ii]->_slipCounter > cnt) { 54 cnt = _obs[ii]->_slipCounter; 57 55 } 58 56 } … … 62 60 int biasJumpCounter() const { 63 61 int jmp = -1; 64 for (unsigned ii = 0; ii <_allObs.size(); ii++) {65 if (_ allObs[ii]->_biasJumpCounter > jmp) {66 jmp = _ allObs[ii]->_biasJumpCounter;62 for (unsigned ii = 1; ii < t_frequency::max; ii++) { 63 if (_obs[ii] && _obs[ii]->_biasJumpCounter > jmp) { 64 jmp = _obs[ii]->_biasJumpCounter; 67 65 } 68 66 } … … 113 111 }; 114 112 113 void prepareObs(const t_satObs& satObs); 114 115 115 t_prn _prn; 116 116 bncTime _time; 117 117 int _channel; 118 std::vector<t_frqObs*> _allObs; 119 bool _valid; 120 t_frqObs* _validObs1; 121 t_frqObs* _validObs2; 122 double _f1; 123 double _f2; 124 double _rawC1; 125 double _rawC2; 126 double _rawL1; 127 double _rawL2; 118 t_frqObs* _obs[t_frequency::max]; 128 119 ColumnVector _xcSat; 129 120 ColumnVector _vvSat;
Note:
See TracChangeset
for help on using the changeset viewer.