Changeset 709 in ntrip for trunk/BNC/bncgetthread.cpp
- Timestamp:
- Mar 7, 2008, 5:56:07 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncgetthread.cpp
r704 r709 117 117 _adviseScript = settings.value("adviseScript").toString(); 118 118 expandEnvVar(_adviseScript); 119 120 // Latency interval/average 121 // ------------------------ 122 _latIntr = 86400; 123 if ( settings.value("latIntr").toString().isEmpty() ) { _latIntr = 0; } 124 if ( settings.value("latIntr").toString().indexOf("1 min") != -1 ) { _latIntr = 60; } 125 if ( settings.value("latIntr").toString().indexOf("5 min") != -1 ) { _latIntr = 300; } 126 if ( settings.value("latIntr").toString().indexOf("15 min") != -1 ) { _latIntr = 900; } 127 if ( settings.value("latIntr").toString().indexOf("1 hour") != -1 ) { _latIntr = 3600; } 128 if ( settings.value("latIntr").toString().indexOf("6 hours") != -1 ) { _latIntr = 21600; } 129 if ( settings.value("latIntr").toString().indexOf("1 day") != -1 ) { _latIntr = 86400; } 119 130 120 131 // RINEX writer … … 377 388 void bncGetThread::run() { 378 389 390 const double maxDt = 600.0; // Check observation epoch 379 391 bool wrongEpoch = false; 380 392 bool decode = true; … … 382 394 int secSucc = 0; 383 395 int secFail = 0; 384 int initPause = 30; 396 int initPause = 30; // Initial pause for corrupted streams 385 397 int currPause = 0; 386 398 bool begCorrupt = false; 387 399 bool endCorrupt = false; 400 int oldSec= 0; 401 int newSec = 0; 402 int numLat = 0; 403 double sumLat = 0.; 404 double minLat = maxDt; 405 double maxLat = -maxDt; 406 double curLat = 0.; 407 double leapsec = 14.; // Leap second for latency estimation 388 408 389 409 _decodeTime = QDateTime::currentDateTime(); … … 539 559 540 560 const double secPerWeek = 7.0 * 24.0 * 3600.0; 541 const double maxDt = 600.0;542 561 543 562 if (week < obs->_o.GPSWeek) { … … 560 579 else { 561 580 wrongEpoch = false; 581 582 // Latency 583 // ------- 584 if (_latIntr>0) { 585 newSec = static_cast<int>(sec); 586 if (newSec != oldSec) { 587 if (newSec % _latIntr < oldSec % _latIntr) { 588 if (numLat>0) { 589 emit( newMessage(QString("%1: %2 sec mean latency, min %3, max %4") 590 .arg(_staID.data()) 591 .arg(int(sumLat/numLat*100)/100.) 592 .arg(int(minLat*100)/100.) 593 .arg(int(maxLat*100)/100.) 594 .toAscii()) ); 595 } 596 sumLat = 0.; 597 numLat = 0; 598 minLat = maxDt; 599 maxLat = -maxDt; 600 } 601 curLat = sec - obs->_o.GPSWeeks + leapsec; 602 sumLat += curLat; 603 if (curLat < minLat) minLat = curLat; 604 if (curLat >= maxLat) maxLat = curLat; 605 numLat += 1; 606 oldSec = newSec; 607 } 608 } 562 609 } 563 610
Note:
See TracChangeset
for help on using the changeset viewer.