Changeset 9322 in ntrip for branches/BNC_2.12/src/bncephuser.cpp
- Timestamp:
- Dec 17, 2020, 4:11:09 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/BNC_2.12/src/bncephuser.cpp
r9300 r9322 158 158 } 159 159 160 if (ephOld == 0 || newEph->isNewerThan(ephOld)) { 160 if ( (ephOld == 0) || 161 newEph->isNewerThan(ephOld) || 162 newCorrectedGpsEphSet(newEph) ) { 161 163 checkEphemeris(newEph, realTime); 162 164 eph->setCheckState(newEph->checkState()); … … 170 172 newEph->checkState() != t_eph::outdated) { 171 173 deque<t_eph*>& qq = _eph[prn]; 172 if (qq.empty() || 173 newEph->isNewerThan(qq.back())){ 174 qq.push_back(newEph); 175 if (qq.size() > _maxQueueSize) { 176 delete qq.front(); 177 qq.pop_front(); 178 } 179 ephBufferChanged(); 180 return success; 181 } 182 else { 183 delete newEph; 184 return failure; 185 } 186 174 qq.push_back(newEph); 175 if (qq.size() > _maxQueueSize) { 176 delete qq.front(); 177 qq.pop_front(); 178 } 179 ephBufferChanged(); 180 return success; 187 181 } 188 182 else { … … 280 274 ColumnVector vvL(3); 281 275 ephL->getCrd(eph->TOC(), xcL, vvL, false); 282 double dt = eph->TOC() - ephL->TOC(); 283 if (dt < 0.0) { 284 dt += 604800.0; 285 } 276 286 277 double diff = (xc.Rows(1,3) - xcL.Rows(1,3)).norm_Frobenius(); 287 278 double diffC = fabs(xc(4) - xcL(4)) * t_CST::c; 288 279 289 280 if (diff < MAXDIFF && diffC < MAXDIFF) { 290 if (diff < MINDIFF && diffC < MINDIFF && ephL->checkState() == t_eph::ok) { 281 if (diff < MINDIFF && diffC < MINDIFF && 282 ephL->checkState() == t_eph::ok) { 291 283 // to prevent the same data sets with different TOC values 292 284 eph->setCheckState(t_eph::bad); … … 302 294 } 303 295 } 296 297 double dt = eph->TOC() - ephL->TOC(); 304 298 // some lines to allow update of ephemeris data sets after an outage 299 // ----------------------------------------------------------------- 305 300 // update interval: 2h, 301 // sometimes corrected BRDC sets are sent with TOC values 16 seconds 302 // before the nominal TOC (integer time) 306 303 if (eph->type() == t_eph::GPS && dt > (2*3600.0 + 60.0)) { 307 304 ephL->setCheckState(t_eph::outdated); … … 314 311 } 315 312 // updated every 30 minutes 316 else if (eph->type() == t_eph::GLONASS && dt > ( 1800.0 + 60.0)) {313 else if (eph->type() == t_eph::GLONASS && dt > ( 1800.0 + 60.0)) { 317 314 ephL->setCheckState(t_eph::outdated); 318 315 return; … … 340 337 } 341 338 } 339 340 // 341 //////////////////////////////////////////////////////////////////////////// 342 bool bncEphUser::newCorrectedGpsEphSet(const t_eph* eph) { 343 344 bool correctedGpsEphSet = false; 345 bool newCorrectedGpsEphSet = false; 346 347 if (eph->prn().system() != 'G') { 348 return newCorrectedGpsEphSet; 349 } 350 351 if ((fmod(eph->TOC().daysec()+16.0, 7200) == 0.0)) { 352 // sometimes corrected BRDC sets are sent with TOC values 16 seconds 353 // before the nominal TOC (integer time) 354 correctedGpsEphSet = true; 355 } 356 357 QString prn = QString(eph->prn().toInternalString().c_str()); 358 t_eph* ephL = ephLast(prn); 359 if (!ephL) { // first set for GPS Sat 360 return correctedGpsEphSet; 361 } 362 363 364 double dt = eph->TOC() - ephL->TOC(); 365 if (correctedGpsEphSet){ 366 if (dt == 0.0) { 367 newCorrectedGpsEphSet = false; 368 } 369 else { 370 newCorrectedGpsEphSet = true; 371 } 372 } 373 return newCorrectedGpsEphSet; 374 }
Note:
See TracChangeset
for help on using the changeset viewer.