Changeset 1080 in ntrip for trunk/BNC/RTCM3/RTCM3Decoder.cpp


Ignore:
Timestamp:
Aug 30, 2008, 12:15:14 AM (16 years ago)
Author:
weber
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/RTCM3/RTCM3Decoder.cpp

    r1079 r1080  
    6868  QSettings settings;
    6969  _checkMountPoint = settings.value("messTypes").toString();
     70  _corrLate = settings.value("corrLate").toInt();
    7071  _staID = staID;
    71 
    72   // Latency
    73   _numLat = 0;
    74   _minLat = 1000.;
    75   _maxLat = -1000.;
    76   _sumLat = 0.;
    77   _sumLatQ = 0.;
    78   _followSec = false;
    79   _meanDiff = 0.;
    80   _diffSecGPS= 0.;
    81   _numGaps = 0;
    82   _oldSecGPS = 0.;
    83   _newSecGPS = 0.;
    84   _curLat = 0.;
    85   _perfIntr = 86400;
    86   if ( settings.value("perfIntr").toString().isEmpty() ) { _perfIntr = 0; }
    87   if ( settings.value("perfIntr").toString().indexOf("1 min") != -1 ) { _perfIntr = 60; }
    88   if ( settings.value("perfIntr").toString().indexOf("5 min") != -1 ) { _perfIntr = 300; }
    89   if ( settings.value("perfIntr").toString().indexOf("15 min") != -1 ) { _perfIntr = 900; }
    90   if ( settings.value("perfIntr").toString().indexOf("1 hour") != -1 ) { _perfIntr = 3600; }
    91   if ( settings.value("perfIntr").toString().indexOf("6 hours") != -1 ) { _perfIntr = 21600; }
    92   if ( settings.value("perfIntr").toString().indexOf("1 day") != -1 ) { _perfIntr = 86400; }
    9372
    9473  // Ensure, that the Decoder uses the "old" convention for the data structure for Rinex2. Perlt
     
    134113      decoded = true;
    135114
    136       // Latency
     115      // Latency, Weber
    137116      // -------
    138       if (_perfIntr>0) {
     117      if ( _corrLate == 2 ) {
    139118        if (0<_coDecoder->_epochList.size()) {
    140119          for (int ii=0;ii<_coDecoder->_epochList.size();ii++) {
    141120            int week;
    142121            double sec;
    143             _newSecGPS = _coDecoder->_epochList[ii];
     122            double secGPS = _coDecoder->_epochList[ii];
    144123            leapsecGPSWeeks(week, sec);
    145             double dt = fabs(sec - _newSecGPS);
     124            double dt = fabs(sec - secGPS);
    146125            const double secPerWeek = 7.0 * 24.0 * 3600.0;
    147126            if (dt > 0.5 * secPerWeek) {
    148               if (sec > _newSecGPS) {
     127              if (sec > secGPS) {
    149128                sec  -= secPerWeek;
    150129              } else {
     
    152131              }
    153132            }
    154             if (_newSecGPS != _oldSecGPS) {
    155               if (int(_newSecGPS) % _perfIntr < int(_oldSecGPS) % _perfIntr) {
    156                 if (_numLat>0) {
    157                   QString late;
    158                   if (_meanDiff>0.) {
    159                     late = QString(": Mean latency %1 sec, min %2, max %3, rms %4, %5 epochs, %6 gaps")
    160                     .arg(int(_sumLat/_numLat*100)/100.)
    161                     .arg(int(_minLat*100)/100.)
    162                     .arg(int(_maxLat*100)/100.)
    163                     .arg(int((sqrt((_sumLatQ - _sumLat * _sumLat / _numLat)/_numLat))*100)/100.)
    164                     .arg(_numLat)
    165                     .arg(_numGaps);
    166                     emit(newMessage(QString(_staID + late ).toAscii() ) );
    167                   } else {
    168                   late = QString(": Mean latency %1 sec, min %2, max %3, rms %4, %5 epochs")
    169                     .arg(int(_sumLat/_numLat*100)/100.)
    170                     .arg(int(_minLat*100)/100.)
    171                     .arg(int(_maxLat*100)/100.)
    172                     .arg(int((sqrt((_sumLatQ - _sumLat * _sumLat / _numLat)/_numLat))*100)/100.)
    173                     .arg(_numLat);
    174                   emit(newMessage(QString(_staID + late ).toAscii() ) );
    175                   }
    176                 }
    177                 _meanDiff = int(_diffSecGPS)/_numLat;
    178                 _diffSecGPS = 0.;
    179                 _numGaps = 0;
    180                 _sumLat = 0.;
    181                 _sumLatQ = 0.;
    182                 _numLat = 0;
    183                 _minLat = 1000.;
    184                 _maxLat = -1000.;
    185               }
    186               if (_followSec) {
    187                 _diffSecGPS += _newSecGPS - _oldSecGPS;
    188                 if (_meanDiff>0.) {
    189                   if (_newSecGPS - _oldSecGPS > 1.5 * _meanDiff) {
    190                     _numGaps += 1;
    191                   }
    192                 }
    193               }
    194               _curLat = sec - _newSecGPS;
    195               _sumLat += _curLat;
    196               _sumLatQ += _curLat * _curLat;
    197               if (_curLat < _minLat) {_minLat = _curLat;}
    198               if (_curLat >= _maxLat) {_maxLat = _curLat;}
    199               _numLat += 1;
    200               _oldSecGPS = _newSecGPS;
    201               _followSec = true;
     133            QString late;
     134            late = QString("%1 ").arg(int((sec - secGPS)*100.)/100.);
     135            if (late != "") {
     136              emit(newMessage(QString(_staID + ": Latency " + late + "sec").toAscii() ) );
    202137            }
    203138          }
Note: See TracChangeset for help on using the changeset viewer.