Changeset 9317 in ntrip for trunk


Ignore:
Timestamp:
Dec 17, 2020, 3:48:53 PM (4 years ago)
Author:
stuerze
Message:

some lines are added to consider corrected GPS BRDC data sets which come 16 seconds befor nominal TOC

Location:
trunk/BNC/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncephuser.cpp

    r9301 r9317  
    158158  }
    159159
    160   if (ephOld == 0 || newEph->isNewerThan(ephOld)) {
     160  if ( (ephOld == 0) ||
     161       newEph->isNewerThan(ephOld) ||
     162       newCorrectedGpsEphSet(newEph)  ) {
    161163    checkEphemeris(newEph, realTime);
    162164    eph->setCheckState(newEph->checkState());
     
    170172      newEph->checkState() != t_eph::outdated) {
    171173    deque<t_eph*>& qq = _eph[prn];
    172     if (qq.empty() ||
    173         newEph->isNewerThan(qq.back())){
    174       qq.push_back(newEph);
    175       if (qq.size() > _maxQueueSize) {
    176         delete qq.front();
    177         qq.pop_front();
    178       }
    179       ephBufferChanged();
    180       return success;
    181     }
    182     else {
    183       delete newEph;
    184       return failure;
    185     }
     174    qq.push_back(newEph);
     175    if (qq.size() > _maxQueueSize) {
     176      delete qq.front();
     177      qq.pop_front();
     178    }
     179    ephBufferChanged();
     180    return success;
    186181  }
    187182  else {
     
    279274    ColumnVector vvL(3);
    280275    ephL->getCrd(eph->TOC(), xcL, vvL, false);
    281     double dt = eph->TOC() - ephL->TOC();
    282     if (dt < 0.0) {
    283       dt += 604800.0;
    284     }
     276
    285277    double diff  = (xc.Rows(1,3) - xcL.Rows(1,3)).NormFrobenius();
    286278    double diffC = fabs(xc(4) - xcL(4)) * t_CST::c;
    287279
    288280    if (diff < MAXDIFF && diffC < MAXDIFF) {
    289       if (diff < MINDIFF && diffC < MINDIFF && ephL->checkState() == t_eph::ok) {
     281      if (diff < MINDIFF && diffC < MINDIFF &&
     282          ephL->checkState() == t_eph::ok) {
    290283        // to prevent the same data sets with different TOC values
    291284        eph->setCheckState(t_eph::bad);
     
    301294      }
    302295    }
     296
     297    double dt = eph->TOC() - ephL->TOC();
    303298    // some lines to allow update of ephemeris data sets after an outage
     299    // -----------------------------------------------------------------
    304300    // update interval: 2h,
     301    // sometimes corrected BRDC sets are sent with TOC values 16 seconds
     302    // before the nominal TOC (integer time)
    305303    if      (eph->type() == t_eph::GPS     && dt > (2*3600.0 + 60.0)) {
    306304      ephL->setCheckState(t_eph::outdated);
     
    313311    }
    314312    // updated every 30 minutes
    315     else if (eph->type() == t_eph::GLONASS && dt > (1800.0 + 60.0)) {
     313    else if (eph->type() == t_eph::GLONASS && dt > (  1800.0 + 60.0)) {
    316314      ephL->setCheckState(t_eph::outdated);
    317315      return;
     
    339337  }
    340338}
     339
     340//
     341////////////////////////////////////////////////////////////////////////////
     342bool bncEphUser::newCorrectedGpsEphSet(t_eph* eph) {
     343
     344  bool correctedGpsEphSet = false;
     345  bool newCorrectedGpsEphSet = false;
     346
     347  if (eph->prn().system() != 'G') {
     348    return newCorrectedGpsEphSet;
     349  }
     350
     351  if ((fmod(eph->TOC().daysec()+16.0, 7200) == 0.0)) {
     352    // sometimes corrected BRDC sets are sent with TOC values 16 seconds
     353    // before the nominal TOC (integer time)
     354    correctedGpsEphSet = true;
     355  }
     356
     357  QString      prn     = QString(eph->prn().toInternalString().c_str());
     358  t_eph*       ephL    = ephLast(prn);
     359  if (!ephL) { // first set for GPS Sat
     360    return correctedGpsEphSet;
     361  }
     362
     363
     364  double dt = eph->TOC() - ephL->TOC();
     365  if (correctedGpsEphSet){
     366    if (dt == 0.0) {
     367      newCorrectedGpsEphSet = false;
     368    }
     369    else {
     370      newCorrectedGpsEphSet = true;
     371    }
     372  }
     373  return  newCorrectedGpsEphSet;
     374}
  • trunk/BNC/src/bncephuser.h

    r8702 r9317  
    7575 private:
    7676  void checkEphemeris(t_eph* eph, bool realTime);
     77  bool newCorrectedGpsEphSet(t_eph* eph);
    7778  QMutex                             _mutex;
    7879  static const unsigned              _maxQueueSize = 6;
Note: See TracChangeset for help on using the changeset viewer.