Ignore:
Timestamp:
Oct 5, 2026, 1:55:39 PM (16 hours ago)
Author:
stuerze
Message:

update test suite and further findings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/RTCM3/RTCM3coDecoder.cpp

    r11068 r11074  
    223223    int bytesused = 0;
    224224
     225    // message type of the frame at the start of the buffer (RTCM number,
     226    // IGS-SSR 4076: 4076000 + subtype)
     227    int msgType = -1;
     228    if (_buffer.size() >= 6 && (unsigned char)_buffer[0] == 0xD3) {
     229      const unsigned char* bb = reinterpret_cast<const unsigned char*>(_buffer.constData());
     230      msgType = (bb[3] << 4) | (bb[4] >> 4);
     231      if (msgType == 4076) {
     232        msgType = 4076000 + (((bb[4] & 0x01) << 7) | (bb[5] >> 1));
     233      }
     234    }
     235
    225236    GCOB_RETURN irc = _ssrCorr->GetSSR(&_clkOrb, &_codeBias, &_vTEC, &_phaseBias, &_metaData, &_antenna,
    226237                                       _buffer.data(), _buffer.size(), &bytesused);
    … …  
    272283          checkProviderID();
    273284          sendResults();
     285          // Pass on the epoch as soon as it is complete, not only when the
     286          // next epoch arrives (one update interval later): complete when
     287          // all message types of the previous epoch have arrived with
     288          // Multiple Message Indicator 0. Consumers (PPP, combination) must
     289          // not see an epoch partly, e.g. new clocks with old orbits.
     290          if (irc == GCOBR_OK) {
     291            checkEpochComplete(msgType);
     292          }
    274293          retCode = success;
    275294        }
    … …  
    788807}
    789808
     809// Pass the current epoch on as soon as it is complete: every message type
     810// due at this epoch has arrived with Multiple Message Indicator 0. A type is
     811// due if its interval (learned from its previous epochs) has passed since
     812// its last epoch; types missing for more than three intervals are no longer
     813// expected. Until the intervals are known, and if a due type is missing,
     814// the epoch is passed on when the next epoch arrives. Types arriving after
     815// the epoch was passed on are passed on as soon as they are complete.
     816////////////////////////////////////////////////////////////////////////////
     817void RTCM3coDecoder::checkEpochComplete(int msgType) {
     818  const bncTime& epoch = _lastTime;
     819  if (_typeLast.contains(msgType)) {
     820    if (!(_typeLast[msgType] < epoch)) {
     821      if (epoch == _flushedEpoch) {
     822        dumpEpochs(true);  // repeated type of an epoch already passed on
     823      }
     824      return;
     825    }
     826    _typeInt[msgType] = epoch - _typeLast[msgType];
     827  }
     828  _typeLast[msgType] = epoch;
     829
     830  if (epoch == _flushedEpoch) {
     831    dumpEpochs(true);
     832    return;
     833  }
     834  bool complete = !_typeInt.isEmpty();
     835  QMapIterator<int, double> it(_typeInt);
     836  while (it.hasNext()) {
     837    it.next();
     838    double sinceLast = epoch - _typeLast[it.key()];
     839    if (sinceLast > 0.0 && sinceLast >= it.value() - 0.1 && sinceLast <= 3.0 * it.value()) {
     840      complete = false;
     841      break;
     842    }
     843  }
     844  if (complete) {
     845    dumpEpochs(true);
     846    _flushedEpoch = epoch;
     847  }
     848}
     849
    790850// Emit and write the collected corrections of all epochs older than
    791851// _lastTime (all epochs if all is set, e.g. at the end of a replay)
Note: See TracChangeset for help on using the changeset viewer.