Changeset 3690 in ntrip


Ignore:
Timestamp:
Feb 12, 2012, 2:27:04 PM (12 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/corrfile.cpp

    r3689 r3690  
    6666void t_corrFile::syncRead(const bncTime& tt) {
    6767
     68  QList<QString> corrs;
    6869
     70  if (!_lastLine.isEmpty() && !stopRead(tt)) {
     71    corrs << _lastLine;
     72  }
     73
     74  while (_stream->status() == QTextStream::Ok && !_stream->atEnd()) {
     75    QString line = _stream->readLine();
     76    if (line.isEmpty() || line[0] == '!') {
     77      continue;
     78    }
     79    _lastLine = line;
     80
     81    if (stopRead(tt)) {
     82      if (corrs.size()) {
     83        emit newCorrections(corrs);
     84      }
     85    }
     86    else {
     87      corrs << _lastLine;
     88    }
     89  }
    6990}
     91
     92// Read till a given time
     93////////////////////////////////////////////////////////////////////////////
     94bool t_corrFile::stopRead(const bncTime& tt) {
     95
     96  if (_lastLine.isEmpty()) {
     97    return false;
     98  }
     99
     100  QTextStream in(_lastLine.toAscii(), QIODevice::ReadOnly);
     101  int    messageType, updateInterval, GPSweek;
     102  double GPSweeks;
     103  in >> messageType >> updateInterval >> GPSweek >> GPSweeks;
     104
     105  bncTime tNew(GPSweek, GPSweeks);
     106
     107  if (tNew >= tt) {
     108    return true;
     109  }   
     110  else {
     111    return false;
     112  }
     113}
  • trunk/BNC/corrfile.h

    r3689 r3690  
    4242
    4343 private:
    44   QFile*         _file;
    45   QTextStream*   _stream;
     44  bool stopRead(const bncTime& tt);
     45  QFile*       _file;
     46  QTextStream* _stream;
     47  QString      _lastLine;
    4648};
    4749
Note: See TracChangeset for help on using the changeset viewer.