Changeset 8370 in ntrip


Ignore:
Timestamp:
Jun 11, 2018, 11:39:18 AM (6 years ago)
Author:
stuerze
Message:

small bug fixes in 'reqc' ephemeris check

Location:
branches/BNC_2.12/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/BNC_2.12/src/PPP_SSR_I/pppClient.cpp

    r7968 r8370  
    353353//////////////////////////////////////////////////////////////////////////////
    354354void t_pppClient::putEphemeris(const t_eph* eph) {
    355   bool check = _opt->_realTime;
    356355  if (_newEph)
    357356    delete _newEph;
     
    375374
    376375  if (_newEph) {
    377     _ephUser->putNewEph(_newEph, check);
     376    _ephUser->putNewEph(_newEph, _opt->_realTime);
    378377  }
    379378}
  • branches/BNC_2.12/src/bncephuser.cpp

    r8322 r8370  
    8383////////////////////////////////////////////////////////////////////////////
    8484void bncEphUser::slotNewGPSEph(t_ephGPS eph) {
    85   putNewEph(&eph, false);
     85  putNewEph(&eph, true);
    8686}
    8787
     
    8989////////////////////////////////////////////////////////////////////////////
    9090void bncEphUser::slotNewGlonassEph(t_ephGlo eph) {
    91   putNewEph(&eph, false);
     91  putNewEph(&eph, true);
    9292}
    9393
     
    9595////////////////////////////////////////////////////////////////////////////
    9696void bncEphUser::slotNewGalileoEph(t_ephGal eph) {
    97   putNewEph(&eph, false);
     97  putNewEph(&eph, true);
    9898}
    9999
     
    101101////////////////////////////////////////////////////////////////////////////
    102102void bncEphUser::slotNewSBASEph(t_ephSBAS eph) {
    103   putNewEph(&eph, false);
     103  putNewEph(&eph, true);
    104104}
    105105
     
    107107////////////////////////////////////////////////////////////////////////////
    108108void bncEphUser::slotNewBDSEph(t_ephBDS eph) {
    109   putNewEph(&eph, false);
    110 }
    111 
    112 //
    113 ////////////////////////////////////////////////////////////////////////////
    114 t_irc bncEphUser::putNewEph(t_eph* eph, bool check) {
     109  putNewEph(&eph, true);
     110}
     111
     112//
     113////////////////////////////////////////////////////////////////////////////
     114t_irc bncEphUser::putNewEph(t_eph* eph, bool realTime) {
    115115
    116116  QMutexLocker locker(&_mutex);
     
    120120  }
    121121
    122   if (check) {
    123     checkEphemeris(eph);
    124   }
     122  checkEphemeris(eph, realTime);
     123
    125124
    126125  const t_ephGPS*     ephGPS     = dynamic_cast<const t_ephGPS*>(eph);
     
    175174//
    176175////////////////////////////////////////////////////////////////////////////
    177 void bncEphUser::checkEphemeris(t_eph* eph) {
     176void bncEphUser::checkEphemeris(t_eph* eph, bool realTime) {
    178177
    179178  if (!eph || eph->checkState() == t_eph::ok || eph->checkState() == t_eph::bad) {
     
    207206  // Check whether the epoch is too far away the current time
    208207  // --------------------------------------------------------
    209   bncTime   toc = eph->TOC();
    210   QDateTime now = currentDateAndTimeGPS();
    211   bncTime currentTime(now.toString(Qt::ISODate).toStdString());
    212   double timeDiff = fabs(toc - currentTime);
    213 
    214   if      (eph->type() == t_eph::GPS     && timeDiff > 4*3600) { // update interval: 2h, data sets are valid for 4 hours
    215     eph->setCheckState(t_eph::outdated);
    216     return;
    217   }
    218   else if (eph->type() == t_eph::Galileo && timeDiff > 4*3600) { // update interval: 2h, data sets are valid for 4 hours
    219     eph->setCheckState(t_eph::outdated);
    220     return;
    221   }
    222   else if (eph->type() == t_eph::GLONASS && timeDiff > 1*3600) { // updated every 30 minutes
    223     eph->setCheckState(t_eph::outdated);
    224     return;
    225   }
    226   else if (eph->type() == t_eph::QZSS    && timeDiff > 4*3600) { // orbit parameters are valid for 7200 seconds (at minimum)
    227     eph->setCheckState(t_eph::outdated);
    228     return;
    229   }
    230   else if (eph->type() == t_eph::SBAS    && timeDiff > 600) { // maximum update interval: 300 sec
    231     eph->setCheckState(t_eph::outdated);
    232     return;
    233   }
    234   else if (eph->type() == t_eph::BDS     && timeDiff > 6*3600) { // updates (GEO) up to 6 hours
    235     eph->setCheckState(t_eph::outdated);
    236     return;
    237   }
    238   else if (eph->type() == t_eph::IRNSS   && timeDiff > 24*3600) { // update interval: up to 24 hours
    239     eph->setCheckState(t_eph::outdated);
    240     return;
    241   }
    242 
     208  if (realTime) {
     209    bncTime   toc = eph->TOC();
     210    QDateTime now = currentDateAndTimeGPS();
     211    bncTime currentTime(now.toString(Qt::ISODate).toStdString());
     212    double timeDiff = fabs(toc - currentTime);
     213
     214    if      (eph->type() == t_eph::GPS     && timeDiff > 4*3600) { // update interval: 2h, data sets are valid for 4 hours
     215      eph->setCheckState(t_eph::outdated);
     216      return;
     217    }
     218    else if (eph->type() == t_eph::Galileo && timeDiff > 4*3600) { // update interval: 2h, data sets are valid for 4 hours
     219      eph->setCheckState(t_eph::outdated);
     220      return;
     221    }
     222    else if (eph->type() == t_eph::GLONASS && timeDiff > 1*3600) { // updated every 30 minutes
     223      eph->setCheckState(t_eph::outdated);
     224      return;
     225    }
     226    else if (eph->type() == t_eph::QZSS    && timeDiff > 4*3600) { // orbit parameters are valid for 7200 seconds (at minimum)
     227      eph->setCheckState(t_eph::outdated);
     228      return;
     229    }
     230    else if (eph->type() == t_eph::SBAS    && timeDiff > 600) { // maximum update interval: 300 sec
     231      eph->setCheckState(t_eph::outdated);
     232      return;
     233    }
     234    else if (eph->type() == t_eph::BDS     && timeDiff > 6*3600) { // updates (GEO) up to 6 hours
     235      eph->setCheckState(t_eph::outdated);
     236      return;
     237    }
     238    else if (eph->type() == t_eph::IRNSS   && timeDiff > 24*3600) { // update interval: up to 24 hours
     239      eph->setCheckState(t_eph::outdated);
     240      return;
     241    }
     242  }
     243 
    243244  // Check consistency with older ephemerides
    244245  // ----------------------------------------
  • branches/BNC_2.12/src/bncephuser.h

    r6981 r8370  
    7474
    7575 private:
    76   void checkEphemeris(t_eph* eph);
     76  void checkEphemeris(t_eph* eph, bool realTime);
    7777  QMutex                             _mutex;
    7878  static const unsigned              _maxQueueSize = 5;
  • branches/BNC_2.12/src/ephemeris.cpp

    r8218 r8370  
    335335  double E  = M;
    336336  double E_last;
     337  int    nLoop = 0;
    337338  do {
    338339    E_last = E;
    339340    E = M + _e*sin(E);
     341   
     342    if (++nLoop == 100) {
     343      return failure;
     344    }
    340345  } while ( fabs(E-E_last)*a0 > 0.001 );
    341346  double v      = 2.0*atan( sqrt( (1.0 + _e)/(1.0 - _e) )*tan( E/2 ) );
     
    921926  double E  = M;
    922927  double E_last;
     928  int    nLoop = 0;
    923929  do {
    924930    E_last = E;
    925931    E = M + _e*sin(E);
     932
     933    if (++nLoop == 100) {
     934      return failure;
     935    }
    926936  } while ( fabs(E-E_last)*a0 > 0.001 );
    927937  double v      = 2.0*atan( sqrt( (1.0 + _e)/(1.0 - _e) )*tan( E/2 ) );
  • branches/BNC_2.12/src/rinex/reqcanalyze.cpp

    r8149 r8370  
    10541054    for (unsigned ii = 0; ii < rnxNavFile.ephs().size(); ii++) {
    10551055      t_eph* eph = rnxNavFile.ephs()[ii];
    1056       ephUser.putNewEph(eph, true);
     1056      ephUser.putNewEph(eph, false);
    10571057      if (eph->checkState() == t_eph::bad) {
    10581058        ++numBad;
  • branches/BNC_2.12/src/rinex/reqcedit.cpp

    r8351 r8370  
    642642      break;
    643643    }
     644    if (eph->checkState() != t_eph::bad) {
     645      continue;
     646    }   
    644647    outNavFile.writeEph(eph);
    645648  }
  • branches/BNC_2.12/src/rinex/rnxnavfile.cpp

    r8353 r8370  
    210210      eph = new t_ephGPS(version(), lines);
    211211    }
    212     if (eph &&
    213         eph->checkState() != t_eph::bad &&
    214         eph->checkState() != t_eph::outdated) {
    215       _ephs.push_back(eph);
    216     }
    217     else {
    218       delete eph;
    219     }
     212    _ephs.push_back(eph);
    220213  }
    221214}
Note: See TracChangeset for help on using the changeset viewer.