Changeset 11221 in ntrip for trunk/BNC/src


Ignore:
Timestamp:
Nov 23, 2026, 11:38:54 PM (6 days ago)
Author:
stuerze
Message:

some bugfixes

Location:
trunk/BNC/src
Files:
6 edited

Legend:

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

    r11194 r11221  
    111111  _providerID[2] = -1;
    112112
     113  _vTecMoreFollows = false;
     114
    113115  for (unsigned s = 0; s < CLOCKORBIT_SATNUM; s++) {
    114116    _antennaReceived[s]    = false;
    … …  
    302304          emit newLogRecord(t_logRecord::message(t_logRecord::warning, "RTCM3coDecoder: _lastTime invalid: " + _staID.toLatin1()), true);
    303305          retCode = failure;
     306        }
     307        // A VTEC message with Multiple Message Indicator 1 is continued by the
     308        // next VTEC message of the same epoch (layers appended); any other
     309        // VTEC message starts the record of its epoch anew (sendResults())
     310        if (_vTEC.NumLayers > 0) {
     311          _vTecMoreFollows = (irc == GCOBR_MESSAGEFOLLOWS);
    304312        }
    305313        // Keep _phaseBias intact: an Extended Phase Bias message (COBOFS_PBEXT)
    … …  
    670678  // -----------------
    671679  if (_vTEC.NumLayers > 0) {
     680    // A complete (re)transmission of an epoch already in the map must replace
     681    // it, not add its layers again: IONO01IGS0 repeats each 1264 message up to
     682    // 400 times (Nov 2026), which summed up to 3900 TECU in PPP and SSR QC.
     683    // Only the continuation of a multi-message model (previous MMI 1) appends.
     684    if (!_vTecMoreFollows) {
     685      _vTecMap[_lastTime] = t_vTec();
     686    }
    672687    _vTecMap[_lastTime]._time  = _lastTime;
    673688    _vTecMap[_lastTime]._updateInt =  _vTEC.UpdateInterval;
  • trunk/BNC/src/RTCM3/RTCM3coDecoder.h

    r11194 r11221  
    137137  unsigned int                          _phaseBiasSentEpoch[CLOCKORBIT_SATNUM];
    138138  bool                                  _antennaReceived[CLOCKORBIT_SATNUM];
     139  bool                                  _vTecMoreFollows; // last VTEC message had MMI 1: the next one continues its epoch
    139140  unsigned int                          _antennaSentProviderID[CLOCKORBIT_COUNTSAT];
    140141  unsigned int                          _antennaSentIOD[CLOCKORBIT_COUNTSAT];
  • trunk/BNC/src/bnchelp.html

    r11220 r11221  
    77977797  </p>
    77987798  <p>
     7799    In real-time PPP (also in the replay of a raw file), corrections with an epoch time more than 900 seconds from the
     7800    current time, e.g. an erroneously encoded GLONASS epoch hours ahead, are not used: they would make the satellites
     7801    unusable until the next correction and, with 'Wait for clock corr.', discard the observation epochs received in
     7802    the meantime. Code and phase biases are only rejected for a future epoch, as their epoch may legitimately be hours
     7803    old (Galileo HAS). Such an epoch is reported in the logfile at most once per hour, e.g. 'WTZR00DEU0: PPP:
     7804    SSRA00SHA1 orbit correction epoch ... is 11116 s from the current time, not used'.
     7805  </p>
     7806  <p>
    77997807    Default is an empty option field, meaning that you want BNC to process observations immediately after their arrival
    78007808    through applying the latest received clock correction.
    … …  
    83428350 dC_frame = Orb_AC * (Orb_AC - Orb_MasterAC) / Range_sat
    83438351</pre>
     8352  with Orb_AC and Orb_MasterAC the satellite positions of the broadcast ephemeris corrected by the SSR orbit
     8353  correction of the respective AC, i.e. the radial difference of the two orbits, which the clock of the AC absorbs.
    83448354  <pre>
    83458355 dC_att = (yawAngle_MasterAC - yawAngle_AC) / (2*PI) * wavelength(IF)
  • trunk/BNC/src/combination/bnccomb.cpp

    r11220 r11221  
    25962596        }
    25972597        else {
    2598           corr->_satPos = xc.Rows(1,3);
     2598          // Position with the AC's orbit correction (referred to ephLast by
     2599          // switchToLastEph): the broadcast position alone is the same for
     2600          // all ACs, so dC_orb was always zero (since r10820) and the clocks
     2601          // of the ACs were not made consistent with the master orbit, e.g.
     2602          // R23 of the GLONASS master CHC00 0.33 m radial off (Nov 2026)
     2603          ColumnVector xB     = xc.Rows(1,3);
     2604          ColumnVector vFrame = corr->_eph->ssrFrameVel(xc, vv); // GEO: inertial velocity
     2605          double       dtO    = corr->_time - corr->_orbCorr._time;
     2606          ColumnVector dRAO   = corr->_orbCorr._xr + corr->_orbCorr._dotXr * dtO;
     2607          ColumnVector dX(3);
     2608          RSW_to_XYZ(xB, vFrame, dRAO, dX);
     2609          corr->_satPos = xB - dX;  // SSR: corrected position = broadcast - correction
    25992610        }
    26002611      }
  • trunk/BNC/src/pppRun.cpp

    r11196 r11221  
    500500
    501501//
     502// Real-time input (incl. raw file replay): true if the correction epoch is
     503// more than MAX_EPOCH_OFFSET from the current time, e.g. an erroneously
     504// encoded GLONASS epoch hours ahead (not used, as in the combination and the
     505// SSR QC). It would make the satellites unusable (age check of the
     506// corrections), discard observation epochs (correction wait time) and
     507// extrapolate the yaw angle over hours until the next correction. Biases
     508// (pastOk) are only rejected for a future epoch: their epoch may legitimately
     509// be hours old (Galileo HAS). A warning at most once per hour.
     510////////////////////////////////////////////////////////////////////////////
     511bool t_pppRun::badEpoch(const bncTime& epoTime, const string& staID,
     512                        const char* type, bool pastOk) {
     513  const double MAX_EPOCH_OFFSET = 900.0; // [s]
     514  if (!_opt->_realTime) {
     515    return false;
     516  }
     517  int    currentWeek = 0;
     518  double currentSec  = 0.0;
     519  currentGPSWeeks(currentWeek, currentSec);
     520  bncTime currentTime(currentWeek, currentSec);
     521  double offset = epoTime - currentTime;
     522  if (fabs(offset) <= MAX_EPOCH_OFFSET || (pastOk && offset < 0.0)) {
     523    return false;
     524  }
     525  if (!_badEpochWarned.valid() || currentTime - _badEpochWarned >= 3600.0) {
     526    _badEpochWarned = currentTime;
     527    emit newLogRecord(t_logRecord::message(t_logRecord::warning, QByteArray(_opt->_roverName.c_str()) + ": PPP: " +
     528                    QByteArray(staID.c_str()) + " " + type + " correction epoch " +
     529                    QByteArray(epoTime.datestr().c_str()) + " " + epoTime.timestr().c_str() +
     530                    QString(" is %1 s from the current time, not used").arg(offset, 0, 'f', 0).toLatin1() +
     531                    " (further ones not reported within the next hour)"), true);
     532  }
     533  return true;
     534}
     535
     536//
    502537////////////////////////////////////////////////////////////////////////////
    503538void t_pppRun::slotNewTec(t_vTec vTec) {
    … …  
    521556    }
    522557  }
     558  if (badEpoch(vTec._time, vTec._staID, "VTEC")) {
     559    return;
     560  }
    523561  _pppClient->putTec(&vTec);
    524562}
    … …  
    553591  vector<t_orbCorr*> corrections;
    554592  for (int ii = 0; ii < orbCorr.size(); ii++) {
    555     corrections.push_back(new t_orbCorr(orbCorr[ii]));
     593    if (!badEpoch(orbCorr[ii]._time, orbCorr[ii]._staID, "orbit")) {
     594      corrections.push_back(new t_orbCorr(orbCorr[ii]));
     595    }
     596  }
     597  if (corrections.empty()) {
     598    return;
    556599  }
    557600
    … …  
    577620  vector<t_clkCorr*> corrections;
    578621  for (int ii = 0; ii < clkCorr.size(); ii++) {
    579     corrections.push_back(new t_clkCorr(clkCorr[ii]));
    580     _lastClkCorrTime = clkCorr[ii]._time;
     622    if (!badEpoch(clkCorr[ii]._time, clkCorr[ii]._staID, "clock")) {
     623      corrections.push_back(new t_clkCorr(clkCorr[ii]));
     624      _lastClkCorrTime = clkCorr[ii]._time;
     625    }
     626  }
     627  if (corrections.empty()) {
     628    return;
    581629  }
    582630  _pppClient->putClkCorrections(corrections);
    … …  
    611659  vector<t_satCodeBias*> biases;
    612660  for (int ii = 0; ii < codeBiases.size(); ii++) {
    613     biases.push_back(new t_satCodeBias(codeBiases[ii]));
     661    if (!badEpoch(codeBiases[ii]._time, codeBiases[ii]._staID, "code bias", true)) {
     662      biases.push_back(new t_satCodeBias(codeBiases[ii]));
     663    }
     664  }
     665  if (biases.empty()) {
     666    return;
    614667  }
    615668
    … …  
    672725  vector<t_satPhaseBias*> biases;
    673726  for (int ii = 0; ii < phaseBiases.size(); ii++) {
    674     biases.push_back(new t_satPhaseBias(phaseBiases[ii]));
     727    if (!badEpoch(phaseBiases[ii]._time, phaseBiases[ii]._staID, "phase bias", true)) {
     728      biases.push_back(new t_satPhaseBias(phaseBiases[ii]));
     729    }
     730  }
     731  if (biases.empty()) {
     732    return;
    675733  }
    676734
  • trunk/BNC/src/pppRun.h

    r11179 r11221  
    5555
    5656 private:
     57  bool badEpoch(const bncTime& epoTime, const std::string& staID, const char* type, bool pastOk = false);
    5758  class t_epoData {
    5859   public:
    … …  
    7576  std::deque<t_epoData*> _epoData;
    7677  bncTime                _lastClkCorrTime;
     78  bncTime                _badEpochWarned;   // last bad-epoch warning (current time)
    7779  t_rnxObsFile*          _rnxObsFile;
    7880  t_rnxNavFile*          _rnxNavFile;
Note: See TracChangeset for help on using the changeset viewer.