Changeset 8753 in ntrip


Ignore:
Timestamp:
May 15, 2019, 1:51:56 PM (6 weeks ago)
Author:
stuerze
Message:

minor changes to read the RTNET data buffer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/BNC_2.12/src/upload/bncrtnetuploadcaster.cpp

    r8741 r8753  
    244244    return;
    245245  }
    246     else {
     246  int iEpoBegEarlier = _rtnetStreamBuffer.indexOf('*');
     247  if (iEpoBegEarlier != -1 && iEpoBegEarlier < iEpoBeg) { // are there two epoch lines in buffer?
     248    _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoBegEarlier);
     249  }
     250  else {
    247251    _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoBeg);
    248252  }
    249 
    250   int iEpoEnd = _rtnetStreamBuffer.indexOf("EOE"); // end of last epoch
     253  int iEpoEnd = _rtnetStreamBuffer.lastIndexOf("EOE"); // end of last epoch
    251254  if (iEpoEnd == -1) {
    252255    return;
    253256  }
    254   else {
    255     lines = _rtnetStreamBuffer.left(iEpoEnd).split('\n',
    256         QString::SkipEmptyParts);
    257     _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoEnd + 3);
    258   }
     257
     258  while (_rtnetStreamBuffer.count('*') > 1) { // is there more than 1 epoch line in buffer?
     259    QString rtnetStreamBuffer = _rtnetStreamBuffer.mid(1);
     260    int nextEpoch = rtnetStreamBuffer.indexOf('*');
     261    if (nextEpoch != -1 && nextEpoch < iEpoEnd) {
     262      _rtnetStreamBuffer = _rtnetStreamBuffer.mid(nextEpoch);
     263    }
     264  }
     265
     266  lines = _rtnetStreamBuffer.left(iEpoEnd).split('\n',
     267      QString::SkipEmptyParts);
     268  _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoEnd + 3);
    259269
    260270  if (lines.size() < 2) {
     
    345355  phasebias.UpdateInterval = clkUpdInd;
    346356
    347   for (int ii = 1; ii < lines.size(); ii++) {
     357  for (int ii = 1; ii < lines.size(); ii++) {qDebug() << "line: " << lines[ii];
    348358    QString key;  // prn or key VTEC, IND (phase bias indicators)
    349359    double rtnUra = 0.0;    // [m]
Note: See TracChangeset for help on using the changeset viewer.