Changeset 3230 in ntrip


Ignore:
Timestamp:
Mar 31, 2011, 6:47:31 PM (13 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/upload/bncrtnetuploadcaster.cpp

    r3227 r3230  
    194194  QMutexLocker locker(&_mutex);
    195195
    196   // Append to buffer
    197   // ----------------
     196  // Append to internal buffer
     197  // -------------------------
    198198  _rtnetStreamBuffer.append(QByteArray(buffer, bufLen));
    199   int iLastAsterix = _rtnetStreamBuffer.lastIndexOf('*'); // begin of last epoch
    200   if (iLastAsterix == -1) {
     199
     200  // Select buffer part that contains last epoch
     201  // -------------------------------------------
     202  QStringList lines;
     203  int iEpoBeg = _rtnetStreamBuffer.lastIndexOf('*');   // begin of last epoch
     204  if (iEpoBeg == -1) {
    201205    _rtnetStreamBuffer.clear();
    202206    return;
    203207  }
     208  _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoBeg);
     209
     210  int iEpoEnd = _rtnetStreamBuffer.lastIndexOf("EOE"); // end   of last epoch
     211  if (iEpoEnd == -1) {
     212    return;
     213  }
    204214  else {
    205     _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iLastAsterix);
    206   }
    207 
    208   // Prepare list of lines with satellite positions in SP3-like format
    209   // -----------------------------------------------------------------
    210   QStringList lines = _rtnetStreamBuffer.split('\n', QString::SkipEmptyParts);
     215    lines = _rtnetStreamBuffer.left(iEpoEnd).split('\n', QString::SkipEmptyParts);
     216    _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoEnd+3);
     217  }
    211218
    212219  if (lines.size() < 2) {
Note: See TracChangeset for help on using the changeset viewer.