Changeset 6017 in ntrip
- Timestamp:
- Aug 21, 2014, 8:44:50 AM (10 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
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: -
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 -
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; -
trunk/BNC/src/bncantex.cpp
r6015 r6017 259 259 double bncAntex::pco(const QString& antName, double eleSat, bool& found) const { 260 260 261 static const double f1 = t_CST::freq 1;262 static const double f2 = t_CST::freq 2;261 static const double f1 = t_CST::freq(t_frequency::G1, 0); 262 static const double f2 = t_CST::freq(t_frequency::G2, 0); 263 263 static const double c1 = f1 * f1 / (f1 * f1 - f2 * f2); 264 264 static const double c2 = - f2 * f2 / (f1 * f1 - f2 * f2); -
trunk/BNC/src/bncconst.cpp
r4278 r6017 25 25 #include "bncconst.h" 26 26 27 const double t_CST::c = 299792458.0; 28 const double t_CST::freq1 = 1575420000.0; // GPS and Galileo E1 29 const double t_CST::freq2 = 1227600000.0; // GPS only 30 const double t_CST::freq5 = 1176450000.0; // GPS and Galileo E5a 31 const double t_CST::lambda1 = c / freq1; 32 const double t_CST::lambda2 = c / freq2; 33 const double t_CST::lambda5 = c / freq5; 34 const double t_CST::omega = 7292115.1467e-11; 35 const double t_CST::aell = 6378137.000; 36 const double t_CST::fInv = 298.2572236; 27 const double t_CST::c = 299792458.0; 28 const double t_CST::omega = 7292115.1467e-11; 29 const double t_CST::aell = 6378137.000; 30 const double t_CST::fInv = 298.2572236; 31 32 // 33 ////////////////////////////////////////////////////////////////////////////// 34 double t_CST::freq(t_frequency::type fType, int slotNum) { 35 switch (fType) { 36 case t_frequency::G1: return 1575420000.0; 37 case t_frequency::G2: return 1227600000.0; 38 case t_frequency::G5: return 1176450000.0; 39 case t_frequency::E1: return 1575420000.0; 40 case t_frequency::E5: return 1176450000.0; 41 case t_frequency::E7: return 1207140000.0; 42 case t_frequency::E8: return 1191795000.0; 43 case t_frequency::E6: return 1278750000.0; 44 case t_frequency::R1: return 1602000000.0 + 562500.0 * slotNum; 45 case t_frequency::R2: return 1246000000.0 + 437500.0 * slotNum; 46 case t_frequency::dummy: 47 case t_frequency::max: return 0.0; 48 } 49 return 0.0; 50 } 51 52 // 53 ////////////////////////////////////////////////////////////////////////////// 54 double t_CST::lambda(t_frequency::type fType, int slotNum) { 55 return c / freq(fType, slotNum); 56 } -
trunk/BNC/src/bncconst.h
r4278 r6017 23 23 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 24 24 25 #include <string> 26 25 27 #ifndef BNCCONST_H 26 28 #define BNCCONST_H … … 28 30 enum t_irc {failure = -1, success, fatal}; // return code 29 31 32 class t_frequency { 33 public: 34 enum type {dummy = 0, G1, G2, G5, R1, R2, 35 E1, // E1 / 1575.42 36 E5, // E5a / 1176.45 37 E7, // E5b / 1207.140 38 E8, // E5(E5a+E5b) / 1191.795 39 E6, // E6 / 1278.75 40 max}; 41 42 static std::string toString(type tt) { 43 if (tt == G1) return "G1"; 44 else if (tt == G2) return "G2"; 45 else if (tt == G5) return "G5"; 46 else if (tt == R1) return "R1"; 47 else if (tt == R2) return "R2"; 48 else if (tt == E1) return "E1"; 49 else if (tt == E5) return "E5"; 50 else if (tt == E6) return "E6"; 51 else if (tt == E7) return "E7"; 52 else if (tt == E8) return "E8"; 53 return std::string(); 54 } 55 }; 56 30 57 class t_CST { 31 58 public: 32 static double f1(char satSys, int slotNum) { 33 if (satSys == 'G' || satSys == 'E') { 34 return freq1; 35 } 36 else if (satSys == 'R') { 37 return 1602000000.0 + 562500.0 * slotNum; 38 } 39 else { 40 return 0.0; 41 } 42 } 43 static double f2(char satSys, int slotNum) { 44 if (satSys == 'G') { 45 return freq2; 46 } 47 else if (satSys == 'R') { 48 return 1246000000.0 + 437500.0 * slotNum; 49 } 50 else { 51 return 0.0; 52 } 53 } 59 static double freq(t_frequency::type fType, int slotNum); 60 static double lambda(t_frequency::type fType, int slotNum); 54 61 55 62 static const double c; 56 static const double freq1; // GPS and Galileo E157 static const double freq2; // GPS only58 static const double freq5; // GPS and Galileo E5a59 static const double lambda1;60 static const double lambda2;61 static const double lambda5;62 63 static const double omega; 63 64 static const double aell; -
trunk/BNC/src/rinex/reqcanalyze.cpp
r5884 r6017 364 364 // ---------------------- 365 365 if (L1 != 0.0 && L2 != 0.0) { 366 double f1 = t_CST::f1(obs.satSys, obs.slotNum); 367 double f2 = obs.satSys == 'E' ? t_CST::freq5 : t_CST::f2(obs.satSys, obs.slotNum); 366 double f1 = 0.0; 367 double f2 = 0.0; 368 if (obs.satSys == 'G') { 369 f1 = t_CST::freq(t_frequency::G1, 0); 370 f2 = t_CST::freq(t_frequency::G2, 0); 371 } 372 else if (obs.satSys == 'R') { 373 f1 = t_CST::freq(t_frequency::R1, obs.slotNum); 374 f2 = t_CST::freq(t_frequency::R2, obs.slotNum); 375 } 376 else if (obs.satSys == 'E') { 377 f1 = t_CST::freq(t_frequency::E1, 0); 378 f2 = t_CST::freq(t_frequency::E5, 0); 379 } 368 380 369 381 L1 = L1 * t_CST::c / f1;
Note:
See TracChangeset
for help on using the changeset viewer.