Changeset 9271 in ntrip


Ignore:
Timestamp:
Nov 24, 2020, 10:50:35 PM (3 years ago)
Author:
stuerze
Message:

bug fixes in eph check

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/BNC_2.12/src/bncephuser.cpp

    r9261 r9271  
    153153  if (ephOld &&
    154154      (ephOld->checkState() == t_eph::bad ||
    155        ephOld->checkState() == t_eph::outdated)) {
     155       ephOld->checkState() == t_eph::outdated ||
     156       ephOld->checkState() == t_eph::unhealthy)) {
    156157    ephOld = 0;
    157158  }
    158159
    159160  if (ephOld == 0 || newEph->isNewerThan(ephOld)) {
    160     checkEphemeris(eph, realTime);
     161    checkEphemeris(newEph, realTime);
     162    eph->setCheckState(newEph->checkState());
    161163  }
    162164  else {
     
    165167  }
    166168
    167   if (eph->checkState() != t_eph::bad &&
    168       eph->checkState() != t_eph::outdated) {
     169  if (newEph->checkState() != t_eph::bad &&
     170      newEph->checkState() != t_eph::outdated) {
    169171    deque<t_eph*>& qq = _eph[prn];
    170     qq.push_back(newEph);
     172    if (qq.empty() || newEph->isNewerThan(qq.back())){
     173      qq.push_back(newEph);
     174    }
    171175    if (qq.size() > _maxQueueSize) {
    172176      delete qq.front();
     
    261265  // Check consistency with older ephemeris
    262266  // --------------------------------------
    263   const double MAXDIFF = 1000.0;
    264   const double MINDIFF =    1.0;
     267  const double MAXDIFF = 10.0;
     268  const double MINDIFF = 0.005;
    265269  QString      prn     = QString(eph->prn().toInternalString().c_str());
    266270  t_eph*       ephL    = ephLast(prn);
     
    277281    double diffC = fabs(xc(4) - xcL(4)) * t_CST::c;
    278282
    279     // some lines to allow update of ephemeris data sets after an outage
    280     // update interval: 2h,
    281     if      (eph->type() == t_eph::GPS     && dt >  2*3600.0) {
    282       ephL->setCheckState(t_eph::outdated);
    283       return;
    284     }
    285     // update interval: 3h,
    286     else if (eph->type() == t_eph::Galileo && dt >  3*3600.0) {
    287       ephL->setCheckState(t_eph::outdated);
    288       return;
    289     }
    290     // updated every 30 minutes
    291     else if (eph->type() == t_eph::GLONASS && dt >    1800.0) {
    292       ephL->setCheckState(t_eph::outdated);
    293       return;
    294     }
    295     // updated every ?
    296     else if (eph->type() == t_eph::QZSS    && dt >  2*3600.0) {
    297       ephL->setCheckState(t_eph::outdated);
    298       return;
    299     }
    300     // maximum update interval: 300 sec
    301     else if  (eph->type() == t_eph::SBAS   && dt >     300.0) {
    302       ephL->setCheckState(t_eph::outdated);
    303       return;
    304     }
    305     // updates 1h (GEO) up to 6 hours non-GEO
    306     else if  (eph->type() == t_eph::BDS    && dt >  6*3600.0) {
    307       ephL->setCheckState(t_eph::outdated);
    308       return;
    309     }
    310     // update interval: up to 24 hours
    311     else if  (eph->type() == t_eph::IRNSS  && dt > 24*3600.0) {
    312       ephL->setCheckState(t_eph::outdated);
    313       return;
    314     }
    315 
    316     if (diff < MAXDIFF || diffC < MAXDIFF) {
    317       if (dt != 0.0) {
    318         if (diff < MINDIFF && diffC < MINDIFF && ephL->checkState() == t_eph::ok) {
    319           // to prevent the same data sets with different TOC values
    320           eph->setCheckState(t_eph::bad);
    321         }
    322         else {
    323           eph->setCheckState(t_eph::ok);
    324           ephL->setCheckState(t_eph::ok);
    325         }
     283    if (diff < MAXDIFF && diffC < MAXDIFF) {
     284      if (diff < MINDIFF && diffC < MINDIFF && ephL->checkState() == t_eph::ok) {
     285        // to prevent the same data sets with different TOC values
     286        eph->setCheckState(t_eph::bad);
     287      }
     288      else {
     289        eph->setCheckState(t_eph::ok);
     290        ephL->setCheckState(t_eph::ok);
    326291      }
    327292    }
     
    331296      }
    332297    }
    333   }
    334 }
     298    // some lines to allow update of ephemeris data sets after an outage
     299    // update interval: 2h,
     300    if      (eph->type() == t_eph::GPS     && dt > (2*3600.0 + 60.0)) {
     301      ephL->setCheckState(t_eph::outdated);
     302      return;
     303    }
     304    // update interval: 3h,
     305    else if (eph->type() == t_eph::Galileo && dt > (3*3600.0 + 60.0)) {
     306      ephL->setCheckState(t_eph::outdated);
     307      return;
     308    }
     309    // updated every 30 minutes
     310    else if (eph->type() == t_eph::GLONASS && dt > (1800.0 + 60.0)) {
     311      ephL->setCheckState(t_eph::outdated);
     312      return;
     313    }
     314    // updated every ?
     315    else if (eph->type() == t_eph::QZSS    && dt > (2*3600.0 + 60.0)) {
     316      ephL->setCheckState(t_eph::outdated);
     317      return;
     318    }
     319    // maximum update interval: 300 sec
     320    else if  (eph->type() == t_eph::SBAS   && dt > (   300.0)) {
     321      ephL->setCheckState(t_eph::outdated);
     322      return;
     323    }
     324    // updates 1h (GEO) up to 6 hours non-GEO
     325    else if  (eph->type() == t_eph::BDS    && dt >  6*3600.0) {
     326      ephL->setCheckState(t_eph::outdated);
     327      return;
     328    }
     329    // update interval: up to 24 hours
     330    else if  (eph->type() == t_eph::IRNSS  && dt > 24*3600.0) {
     331      ephL->setCheckState(t_eph::outdated);
     332      return;
     333    }
     334  }
     335}
Note: See TracChangeset for help on using the changeset viewer.