- Timestamp:
- Aug 12, 2016, 5:25:52 PM (8 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bncgetthread.cpp
r7976 r8011 537 537 const t_satObs& obs = it.next(); 538 538 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 543 539 // Check observation epoch 544 540 // ----------------------- 545 541 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) ); 553 545 continue; 554 546 } … … 558 550 // ---------------------------------------------------- 559 551 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; 560 555 QMap<QString, long>::const_iterator it = _prnLastEpo.find(prn); 561 556 if (it != _prnLastEpo.end()) { -
trunk/BNC/src/bncutils.cpp
r7978 r8011 249 249 // 250 250 //////////////////////////////////////////////////////////////////////////// 251 bool 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 //////////////////////////////////////////////////////////////////////////// 251 267 QByteArray ggaString(const QByteArray& latitude, 252 268 const QByteArray& longitude, -
trunk/BNC/src/bncutils.h
r7251 r8011 50 50 * and must be handled separately. 51 51 * @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) 53 53 * @param mSecOfWeek milli seconds in GLONASS time 54 54 * @param fixnumleap when <code>true</code> then result is UTC time, otherwise it is GPS … … 63 63 QDateTime currentDateAndTimeGPS(); 64 64 65 bool checkForWrongObsEpoch(bncTime obsEpoch); 66 65 67 QByteArray ggaString(const QByteArray& latitude, const QByteArray& longitude, 66 68 const QByteArray& height, const QString& ggaType); … … 84 86 void jacobiEll_XYZ(const double* Ell, Matrix& jacobi); 85 87 86 void covariXYZ_NEU(const SymmetricMatrix& Qxyz, const double* Ell, 88 void covariXYZ_NEU(const SymmetricMatrix& Qxyz, const double* Ell, 87 89 SymmetricMatrix& Qneu); 88 90 89 void covariNEU_XYZ(const SymmetricMatrix& Qneu, const double* Ell, 91 void covariNEU_XYZ(const SymmetricMatrix& Qneu, const double* Ell, 90 92 SymmetricMatrix& Qxyz); 91 93 … … 96 98 double nint(double val); 97 99 98 ColumnVector rungeKutta4(double xi, const ColumnVector& yi, double dx, double* acc, 100 ColumnVector rungeKutta4(double xi, const ColumnVector& yi, double dx, double* acc, 99 101 ColumnVector (*der)(double x, const ColumnVector& y, double* acc)); 100 102 101 103 void GPSweekFromDateAndTime(const QDateTime& dateTime, int& GPSWeek, double& GPSWeeks); 102 104 103 void GPSweekFromYMDhms(int year, int month, int day, int hour, int min, double sec, 105 void GPSweekFromYMDhms(int year, int month, int day, int hour, int min, double sec, 104 106 int& GPSWeek, double& GPSWeeks); 105 107 … … 112 114 int readDbl(const QString& str, int pos, int len, double& value); 113 115 114 void topos(double xRec, double yRec, double zRec, double xSat, double ySat, double zSat, 116 void topos(double xRec, double yRec, double zRec, double xSat, double ySat, double zSat, 115 117 double& rho, double& eleSat, double& azSat); 116 118 … … 119 121 QString fortranFormat(double value, int width, int prec); 120 122 121 void kalman(const Matrix& AA, const ColumnVector& ll, const DiagonalMatrix& PP, 123 void kalman(const Matrix& AA, const ColumnVector& ll, const DiagonalMatrix& PP, 122 124 SymmetricMatrix& QQ, ColumnVector& xx); 123 125 -
trunk/BNC/src/latencychecker.cpp
r7422 r8011 35 35 * Created: 02-Feb-2009 36 36 * 37 * Changes: 37 * Changes: 38 38 * 39 39 * -----------------------------------------------------------------------*/ … … 60 60 _staID = staID; 61 61 62 connect(this, SIGNAL(newMessage(QByteArray,bool)), 62 connect(this, SIGNAL(newMessage(QByteArray,bool)), 63 63 BNC_CORE, SLOT(slotMessage(const QByteArray,bool))); 64 64 … … 69 69 QString adviseObsRate = settings.value("adviseObsRate").toString(); 70 70 _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; 88 88 } 89 89 _adviseFail = settings.value("adviseFail").toInt(); … … 96 96 _miscIntr = 1; 97 97 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; 124 124 } 125 125 … … 162 162 _begDateTimeCorr = QDateTime::currentDateTime(); 163 163 _endDateTimeCorr = QDateTime::currentDateTime(); 164 164 165 165 } 166 166 … … 180 180 if (!_fromReconnect) { 181 181 _endDateTimeOut = QDateTime::currentDateTime(); 182 } 182 } 183 183 _fromReconnect = true; 184 184 … … 277 277 _decodeStartCorr = QDateTime::currentDateTime(); 278 278 } 279 } 279 } 280 280 else { 281 281 … … 307 307 if (_fromReconnect) { 308 308 _begDateTimeOut = QDateTime::currentDateTime(); 309 } 309 } 310 310 _fromReconnect = false; 311 311 … … 336 336 while (it.hasNext()) { 337 337 const t_satObs& obs = it.next(); 338 338 bool wrongObservationEpoch = checkForWrongObsEpoch(obs._time); 339 339 _newSecGPS = static_cast<int>(obs._time.gpssec()); 340 if (_newSecGPS != _oldSecGPS ) {340 if (_newSecGPS != _oldSecGPS && !wrongObservationEpoch) { 341 341 if (_newSecGPS % _miscIntr < _oldSecGPS % _miscIntr) { 342 342 if (_numLat > 0) { … … 454 454 emit(newMessage(QString(_staID + late ).toAscii(), true) ); 455 455 } 456 } 456 } 457 457 else { 458 458 late = QString(": Mean latency %1 sec, min %2, max %3, rms %4, %5 epochs") … … 500 500 } 501 501 502 // Call advisory notice script 502 // Call advisory notice script 503 503 //////////////////////////////////////////////////////////////////////////// 504 504 void latencyChecker::callScript(const char* comment) {
Note:
See TracChangeset
for help on using the changeset viewer.