Changeset 8011 in ntrip


Ignore:
Timestamp:
Aug 12, 2016, 5:25:52 PM (8 years ago)
Author:
stuerze
Message:

check regarding wrong observation epochs is done in latencychecker as well to prevent erroneous latencies

Location:
trunk/BNC/src
Files:
4 edited

Legend:

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

    r7976 r8011  
    537537        const t_satObs& obs = it.next();
    538538
    539         QString prn(obs._prn.toString().c_str());
    540         long iSec    = long(floor(obs._time.gpssec()+0.5));
    541         long obsTime = obs._time.gpsw()*7*24*3600 + iSec;
    542 
    543539        // Check observation epoch
    544540        // -----------------------
    545541        if (!_rawFile) {
    546           int    week;
    547           double sec;
    548           currentGPSWeeks(week, sec);
    549           long currTime = week * 7*24*3600 + long(sec);
    550           const double maxDt = 600.0;
    551           if (fabs(currTime - obsTime) > maxDt) {
    552               emit( newMessage(_staID + ": Wrong observation epoch(s)", false) );
     542          bool wrongObservationEpoch = checkForWrongObsEpoch(obs._time);
     543          if (wrongObservationEpoch) {
     544            emit( newMessage(_staID + ": Wrong observation epoch(s)", false) );
    553545            continue;
    554546          }
     
    558550        // ----------------------------------------------------
    559551        if (!_rawFile) {
     552          QString prn(obs._prn.toString().c_str());
     553          long iSec    = long(floor(obs._time.gpssec()+0.5));
     554          long obsTime = obs._time.gpsw()*7*24*3600 + iSec;
    560555          QMap<QString, long>::const_iterator it = _prnLastEpo.find(prn);
    561556          if (it != _prnLastEpo.end()) {
  • trunk/BNC/src/bncutils.cpp

    r7978 r8011  
    249249//
    250250////////////////////////////////////////////////////////////////////////////
     251bool checkForWrongObsEpoch(bncTime obsEpoch) {
     252  const double maxDt = 600.0;
     253  long iSec    = long(floor(obsEpoch.gpssec()+0.5));
     254  long obsTime = obsEpoch.gpsw()*7*24*3600 + iSec;
     255  int    week;
     256  double sec;
     257  currentGPSWeeks(week, sec);
     258  long currTime = week * 7*24*3600 + long(sec);
     259
     260  if (fabs(currTime - obsTime) > maxDt) {
     261    return true;
     262  }
     263  return false;
     264}
     265//
     266////////////////////////////////////////////////////////////////////////////
    251267QByteArray ggaString(const QByteArray& latitude,
    252268                     const QByteArray& longitude,
  • trunk/BNC/src/bncutils.h

    r7251 r8011  
    5050 * and must be handled separately.
    5151 * @param week GPS week number (must be prefilled, contains fixed value afterwards)
    52  * @param secOfWeek seconds in GPS week (must be prefilled, contains fixed value afterwards) 
     52 * @param secOfWeek seconds in GPS week (must be prefilled, contains fixed value afterwards)
    5353 * @param mSecOfWeek milli seconds in GLONASS time
    5454 * @param fixnumleap when <code>true</code> then result is UTC time, otherwise it is GPS
     
    6363QDateTime    currentDateAndTimeGPS();
    6464
     65bool         checkForWrongObsEpoch(bncTime obsEpoch);
     66
    6567QByteArray   ggaString(const QByteArray& latitude, const QByteArray& longitude,
    6668                       const QByteArray& height, const QString& ggaType);
     
    8486void         jacobiEll_XYZ(const double* Ell, Matrix& jacobi);
    8587
    86 void         covariXYZ_NEU(const SymmetricMatrix& Qxyz, const double* Ell, 
     88void         covariXYZ_NEU(const SymmetricMatrix& Qxyz, const double* Ell,
    8789                           SymmetricMatrix& Qneu);
    8890
    89 void         covariNEU_XYZ(const SymmetricMatrix& Qneu, const double* Ell, 
     91void         covariNEU_XYZ(const SymmetricMatrix& Qneu, const double* Ell,
    9092                           SymmetricMatrix& Qxyz);
    9193
     
    9698double       nint(double val);
    9799
    98 ColumnVector rungeKutta4(double xi, const ColumnVector& yi, double dx, double* acc, 
     100ColumnVector rungeKutta4(double xi, const ColumnVector& yi, double dx, double* acc,
    99101                         ColumnVector (*der)(double x, const ColumnVector& y, double* acc));
    100102
    101103void         GPSweekFromDateAndTime(const QDateTime& dateTime, int& GPSWeek, double& GPSWeeks);
    102104
    103 void         GPSweekFromYMDhms(int year, int month, int day, int hour, int min, double sec, 
     105void         GPSweekFromYMDhms(int year, int month, int day, int hour, int min, double sec,
    104106                               int& GPSWeek, double& GPSWeeks);
    105107
     
    112114int          readDbl(const QString& str, int pos, int len, double& value);
    113115
    114 void         topos(double xRec, double yRec, double zRec, double xSat, double ySat, double zSat, 
     116void         topos(double xRec, double yRec, double zRec, double xSat, double ySat, double zSat,
    115117                   double& rho, double& eleSat, double& azSat);
    116118
     
    119121QString      fortranFormat(double value, int width, int prec);
    120122
    121 void         kalman(const Matrix& AA, const ColumnVector& ll, const DiagonalMatrix& PP, 
     123void         kalman(const Matrix& AA, const ColumnVector& ll, const DiagonalMatrix& PP,
    122124                    SymmetricMatrix& QQ, ColumnVector& xx);
    123125
  • trunk/BNC/src/latencychecker.cpp

    r7422 r8011  
    3535 * Created:    02-Feb-2009
    3636 *
    37  * Changes:   
     37 * Changes:
    3838 *
    3939 * -----------------------------------------------------------------------*/
     
    6060  _staID = staID;
    6161
    62   connect(this, SIGNAL(newMessage(QByteArray,bool)), 
     62  connect(this, SIGNAL(newMessage(QByteArray,bool)),
    6363          BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
    6464
     
    6969  QString adviseObsRate = settings.value("adviseObsRate").toString();
    7070  _inspSegm = 0;
    71   if      ( adviseObsRate.isEmpty() ) { 
    72     _inspSegm = 0; 
    73   }
    74   else if ( adviseObsRate.indexOf("5 Hz")   != -1 ) { 
    75     _inspSegm = 20; 
    76   }
    77   else if ( adviseObsRate.indexOf("1 Hz")   != -1 ) { 
    78     _inspSegm = 10; 
    79   }
    80   else if ( adviseObsRate.indexOf("0.5 Hz") != -1 ) { 
    81     _inspSegm = 20; 
    82   }
    83   else if ( adviseObsRate.indexOf("0.2 Hz") != -1 ) { 
    84     _inspSegm = 40; 
    85   }
    86   else if ( adviseObsRate.indexOf("0.1 Hz") != -1 ) { 
    87     _inspSegm = 50; 
     71  if      ( adviseObsRate.isEmpty() ) {
     72    _inspSegm = 0;
     73  }
     74  else if ( adviseObsRate.indexOf("5 Hz")   != -1 ) {
     75    _inspSegm = 20;
     76  }
     77  else if ( adviseObsRate.indexOf("1 Hz")   != -1 ) {
     78    _inspSegm = 10;
     79  }
     80  else if ( adviseObsRate.indexOf("0.5 Hz") != -1 ) {
     81    _inspSegm = 20;
     82  }
     83  else if ( adviseObsRate.indexOf("0.2 Hz") != -1 ) {
     84    _inspSegm = 40;
     85  }
     86  else if ( adviseObsRate.indexOf("0.1 Hz") != -1 ) {
     87    _inspSegm = 50;
    8888  }
    8989  _adviseFail = settings.value("adviseFail").toInt();
     
    9696  _miscIntr = 1;
    9797  QString miscIntr = settings.value("miscIntr").toString();
    98   if      ( miscIntr.isEmpty() ) { 
    99     _miscIntr = 1; 
    100   }
    101   else if ( miscIntr.indexOf("2 sec")   != -1 ) { 
    102     _miscIntr = 2; 
    103   }
    104   else if ( miscIntr.indexOf("10 sec")  != -1 ) { 
    105     _miscIntr = 10; 
    106   }
    107   else if ( miscIntr.indexOf("1 min")   != -1 ) { 
    108     _miscIntr = 60; 
    109   }
    110   else if ( miscIntr.left(5).indexOf("5 min")   != -1 ) { 
    111     _miscIntr = 300; 
    112   }
    113   else if ( miscIntr.indexOf("15 min")  != -1 ) { 
    114     _miscIntr = 900; 
    115   }
    116   else if ( miscIntr.indexOf("1 hour")  != -1 ) { 
    117     _miscIntr = 3600; 
    118   }
    119   else if ( miscIntr.indexOf("6 hours") != -1 ) { 
    120     _miscIntr = 21600; 
    121   }
    122   else if ( miscIntr.indexOf("1 day")   != -1 ) { 
    123     _miscIntr = 86400; 
     98  if      ( miscIntr.isEmpty() ) {
     99    _miscIntr = 1;
     100  }
     101  else if ( miscIntr.indexOf("2 sec")   != -1 ) {
     102    _miscIntr = 2;
     103  }
     104  else if ( miscIntr.indexOf("10 sec")  != -1 ) {
     105    _miscIntr = 10;
     106  }
     107  else if ( miscIntr.indexOf("1 min")   != -1 ) {
     108    _miscIntr = 60;
     109  }
     110  else if ( miscIntr.left(5).indexOf("5 min")   != -1 ) {
     111    _miscIntr = 300;
     112  }
     113  else if ( miscIntr.indexOf("15 min")  != -1 ) {
     114    _miscIntr = 900;
     115  }
     116  else if ( miscIntr.indexOf("1 hour")  != -1 ) {
     117    _miscIntr = 3600;
     118  }
     119  else if ( miscIntr.indexOf("6 hours") != -1 ) {
     120    _miscIntr = 21600;
     121  }
     122  else if ( miscIntr.indexOf("1 day")   != -1 ) {
     123    _miscIntr = 86400;
    124124  }
    125125
     
    162162  _begDateTimeCorr = QDateTime::currentDateTime();
    163163  _endDateTimeCorr = QDateTime::currentDateTime();
    164  
     164
    165165}
    166166
     
    180180  if (!_fromReconnect) {
    181181    _endDateTimeOut = QDateTime::currentDateTime();
    182   } 
     182  }
    183183  _fromReconnect = true;
    184184
     
    277277          _decodeStartCorr = QDateTime::currentDateTime();
    278278        }
    279       } 
     279      }
    280280      else {
    281281
     
    307307  if (_fromReconnect) {
    308308    _begDateTimeOut = QDateTime::currentDateTime();
    309   } 
     309  }
    310310  _fromReconnect = false;
    311311
     
    336336    while (it.hasNext()) {
    337337      const t_satObs& obs = it.next();
    338      
     338      bool wrongObservationEpoch = checkForWrongObsEpoch(obs._time);
    339339      _newSecGPS = static_cast<int>(obs._time.gpssec());
    340       if (_newSecGPS != _oldSecGPS) {
     340      if (_newSecGPS != _oldSecGPS && !wrongObservationEpoch) {
    341341        if (_newSecGPS % _miscIntr < _oldSecGPS % _miscIntr) {
    342342          if (_numLat > 0) {
     
    454454              emit(newMessage(QString(_staID + late ).toAscii(), true) );
    455455            }
    456           } 
     456          }
    457457          else {
    458458            late = QString(": Mean latency %1 sec, min %2, max %3, rms %4, %5 epochs")
     
    500500}
    501501
    502 // Call advisory notice script   
     502// Call advisory notice script
    503503////////////////////////////////////////////////////////////////////////////
    504504void latencyChecker::callScript(const char* comment) {
Note: See TracChangeset for help on using the changeset viewer.