Changeset 728 in ntrip for trunk/BNC/bncgetthread.cpp


Ignore:
Timestamp:
Mar 14, 2008, 4:01:49 PM (16 years ago)
Author:
weber
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncgetthread.cpp

    r727 r728  
    122122  // Latency interval/average
    123123  // ------------------------
    124   _latIntr = 86400;
    125   if ( settings.value("latIntr").toString().isEmpty() ) { _latIntr = 0; }
    126   if ( settings.value("latIntr").toString().indexOf("1 min") != -1 ) { _latIntr = 60; }
    127   if ( settings.value("latIntr").toString().indexOf("5 min") != -1 ) { _latIntr = 300; }
    128   if ( settings.value("latIntr").toString().indexOf("15 min") != -1 ) { _latIntr = 900; }
    129   if ( settings.value("latIntr").toString().indexOf("1 hour") != -1 ) { _latIntr = 3600; }
    130   if ( settings.value("latIntr").toString().indexOf("6 hours") != -1 ) { _latIntr = 21600; }
    131   if ( settings.value("latIntr").toString().indexOf("1 day") != -1 ) { _latIntr = 86400; }
     124  _perfIntr = 86400;
     125  if ( settings.value("perfIntr").toString().isEmpty() ) { _perfIntr = 0; }
     126  if ( settings.value("perfIntr").toString().indexOf("1 min") != -1 ) { _perfIntr = 60; }
     127  if ( settings.value("perfIntr").toString().indexOf("5 min") != -1 ) { _perfIntr = 300; }
     128  if ( settings.value("perfIntr").toString().indexOf("15 min") != -1 ) { _perfIntr = 900; }
     129  if ( settings.value("perfIntr").toString().indexOf("1 hour") != -1 ) { _perfIntr = 3600; }
     130  if ( settings.value("perfIntr").toString().indexOf("6 hours") != -1 ) { _perfIntr = 21600; }
     131  if ( settings.value("perfIntr").toString().indexOf("1 day") != -1 ) { _perfIntr = 86400; }
    132132
    133133  // RINEX writer
     
    400400  bool begCorrupt = false;
    401401  bool endCorrupt = false;
     402  bool followSec = false;
    402403  int oldSecGPS= 0;
    403404  int newSecGPS = 0;
     405  int numGaps = 0;
     406  int diffSecGPS = 0;
    404407  int numLat = 0;
    405408  double sumLat = 0.;
     409  double meanDiff = 0.;
    406410  double minLat = maxDt;
    407411  double maxLat = -maxDt;
     
    582586            wrongEpoch = false;
    583587
    584             // Latency
    585             // -------
    586             if (_latIntr>0) {
     588            // Latency and completeness
     589            // ------------------------
     590            if (_perfIntr>0) {
    587591              newSecGPS = static_cast<int>(obs->_o.GPSWeeks);
    588592              if (newSecGPS != oldSecGPS) {
    589                 if (newSecGPS % _latIntr < oldSecGPS % _latIntr) {
     593                if (newSecGPS % _perfIntr < oldSecGPS % _perfIntr) {
    590594                  if (numLat>0) {
    591                     emit( newMessage(QString("%1: Mean latency %2 sec, min %3, max %4, %5 epochs")
    592                       .arg(_staID.data())
    593                       .arg(int(sumLat/numLat*100)/100.)
    594                       .arg(int(minLat*100)/100.)
    595                       .arg(int(maxLat*100)/100.)
    596                       .arg(numLat)
    597                       .toAscii()) );
     595                    if (meanDiff>0.) {
     596                      emit( newMessage(QString("%1: Mean latency %2 sec, min %3, max %4, %5 epochs, %6 gaps")
     597                        .arg(_staID.data())
     598                        .arg(int(sumLat/numLat*100)/100.)
     599                        .arg(int(minLat*100)/100.)
     600                        .arg(int(maxLat*100)/100.)
     601                        .arg(numLat)
     602                        .arg(numGaps)
     603                        .toAscii()) );
     604                    } else {
     605                      emit( newMessage(QString("%1: Mean latency %2 sec, min %3, max %4, %5 epochs")
     606                        .arg(_staID.data())
     607                        .arg(int(sumLat/numLat*100)/100.)
     608                        .arg(int(minLat*100)/100.)
     609                        .arg(int(maxLat*100)/100.)
     610                        .arg(numLat)
     611                        .toAscii()) );
     612                    }
    598613                  }
     614                  meanDiff = diffSecGPS/numLat;
     615                  diffSecGPS = 0;
     616                  numGaps = 0;
    599617                  sumLat = 0.;
    600618                  numLat = 0;
    601619                  minLat = maxDt;
    602620                  maxLat = -maxDt;
     621                }
     622                if (followSec) {
     623                  diffSecGPS += newSecGPS - oldSecGPS;
     624                  if (meanDiff>0.) {
     625                    if (newSecGPS - oldSecGPS > 1.5 * meanDiff) {
     626                      numGaps += 1;
     627                    }
     628                  }
    603629                }
    604630                curLat = sec - obs->_o.GPSWeeks + leapsec;
     
    608634                numLat += 1;
    609635                oldSecGPS = newSecGPS;
     636                followSec = true;
    610637              }
    611638            }
Note: See TracChangeset for help on using the changeset viewer.