Changeset 6981 in ntrip


Ignore:
Timestamp:
Jun 29, 2015, 2:35:47 PM (9 years ago)
Author:
stuerze
Message:

changes to prevent the upload of ephemeris, which are detected as erroneous; further ephemris checks regarding their age are added

Location:
trunk/BNC/src
Files:
2 edited

Legend:

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

    r6809 r6981  
    154154  const t_eph* ephOld = ephLast(prn);
    155155
    156   if (ephOld == 0 || newEph->isNewerThan(ephOld)) {
     156  if (ephOld && ephOld->checkState() == t_eph::bad) {
     157    ephOld = 0;
     158  }
     159 
     160  if ((ephOld == 0 || newEph->isNewerThan(ephOld)) &&
     161      eph->checkState() != t_eph::bad) {
    157162    deque<t_eph*>& qq = _eph[prn];
    158163    qq.push_back(newEph);
     
    195200    return;
    196201  }
     202
     203  // Check whether the epoch is too far away the current time
     204  // --------------------------------------------------------
     205  bncTime   toc = eph->TOC();
     206  QDateTime now = currentDateAndTimeGPS();
     207  bncTime currentTime(now.toString(Qt::ISODate).toStdString());
     208  double timeDiff = fabs(toc - currentTime);
     209
     210  if      (eph->type() == t_eph::GPS  || t_eph::Galileo) {
     211    if (timeDiff > 4*3600) { // data sets are valid for 4 hours
     212      eph->setCheckState(t_eph::bad);
     213      return;
     214    }
     215  }
     216  else if (eph->type() == t_eph::GLONASS) {
     217    if (timeDiff > 1*3600) { // updated every 30 minutes
     218      eph->setCheckState(t_eph::bad);
     219      return;
     220    }
     221  }
     222  else if (eph->type() == t_eph::QZSS) {
     223    if (timeDiff > 1*3600) {
     224      eph->setCheckState(t_eph::bad);
     225      return;
     226    }
     227  }
     228  else if (eph->type() == t_eph::SBAS) {
     229    if (timeDiff > 300) { // maximum update interval
     230      eph->setCheckState(t_eph::bad);
     231      return;
     232    }
     233  }
     234  else if (eph->type() == t_eph::BDS) {
     235    if (timeDiff > 6*3600) { // updates 1 (GEO) up to 6 hours
     236      eph->setCheckState(t_eph::bad);
     237      return;
     238    }
     239  }
     240
    197241
    198242  // Check consistency with older ephemerides
     
    209253    double diff = (xc.Rows(1,3) - xcL.Rows(1,3)).norm_Frobenius();
    210254
     255    // some lines to allow update of ephemeris data sets after outage
     256    if      ((eph->type() == t_eph::GPS ||
     257              eph->type() == t_eph::Galileo)  && dt > 4*3600) {
     258      ephL->setCheckState(t_eph::bad);
     259      return;
     260    }
     261    else if ((eph->type() == t_eph::GLONASS ||
     262              eph->type() == t_eph::QZSS)     && dt > 2*3600) {
     263      ephL->setCheckState(t_eph::bad);
     264      return;
     265    }
     266    else if  (eph->type() == t_eph::SBAS      && dt > 1*3600)   {
     267      ephL->setCheckState(t_eph::bad);
     268      return;
     269    }
     270    else if  (eph->type() == t_eph::BDS       && dt > 6*3600)   {
     271      ephL->setCheckState(t_eph::bad);
     272      return;
     273    }
     274
    211275    if (diff < MAXDIFF) {
    212       if(dt != 0.0) {
     276      if (dt != 0.0) {
    213277        eph->setCheckState(t_eph::ok);
    214278        ephL->setCheckState(t_eph::ok);
  • trunk/BNC/src/bncephuser.h

    r6598 r6981  
    3232#include "bncconst.h"
    3333#include "bnctime.h"
     34#include "bncutils.h"
    3435#include "ephemeris.h"
    3536
Note: See TracChangeset for help on using the changeset viewer.