Changeset 3109 in ntrip


Ignore:
Timestamp:
Mar 22, 2011, 10:57:19 AM (13 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncapp.cpp

    r3034 r3109  
    751751
    752752  bncSettings settings;
    753   _waitCoTime    = settings.value("corrTime").toInt();
    754   if (_waitCoTime < 1) {
    755     _waitCoTime = 1;
     753  _waitCoTime = settings.value("corrTime").toInt();
     754  if (_waitCoTime < 0) {
     755    _waitCoTime = 0;
    756756  }
    757757
     
    764764  // An old correction - throw it away
    765765  // ---------------------------------
    766   if (coTime <= _lastDumpCoSec) {
     766  if (_waitCoTime > 0 && coTime <= _lastDumpCoSec) {
    767767    if (!_bncComb) {
    768768      QString line = staID + ": Correction for one sat neglected because overaged by " +
     
    779779  // Dump Corrections
    780780  // ----------------
    781   if (coTime - _waitCoTime > _lastDumpCoSec) {
     781  if      (_waitCoTime == 0) {
     782    dumpCorrs();
     783  }
     784  else if (coTime - _waitCoTime > _lastDumpCoSec) {
    782785    dumpCorrs(_lastDumpCoSec + 1, coTime - _waitCoTime);
    783786    _lastDumpCoSec = coTime - _waitCoTime;
     
    788791////////////////////////////////////////////////////////////////////////////
    789792void bncApp::dumpCorrs(long minTime, long maxTime) {
    790 
    791793  for (long sec = minTime; sec <= maxTime; sec++) {
    792794    QList<QString> allCorrs = _corrs->values(sec);
    793     emit newCorrections(allCorrs);
    794     if (_socketsCorr) {
    795       QListIterator<QString> it(allCorrs);
    796       while (it.hasNext()) {
    797         QString corrLine = it.next() + "\n";
    798      
    799         QMutableListIterator<QTcpSocket*> is(*_socketsCorr);
    800         while (is.hasNext()) {
    801           QTcpSocket* sock = is.next();
    802           if (sock->state() == QAbstractSocket::ConnectedState) {
    803             if (sock->write(corrLine.toAscii()) == -1) {
    804               delete sock;
    805               is.remove();
    806             }
    807           }
    808           else if (sock->state() != QAbstractSocket::ConnectingState) {
     795    dumpCorrs(allCorrs);
     796    _corrs->remove(sec);
     797  }
     798}
     799
     800// Dump all corrections
     801////////////////////////////////////////////////////////////////////////////
     802void bncApp::dumpCorrs() {
     803}
     804
     805// Dump List of Corrections
     806////////////////////////////////////////////////////////////////////////////
     807void bncApp::dumpCorrs(const QList<QString>& allCorrs) {
     808  emit newCorrections(allCorrs);
     809  if (_socketsCorr) {
     810    QListIterator<QString> it(allCorrs);
     811    while (it.hasNext()) {
     812      QString corrLine = it.next() + "\n";
     813   
     814      QMutableListIterator<QTcpSocket*> is(*_socketsCorr);
     815      while (is.hasNext()) {
     816        QTcpSocket* sock = is.next();
     817        if (sock->state() == QAbstractSocket::ConnectedState) {
     818          if (sock->write(corrLine.toAscii()) == -1) {
    809819            delete sock;
    810820            is.remove();
    811821          }
    812822        }
     823        else if (sock->state() != QAbstractSocket::ConnectingState) {
     824          delete sock;
     825          is.remove();
     826        }
    813827      }
    814828    }
    815     _corrs->remove(sec);
    816829  }
    817830}
  • trunk/BNC/bncapp.h

    r3027 r3109  
    8282                     const QByteArray& allLines);
    8383    void dumpCorrs(long minTime, long maxTime);
     84    void dumpCorrs();
     85    void dumpCorrs(const QList<QString>& allCorrs);
    8486    void messagePrivate(const QByteArray& msg);
    8587
  • trunk/BNC/bncwindow.cpp

    r3083 r3109  
    206206  _corrPortLineEdit    = new QLineEdit(settings.value("corrPort").toString());
    207207  _corrTimeSpinBox   = new QSpinBox();
    208   _corrTimeSpinBox->setMinimum(1);
     208  _corrTimeSpinBox->setMinimum(0);
    209209  _corrTimeSpinBox->setMaximum(60);
    210210  _corrTimeSpinBox->setSingleStep(1);
Note: See TracChangeset for help on using the changeset viewer.