- Timestamp:
- Feb 5, 2018, 11:04:58 AM (7 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bncgetthread.cpp
r8252 r8271 103 103 if (!settings.value("rawOutFile").toString().isEmpty()) { 104 104 _rawOutput = true; 105 } else { 105 } 106 else { 106 107 _rawOutput = false; 107 108 } 108 109 if (!settings.value("miscMount").toString().isEmpty()) { 110 _latencycheck = true; 111 } 112 else { 113 _latencycheck = false; 114 } 109 115 initialize(); 110 116 initDecoder(); … … 284 290 } 285 291 286 if (!_staID.isEmpty() ) {292 if (!_staID.isEmpty() && _latencycheck) { 287 293 _latencyChecker = new latencyChecker(_staID); 288 294 obs = false; … … 509 515 // -------------------------------- 510 516 if (_latencyChecker) { 511 _latencyChecker->checkOutage(irc == success);517 _latencyChecker->checkOutage(irc); 512 518 QListIterator<int> it(decoder()->_typeList); 513 _ssrEpoch = decoder()->corrGPSEpochTime();514 if (_oldSsrEpoch && _ssrEpoch&& _ssrEpoch != _oldSsrEpoch) {519 _ssrEpoch = static_cast<int>(decoder()->corrGPSEpochTime()); 520 if (_oldSsrEpoch != -1 && _ssrEpoch != _oldSsrEpoch) { 515 521 if (ssrOrb) { 516 522 _latencyChecker->checkCorrLatency(_oldSsrEpoch, 1057); … … 564 570 ssrOrbClk = true; 565 571 break; 566 case 1059: case 1065: case 1242: 572 case 1059: case 1065: case 1242: case 1248: case 1254: case 1260: 567 573 ssrCbi = true; 568 574 break; … … 585 591 _latencyChecker->checkObsLatency(decoder()->_obsList); 586 592 } 587 _oldSsrEpoch = _ssrEpoch; 593 if (_ssrEpoch != -1) { 594 _oldSsrEpoch = _ssrEpoch; 595 } 588 596 emit newLatency(_staID, _latencyChecker->currentLatency()); 589 597 } -
trunk/BNC/src/bncgetthread.h
r8252 r8271 138 138 t_serialNMEA _serialNMEA; 139 139 bool _rawOutput; 140 bool _latencycheck; 140 141 QMap<QString, long> _prnLastEpo; 141 142 QMap<char, QVector<QString> > _rnxTypes; -
trunk/BNC/src/latencychecker.cpp
r8204 r8271 321 321 322 322 if (_miscIntr > 0 ) { 323 t_latency& l = _lObs; l._type = "Observations"; 323 t_latency& l = _lObs; 324 l._type = "Observations"; 324 325 QListIterator<t_satObs> it(obsList); 325 326 while (it.hasNext()) { … … 393 394 } 394 395 l._numLat += 1; 395 l._oldSec = l._newSec;396 396 l._followSec = true; 397 397 } 398 l._oldSec = l._newSec; 398 399 } 399 400 _lObs = l; … … 406 407 void latencyChecker::checkCorrLatency(int corrGPSEpochTime, int type) { 407 408 if (corrGPSEpochTime < 0) { 408 return ; 409 } 409 return; 410 } 411 410 412 t_latency& l = _lOrb; // init 411 413 switch (type) { … … 440 442 if (_miscIntr > 0) { 441 443 l._newSec = corrGPSEpochTime; 442 int week;443 double sec;444 currentGPSWeeks(week, sec);445 double dt = fabs(sec - l._newSec);446 const double secPerWeek = 7.0 * 24.0 * 3600.0;447 if (dt > 0.5 * secPerWeek) {448 if (sec > l._newSec) {449 sec -= secPerWeek;450 } else {451 sec += secPerWeek;452 }453 }454 444 if (l._newSec > l._oldSec) { 455 445 if (int(l._newSec) % _miscIntr < int(l._oldSec) % _miscIntr) { … … 485 475 l.init(); 486 476 } 487 488 477 if (l._followSec) { 489 478 l._diffSec += l._newSec - l._oldSec; … … 494 483 } 495 484 } 485 486 // Compute the observations latency 487 // -------------------------------- 488 int week; 489 double sec; 490 currentGPSWeeks(week, sec); 491 double dt = fabs(sec - l._newSec); 492 const double secPerWeek = 7.0 * 24.0 * 3600.0; 493 if (dt > 0.5 * secPerWeek) { 494 if (sec > l._newSec) { 495 sec -= secPerWeek; 496 } else { 497 sec += secPerWeek; 498 } 499 } 496 500 l._curLat = sec - l._newSec; 497 501 l._sumLat += l._curLat; … … 504 508 } 505 509 l._numLat += 1; 506 l._oldSec = l._newSec;507 510 l._followSec = true; 508 511 setCurrentLatency(l._curLat); 509 512 } 510 switch (type) { 511 case 1057: case 1063: case 1240: case 1246: case 1252: case 1258: 512 _lOrb = l; 513 break; 514 case 1058: case 1064: case 1241: case 1247: case 1253: case 1259: 515 _lClk = l; 516 break; 517 case 1060: case 1066: case 1243: case 1249: case 1255: case 1261: 518 _lClkOrb = l; 519 break; 520 case 1059: case 1065: case 1242: case 1248: case 1254: case 1260: 521 _lCb = l; 522 break; 523 case 1265: case 1266: case 1267: case 1268: case 1269: case 1270: 524 _lPb = l; 525 break; 526 case 1264: 527 _lVtec = l; 528 break; 529 case 1061: case 1067: case 1244: case 1250: case 1256: case 1262: 530 _lUra = l; 531 break; 532 case 1062: case 1068: case 1245: case 1251: case 1257: case 1263: 533 _lHr = l; 534 break; 535 } 536 } 513 l._oldSec = l._newSec; 514 } 515 516 switch (type) { 517 case 1057: case 1063: case 1240: case 1246: case 1252: case 1258: 518 _lOrb = l; 519 break; 520 case 1058: case 1064: case 1241: case 1247: case 1253: case 1259: 521 _lClk = l; 522 break; 523 case 1060: case 1066: case 1243: case 1249: case 1255: case 1261: 524 _lClkOrb = l; 525 break; 526 case 1059: case 1065: case 1242: case 1248: case 1254: case 1260: 527 _lCb = l; 528 break; 529 case 1265: case 1266: case 1267: case 1268: case 1269: case 1270: 530 _lPb = l; 531 break; 532 case 1264: 533 _lVtec = l; 534 break; 535 case 1061: case 1067: case 1244: case 1250: case 1256: case 1262: 536 _lUra = l; 537 break; 538 case 1062: case 1068: case 1245: case 1251: case 1257: case 1263: 539 _lHr = l; 540 break; 541 } 537 542 } 538 543 -
trunk/BNC/src/latencychecker.h
r8082 r8271 45 45 public: 46 46 t_latency() { 47 _oldSec = 0;48 _newSec = 0;49 _numGaps = 0;50 _diffSec = 0;51 _numLat = 0;52 _sumLat = 0.0;53 _sumLatQ = 0.0;54 _meanDiff = 0.0;47 _oldSec = -1; 48 _newSec = -1; 49 _numGaps = 0; 50 _diffSec = 0; 51 _numLat = 0; 52 _sumLat = 0.0; 53 _sumLatQ = 0.0; 54 _meanDiff = 0.0; 55 55 _minLat = 1000.0; 56 56 _maxLat = -1000.0; 57 _curLat = 0.0;58 _type = "";59 _followSec = false;57 _curLat = 0.0; 58 _type = ""; 59 _followSec = false; 60 60 } 61 61 void init() {
Note:
See TracChangeset
for help on using the changeset viewer.