Changeset 4584 in ntrip for trunk/BNC/src/rinex
- Timestamp:
- Aug 29, 2012, 6:02:19 PM (12 years ago)
- Location:
- trunk/BNC/src/rinex
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/rinex/availplot.cpp
r4582 r4584 7 7 8 8 #include "availplot.h" 9 #include "reqcanalyze.h" 9 10 10 11 t_availPlot::t_availPlot(QWidget* parent, 11 QMap<QString, QVector<int> >* prnAvail)12 QMap<QString, t_availData>* availDataMap) 12 13 : QwtPlot(parent) { 13 14 setTitle("Availability Plot");15 14 16 15 setCanvasBackground(QColor(Qt::white)); … … 37 36 // ------ 38 37 int iC = 0; 39 QMapIterator<QString, QVector<int> > it(*prnAvail);38 QMapIterator<QString, t_availData > it(*availDataMap); 40 39 while (it.hasNext()) { 41 40 it.next(); 42 41 ++iC; 43 const QString& prn = it.key(); 44 const QVector<int>& epochs = it.value(); 42 const QString& prn = it.key(); 43 const t_availData& availData = it.value(); 44 const QVector<double>& epochs = availData._epoL1; 45 45 46 46 double xData[epochs.size()]; -
trunk/BNC/src/rinex/availplot.h
r4578 r4584 5 5 #include <qwt_plot.h> 6 6 7 class t_availData; 8 7 9 class t_availPlot: public QwtPlot { 8 10 Q_OBJECT 9 11 10 12 public: 11 t_availPlot(QWidget* parent, QMap<QString, QVector<int> >* prnAvail);13 t_availPlot(QWidget* parent, QMap<QString, t_availData>* availDataMap); 12 14 13 15 private: -
trunk/BNC/src/rinex/reqcanalyze.cpp
r4579 r4584 84 84 const QByteArray&, double))); 85 85 86 connect(this, SIGNAL(dspAvailPlot(const QString&, 87 const QByteArray&, 88 QMap<QString, QVector<int> >*)), 89 this, SLOT(slotDspAvailPlot(const QString&, 90 const QByteArray&, 91 QMap<QString, QVector<int> >*))); 92 86 connect(this, SIGNAL(dspAvailPlot(const QString&, const QByteArray&)), 87 this, SLOT(slotDspAvailPlot(const QString&, const QByteArray&))); 93 88 } 94 89 … … 214 209 } 215 210 216 _satStat.clear(); 211 _allObsMap.clear(); 212 _availDataMap.clear(); 217 213 218 214 // A priori Coordinates … … 239 235 .arg(obs.satNum, 2, 10, QChar('0')); 240 236 241 t_satStat& satStat = _satStat[prn]; 242 243 satStat.addObs(obs); 237 _allObsMap[prn].addObs(obs); 244 238 } 245 239 … … 262 256 QVector<t_polarPoint*>* dataSNR1 = new QVector<t_polarPoint*>; 263 257 QVector<t_polarPoint*>* dataSNR2 = new QVector<t_polarPoint*>; 264 QMap<QString, QVector<int> >* availL1 = new QMap<QString, QVector<int> >; 265 266 267 QMapIterator<QString, t_satStat> it(_satStat); 258 259 QMutableMapIterator<QString, t_allObs> it(_allObsMap); 268 260 while (it.hasNext()) { 269 261 it.next(); 270 QString prn = it.key(); 271 const t_satStat& satStat = it.value(); 272 QVector<int>& dataL1 = (*availL1)[prn]; 273 preparePlotData(prn, satStat, xyz, obsFile->interval(), 274 dataMP1, dataMP2, dataSNR1, dataSNR2, dataL1); 262 QString prn = it.key(); 263 preparePlotData(prn, xyz, obsFile->interval(), 264 dataMP1, dataMP2, dataSNR1, dataSNR2); 275 265 } 276 266 … … 281 271 "", 9.0); 282 272 283 emit dspAvailPlot(obsFile->fileName(), "Availability L1" , availL1);273 emit dspAvailPlot(obsFile->fileName(), "Availability L1"); 284 274 285 275 if (_log) { … … 290 280 // 291 281 //////////////////////////////////////////////////////////////////////////// 292 void t_reqcAnalyze::t_ satStat::addObs(const t_obs& obs) {293 294 t_ anaObs* newObs = new t_anaObs(obs.GPSWeek, obs.GPSWeeks);282 void t_reqcAnalyze::t_allObs::addObs(const t_obs& obs) { 283 284 t_oneObs* newObs = new t_oneObs(obs.GPSWeek, obs.GPSWeeks); 295 285 bool okFlag = false; 296 286 … … 364 354 // ------------------------ 365 355 if (okFlag) { 366 anaObs<< newObs;356 _oneObsVec << newObs; 367 357 } 368 358 else { … … 373 363 // 374 364 //////////////////////////////////////////////////////////////////////////// 375 void t_reqcAnalyze::preparePlotData(const QString& prn, 376 const t_satStat& satStat, 377 const ColumnVector& xyz, 365 void t_reqcAnalyze::preparePlotData(const QString& prn, const ColumnVector& xyz, 378 366 double obsInterval, 379 367 QVector<t_polarPoint*>* dataMP1, 380 368 QVector<t_polarPoint*>* dataMP2, 381 369 QVector<t_polarPoint*>* dataSNR1, 382 QVector<t_polarPoint*>* dataSNR2, 383 QVector<int>& dataL1) { 370 QVector<t_polarPoint*>* dataSNR2) { 384 371 385 372 const int chunkStep = int( 30.0 / obsInterval); // chunk step (30 sec) 386 373 const int numEpo = int(600.0 / obsInterval); // # epochs in one chunk (10 min) 387 374 388 for (int chunkStart = 0; chunkStart + numEpo < satStat.anaObs.size(); 375 t_allObs& allObs = _allObsMap[prn]; 376 377 for (int chunkStart = 0; chunkStart + numEpo < allObs._oneObsVec.size(); 389 378 chunkStart += chunkStep) { 390 379 … … 401 390 for (int ii = 0; ii < numEpo; ii++) { 402 391 int iEpo = chunkStart + ii; 403 const t_ anaObs* anaObs = satStat.anaObs[iEpo];392 const t_oneObs* oneObs = allObs._oneObsVec[iEpo]; 404 393 405 394 if (ii == 0) { 406 firstEpoch.set(anaObs->_GPSWeek, anaObs->_GPSWeeks); 407 } 408 409 mean1 += anaObs->_MP1; 410 mean2 += anaObs->_MP2; 411 412 if ( anaObs->_SNR1 > 0 && (SNR1 == 0 || SNR1 > anaObs->_SNR1) ) { 413 SNR1 = anaObs->_SNR1; 414 } 415 if ( anaObs->_SNR2 > 0 && (SNR2 == 0 || SNR2 > anaObs->_SNR2) ) { 416 SNR2 = anaObs->_SNR2; 395 bncTime epoTime(oneObs->_GPSWeek, oneObs->_GPSWeeks); 396 _availDataMap[prn]._epoL1 << epoTime.mjddec(); 397 } 398 399 mean1 += oneObs->_MP1; 400 mean2 += oneObs->_MP2; 401 402 if ( oneObs->_SNR1 > 0 && (SNR1 == 0 || SNR1 > oneObs->_SNR1) ) { 403 SNR1 = oneObs->_SNR1; 404 } 405 if ( oneObs->_SNR2 > 0 && (SNR2 == 0 || SNR2 > oneObs->_SNR2) ) { 406 SNR2 = oneObs->_SNR2; 417 407 } 418 408 … … 420 410 // ---------- 421 411 if (ii > 0) { 422 double diff1 = anaObs->_MP1 - satStat.anaObs[iEpo-1]->_MP1;423 double diff2 = anaObs->_MP2 - satStat.anaObs[iEpo-1]->_MP2;412 double diff1 = oneObs->_MP1 - allObs._oneObsVec[iEpo-1]->_MP1; 413 double diff2 = oneObs->_MP2 - allObs._oneObsVec[iEpo-1]->_MP2; 424 414 if (fabs(diff1) > SLIPTRESH || fabs(diff2) > SLIPTRESH) { 425 415 slipFlag = true; … … 428 418 } 429 419 } 430 431 dataL1 << int(firstEpoch.gpssec());432 420 433 421 if (slipFlag) { … … 444 432 for (int ii = 0; ii < numEpo; ii++) { 445 433 int iEpo = chunkStart + ii; 446 const t_ anaObs* anaObs = satStat.anaObs[iEpo];447 double diff1 = anaObs->_MP1 - mean1;448 double diff2 = anaObs->_MP2 - mean2;434 const t_oneObs* oneObs = allObs._oneObsVec[iEpo]; 435 double diff1 = oneObs->_MP1 - mean1; 436 double diff2 = oneObs->_MP2 - mean2; 449 437 stddev1 += diff1 * diff1; 450 438 stddev2 += diff2 * diff2; … … 453 441 double MP2 = sqrt(stddev2 / (numEpo-1)); 454 442 455 const t_ anaObs* anaObs0 = satStat.anaObs[chunkStart];443 const t_oneObs* oneObs0 = allObs._oneObsVec[chunkStart]; 456 444 457 445 // Compute the Azimuth and Zenith Distance … … 470 458 if (eph) { 471 459 double xSat, ySat, zSat, clkSat; 472 eph->position( anaObs0->_GPSWeek, anaObs0->_GPSWeeks,460 eph->position(oneObs0->_GPSWeek, oneObs0->_GPSWeeks, 473 461 xSat, ySat, zSat, clkSat); 474 462 … … 509 497 //////////////////////////////////////////////////////////////////////////// 510 498 void t_reqcAnalyze::slotDspAvailPlot(const QString& fileName, 511 const QByteArray& title, 512 QMap<QString, QVector<int> >* prnAvail){ 499 const QByteArray& title) { 513 500 514 501 if (dynamic_cast<bncApp*>(qApp)->GUIenabled()) { 515 502 516 t_availPlot* plot = new t_availPlot(0, prnAvail); 503 t_availPlot* plot = new t_availPlot(0, &_availDataMap); 504 plot->setTitle(title); 517 505 518 506 QVector<QWidget*> plots; -
trunk/BNC/src/rinex/reqcanalyze.h
r4572 r4584 34 34 class t_polarPoint; 35 35 36 class t_availData { 37 public: 38 QVector<double> _epoL1; 39 }; 40 36 41 class t_reqcAnalyze : public QThread { 37 42 Q_OBJECT … … 52 57 const QByteArray&, double); 53 58 54 void dspAvailPlot(const QString&, const QByteArray&, 55 QMap<QString, QVector<int> >*); 59 void dspAvailPlot(const QString&, const QByteArray&); 56 60 57 61 private slots: … … 63 67 const QByteArray& scaleTitle, double maxValue); 64 68 65 void slotDspAvailPlot(const QString& fileName, const QByteArray& title, 66 QMap<QString, QVector<int> >* prnAvail); 69 void slotDspAvailPlot(const QString& fileName, const QByteArray& title); 67 70 68 71 public: … … 70 73 71 74 private: 72 class t_ anaObs {75 class t_oneObs { 73 76 public: 74 t_ anaObs(int GPSWeek, double GPSWeeks) {77 t_oneObs(int GPSWeek, double GPSWeeks) { 75 78 _GPSWeek = GPSWeek; 76 79 _GPSWeeks = GPSWeeks; … … 92 95 }; 93 96 94 class t_ satStat{97 class t_allObs { 95 98 public: 96 t_ satStat() {}97 ~t_ satStat() {98 for (int ii = 0; ii < anaObs.size(); ii++) {99 delete anaObs[ii];99 t_allObs() {} 100 ~t_allObs() { 101 for (int ii = 0; ii < _oneObsVec.size(); ii++) { 102 delete _oneObsVec[ii]; 100 103 } 101 104 } 102 105 void addObs(const t_obs& obs); 103 QVector<t_ anaObs*> anaObs;106 QVector<t_oneObs*> _oneObsVec; 104 107 }; 105 108 106 109 void analyzeFile(t_rnxObsFile* obsFile); 107 void preparePlotData(const QString& prn, const t_satStat& satStat,108 const ColumnVector& xyz,double obsInterval,110 void preparePlotData(const QString& prn, const ColumnVector& xyz, 111 double obsInterval, 109 112 QVector<t_polarPoint*>* dataMP1, 110 113 QVector<t_polarPoint*>* dataMP2, 111 114 QVector<t_polarPoint*>* dataSNR1, 112 QVector<t_polarPoint*>* dataSNR2, 113 QVector<int>& dataL1); 115 QVector<t_polarPoint*>* dataSNR2); 114 116 115 QString _logFileName; 116 QFile* _logFile; 117 QTextStream* _log; 118 QStringList _obsFileNames; 119 QVector<t_rnxObsFile*> _rnxObsFiles; 120 QStringList _navFileNames; 121 QVector<t_eph*> _ephs; 122 QMap<QString, t_satStat> _satStat; 123 t_rnxObsFile::t_rnxEpo* _currEpo; 117 QString _logFileName; 118 QFile* _logFile; 119 QTextStream* _log; 120 QStringList _obsFileNames; 121 QVector<t_rnxObsFile*> _rnxObsFiles; 122 QStringList _navFileNames; 123 QVector<t_eph*> _ephs; 124 t_rnxObsFile::t_rnxEpo* _currEpo; 125 QMap<QString, t_allObs> _allObsMap; 126 QMap<QString, t_availData> _availDataMap; 124 127 }; 125 128
Note:
See TracChangeset
for help on using the changeset viewer.