Changeset 1572 in ntrip for trunk


Ignore:
Timestamp:
Feb 11, 2009, 12:48:55 AM (16 years ago)
Author:
weber
Message:

* empty log message *

Location:
trunk/BNC
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncgetthread.cpp

    r1571 r1572  
    321321
    322322      if (tryReconnect() != success) {
     323        _latencyChecker->checkReconnect();
    323324        continue;
    324325      }
     
    351352      // ------------------
    352353      if (nBytes == 0) {
    353         _latencyChecker->checkReconnect();
    354354        emit(newMessage(_staID + ": Data timeout, reconnecting", true));
    355355        continue;
  • trunk/BNC/latencychecker.cpp

    r1568 r1572  
    151151  _decodeSucc = QDateTime::currentDateTime();
    152152
     153  _decodeStop = QDateTime::currentDateTime();
     154
    153155}
    154156
     
    161163//////////////////////////////////////////////////////////////////////////////
    162164void latencyChecker::checkReconnect() {
    163   _reConnect = true;
     165
     166  // Begin outage threshold
     167  // ----------------------
     168  if ( _decodeStop.isValid() ) {
     169    if ( _decodeStop.secsTo(QDateTime::currentDateTime()) >  _adviseFail * 60 ) {
     170      _decodeStop.setDate(QDate());
     171      _decodeStop.setTime(QTime());
     172      _begDateOut = _checkTime.toUTC().date().toString("yy-MM-dd");
     173      _begTimeOut = _checkTime.toUTC().time().toString("hh:mm:ss");
     174      emit(newMessage((_staID
     175                    + ": Failure threshold exceeded, outage since "
     176                    + _begDateOut + " " + _begTimeOut).toAscii(), true));
     177      callScript(("Begin_Outage "
     178                    + _begDateOut + " " + _begTimeOut).toAscii());
     179    }
     180    _decodeStart = QDateTime::currentDateTime();
     181  }
     182
    164183}
    165184
     
    257276  }
    258277
    259   // Begin outage threshold
    260   // ----------------------
    261   if ( _decodeStop.isValid() ) {
    262     if ( _decodeStop.secsTo(QDateTime::currentDateTime()) >  _adviseFail * 60 ) {
    263       _decodeStop.setDate(QDate());
    264       _decodeStop.setTime(QTime());
    265       _begDateOut = _checkTime.toUTC().date().toString("yy-MM-dd");
    266       _begTimeOut = _checkTime.toUTC().time().toString("hh:mm:ss");
    267       emit(newMessage((_staID
    268                     + ": Failure threshold exceeded, outage since "
    269                     + _begDateOut + " " + _begTimeOut).toAscii(), true));
    270       callScript(("Begin_Outage "
    271                     + _begDateOut + " " + _begTimeOut).toAscii());
    272       _decodeStart = QDateTime::currentDateTime();
    273     }
    274   }
    275 
    276278  // End outage threshold
    277279  // --------------------
     
    292294                    + _endDateOut + " " + _endTimeOut + " Begin was "
    293295                    + _begDateOut + " " + _begTimeOut).toAscii());
    294       _decodeStop = QDateTime::currentDateTime();
    295     }
    296   }
    297   _reConnect = false;
    298 
     296    _decodeStop = QDateTime::currentDateTime();
     297    }
     298  }
    299299}
    300300
  • trunk/BNC/latencychecker.h

    r1568 r1572  
    6565  bool       _endCorrupt;
    6666  bool       _followSec;
    67   bool       _reConnect;
    6867  double     _maxDt;
    6968  double     _sumLat;
Note: See TracChangeset for help on using the changeset viewer.