Changeset 2778 in ntrip
- Timestamp:
- Dec 12, 2010, 6:09:08 PM (14 years ago)
- Location:
- trunk/BNC
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncconst.cpp
r2063 r2778 26 26 27 27 const double t_CST::c = 299792458.0; 28 const double t_CST::freq1 = 1575420000.0; 29 const double t_CST::freq2 = 1227600000.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 30 31 const double t_CST::lambda1 = c / freq1; 31 32 const double t_CST::lambda2 = c / freq2; 33 const double t_CST::lambda5 = c / freq5; 32 34 const double t_CST::omega = 7292115.1467e-11; 33 35 const double t_CST::aell = 6378137.000; -
trunk/BNC/bncconst.h
r2063 r2778 30 30 class t_CST { 31 31 public: 32 static const double c ; 33 static const double freq1 ; 34 static const double freq2 ; 32 static const double c; 33 static const double freq1; // GPS and Galileo E1 34 static const double freq2; // GPS only 35 static const double freq5; // GPS and Galileo E5a 35 36 static const double lambda1; 36 37 static const double lambda2; 38 static const double lambda5; 37 39 static const double omega; 38 40 static const double aell; -
trunk/BNC/bncpppclient.cpp
r2777 r2778 147 147 slipInfo& sInfo = _slips[satData->prn]; 148 148 if ( sInfo.slipCntL1 == obs.slip_cnt_L1 && 149 sInfo.slipCntL2 == obs.slip_cnt_L2 ) { 149 sInfo.slipCntL2 == obs.slip_cnt_L2 && 150 sInfo.slipCntL5 == obs.slip_cnt_L5 ) { 150 151 satData->slipFlag = false; 151 152 } … … 163 164 } 164 165 165 // Set Code Observations 166 // --------------------- 166 // Set Code Observations - P1 or C1 167 // -------------------------------- 168 bool haveP1 = false; 167 169 if (obs.P1) { 168 170 satData->P1 = obs.P1 + (bb ? bb->p1 : 0.0); 169 171 satData->codeTypeF1 = t_satData::P_CODE; 172 haveP1 = true; 170 173 } 171 174 else if (obs.C1) { 172 175 satData->P1 = obs.C1 + (bb ? bb->c1 : 0.0); 173 176 satData->codeTypeF1 = t_satData::C_CODE; 174 } 175 else { 177 haveP1 = true; 178 } 179 180 if (!haveP1) { 176 181 delete satData; 177 182 return; 178 183 } 179 184 185 // P2 or C2, and C5 186 // ---------------- 187 bool haveP2 = false; 180 188 if (obs.P2) { 181 189 satData->P2 = obs.P2 + (bb ? bb->p2 : 0.0); 182 190 satData->codeTypeF2 = t_satData::P_CODE; 191 haveP2 = true; 183 192 } 184 193 else if (obs.C2) { 185 194 satData->P2 = obs.C2; 186 195 satData->codeTypeF2 = t_satData::C_CODE; 187 } 188 else { 196 haveP2 = true; 197 } 198 199 bool haveP5 = false; 200 if (obs.C5) { 201 satData->P5 = obs.C5; 202 satData->codeTypeF2 = t_satData::P_CODE; 203 haveP5 = true; 204 } 205 206 if (!haveP2 && !haveP5) { 189 207 delete satData; 190 208 return; 191 209 } 192 193 double f1 = t_CST::freq1;194 double f2 = t_CST::freq2;195 196 if (obs.satSys == 'R') {197 f1 = 1602000000.0 + 562500.0 * obs.slotNum;198 f2 = 1246000000.0 + 437500.0 * obs.slotNum;199 }200 201 // Ionosphere-Free Combination202 // ---------------------------203 double c1 = f1 * f1 / (f1 * f1 - f2 * f2);204 double c2 = - f2 * f2 / (f1 * f1 - f2 * f2);205 206 satData->P3 = c1 * satData->P1 + c2 * satData->P2;207 208 // Set Phase Observations209 // ----------------------210 if (obs.L1() && obs.L2()) {211 satData->L1 = obs.L1() * t_CST::c / f1;212 satData->L2 = obs.L2() * t_CST::c / f2;213 }214 else {215 delete satData;216 return;217 }218 satData->L3 = c1 * satData->L1 + c2 * satData->L2;219 220 // Set Ionosphere-Free Wavelength221 // ------------------------------222 satData->lambda3 = c1 * t_CST::c / f1 + c2 * t_CST::c / f2;223 210 224 211 // Add new Satellite to the epoch … … 237 224 } 238 225 226 // Set Ionosphere-Free Combinations 227 // -------------------------------- 239 228 if (obs.satSys == 'G') { 229 double f1 = t_CST::freq1; 230 double f2 = t_CST::freq2; 231 double c1 = f1 * f1 / (f1 * f1 - f2 * f2); 232 double c2 = - f2 * f2 / (f1 * f1 - f2 * f2); 233 234 if (obs.L1() && obs.L2()) { 235 satData->L1 = obs.L1() * t_CST::c / f1; 236 satData->L2 = obs.L2() * t_CST::c / f2; 237 } 238 else { 239 delete satData; 240 return; 241 } 242 243 satData->P3 = c1 * satData->P1 + c2 * satData->P2; 244 satData->L3 = c1 * satData->L1 + c2 * satData->L2; 245 satData->lambda3 = c1 * t_CST::c / f1 + c2 * t_CST::c / f2; 246 240 247 _epoData->satDataGPS[satData->prn] = satData; 241 248 } 242 249 else if (obs.satSys == 'R') { 250 double f1 = 1602000000.0 + 562500.0 * obs.slotNum; 251 double f2 = 1246000000.0 + 437500.0 * obs.slotNum; 252 double c1 = f1 * f1 / (f1 * f1 - f2 * f2); 253 double c2 = - f2 * f2 / (f1 * f1 - f2 * f2); 254 255 if (obs.L1() && obs.L2()) { 256 satData->L1 = obs.L1() * t_CST::c / f1; 257 satData->L2 = obs.L2() * t_CST::c / f2; 258 } 259 else { 260 delete satData; 261 return; 262 } 263 264 satData->P3 = c1 * satData->P1 + c2 * satData->P2; 265 satData->L3 = c1 * satData->L1 + c2 * satData->L2; 266 satData->lambda3 = c1 * t_CST::c / f1 + c2 * t_CST::c / f2; 267 243 268 _epoData->satDataGlo[satData->prn] = satData; 269 } 270 else if (obs.satSys == 'E') { 271 double f1 = t_CST::freq1; 272 double f5 = t_CST::freq5; 273 double c1 = f1 * f1 / (f1 * f1 - f5 * f5); 274 double c5 = - f5 * f5 / (f1 * f1 - f5 * f5); 275 276 if (obs.L1() && obs.L5) { 277 satData->L1 = obs.L1() * t_CST::c / f1; 278 satData->L5 = obs.L5 * t_CST::c / f5; 279 } 280 else { 281 delete satData; 282 return; 283 } 284 285 satData->P3 = c1 * satData->P1 + c5 * satData->P5; 286 satData->L3 = c1 * satData->L1 + c5 * satData->L5; 287 satData->lambda3 = c1 * t_CST::c / f1 + c5 * t_CST::c / f5; 288 289 _epoData->satDataGal[satData->prn] = satData; 244 290 } 245 291 } … … 294 340 t_ephGlo* eLast = new t_ephGlo(); 295 341 eLast->set(&gloeph); 342 _eph.insert(prn, new t_ephPair()); 343 _eph[prn]->last = eLast; 344 } 345 } 346 347 // 348 //////////////////////////////////////////////////////////////////////////// 349 void bncPPPclient::slotNewEphGalileo(galileoephemeris galeph) { 350 QMutexLocker locker(&_mutex); 351 352 QString prn = QString("E%1").arg(galeph.satellite, 2, 10, QChar('0')); 353 354 if (_eph.contains(prn)) { 355 t_ephGal* eLast = static_cast<t_ephGal*>(_eph.value(prn)->last); 356 if ( (eLast->GPSweek() < galeph.Week) || 357 (eLast->GPSweek() == galeph.Week && 358 eLast->TOC() < galeph.TOC) ) { 359 delete static_cast<t_ephGal*>(_eph.value(prn)->prev); 360 _eph.value(prn)->prev = _eph.value(prn)->last; 361 _eph.value(prn)->last = new t_ephGal(); 362 static_cast<t_ephGal*>(_eph.value(prn)->last)->set(&galeph); 363 } 364 } 365 else { 366 t_ephGal* eLast = new t_ephGal(); 367 eLast->set(&galeph); 296 368 _eph.insert(prn, new t_ephPair()); 297 369 _eph[prn]->last = eLast; … … 557 629 } 558 630 } 559 560 //561 ////////////////////////////////////////////////////////////////////////////562 void bncPPPclient::slotNewEphGalileo(galileoephemeris galeph) {563 QMutexLocker locker(&_mutex);564 565 QString prn = QString("E%1").arg(galeph.satellite, 2, 10, QChar('0'));566 567 if (_eph.contains(prn)) {568 t_ephGal* eLast = static_cast<t_ephGal*>(_eph.value(prn)->last);569 if ( (eLast->GPSweek() < galeph.Week) ||570 (eLast->GPSweek() == galeph.Week &&571 eLast->TOC() < galeph.TOC) ) {572 delete static_cast<t_ephGal*>(_eph.value(prn)->prev);573 _eph.value(prn)->prev = _eph.value(prn)->last;574 _eph.value(prn)->last = new t_ephGal();575 static_cast<t_ephGal*>(_eph.value(prn)->last)->set(&galeph);576 }577 }578 else {579 t_ephGal* eLast = new t_ephGal();580 eLast->set(&galeph);581 _eph.insert(prn, new t_ephPair());582 _eph[prn]->last = eLast;583 }584 } -
trunk/BNC/bncpppclient.h
r2776 r2778 43 43 double P1; 44 44 double P2; 45 double P5; 45 46 double P3; 46 47 double L1; 47 48 double L2; 49 double L5; 48 50 double L3; 49 51 codeType codeTypeF1; 50 52 codeType codeTypeF2; 53 codeType codeTypeF5; 51 54 ColumnVector xx; 52 55 ColumnVector vv; … … 73 76 delete itGlo.value(); 74 77 } 78 QMapIterator<QString, t_satData*> itGal(satDataGal); 79 while (itGal.hasNext()) { 80 itGal.next(); 81 delete itGal.value(); 82 } 75 83 } 76 84 unsigned sizeGPS() const {return satDataGPS.size();} 77 85 unsigned sizeGlo() const {return satDataGlo.size();} 78 unsigned sizeAll() const {return satDataGPS.size() + satDataGlo.size();} 86 unsigned sizeGal() const {return satDataGal.size();} 87 unsigned sizeAll() const {return satDataGPS.size() + satDataGlo.size() + 88 satDataGal.size();} 79 89 bncTime tt; 80 90 QMap<QString, t_satData*> satDataGPS; 81 91 QMap<QString, t_satData*> satDataGlo; 92 QMap<QString, t_satData*> satDataGal; 82 93 }; 83 94 … … 139 150 slipCntL1 = -1; 140 151 slipCntL2 = -1; 152 slipCntL5 = -1; 141 153 } 142 154 ~slipInfo(){} 143 155 int slipCntL1; 144 156 int slipCntL2; 157 int slipCntL5; 145 158 }; 146 159
Note:
See TracChangeset
for help on using the changeset viewer.