Changeset 8557 in ntrip
- Timestamp:
- Dec 12, 2018, 3:16:09 PM (6 years ago)
- Location:
- trunk/BNC/src/rinex
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/rinex/reqcanalyze.cpp
r8556 r8557 49 49 #include "bncutils.h" 50 50 #include "graphwin.h" 51 #include "polarplot.h"52 51 #include "availplot.h" 53 52 #include "eleplot.h" … … 76 75 analyzePlotSignals(); 77 76 78 connect(this, SIGNAL(dspSkyPlot(const QString&, const QString&, QVector<t_polarPoint*>*, 79 const QString&, QVector<t_polarPoint*>*, 77 qRegisterMetaType< QVector<t_skyPlotData> >("QVector<t_skyPlotData>"); 78 79 connect(this, SIGNAL(dspSkyPlot(const QString&, QVector<t_skyPlotData>, 80 80 const QByteArray&, double)), 81 this, SLOT(slotDspSkyPlot(const QString&, const QString&, QVector<t_polarPoint*>*, 82 const QString&, QVector<t_polarPoint*>*, 81 this, SLOT(slotDspSkyPlot(const QString&, QVector<t_skyPlotData>, 83 82 const QByteArray&, double))); 84 83 … … 535 534 void t_reqcAnalyze::preparePlotData(const t_rnxObsFile* obsFile) { 536 535 537 QString mp1Title = "Multipath\n"; 538 QString mp2Title = "Multipath\n"; 539 QString sn1Title = "Signal-to-Noise Ratio\n"; 540 QString sn2Title = "Signal-to-Noise Ratio\n"; 541 542 for(QMap<char, QVector<char> >::iterator it = _signalTypes.begin(); 543 it != _signalTypes.end(); it++) { 544 mp1Title += QString(it.key()) + ":" + it.value()[0] + " "; 545 sn1Title += QString(it.key()) + ":" + it.value()[0] + " "; 546 mp2Title += QString(it.key()) + ":" + it.value()[1] + " "; 547 sn2Title += QString(it.key()) + ":" + it.value()[1] + " "; 548 } 549 550 QVector<t_polarPoint*>* dataMP1 = new QVector<t_polarPoint*>; 551 QVector<t_polarPoint*>* dataMP2 = new QVector<t_polarPoint*>; 552 QVector<t_polarPoint*>* dataSNR1 = new QVector<t_polarPoint*>; 553 QVector<t_polarPoint*>* dataSNR2 = new QVector<t_polarPoint*>; 554 555 // Loop over all observations 556 // -------------------------- 557 for (int iEpo = 0; iEpo < _qcFile._qcEpo.size(); iEpo++) { 558 t_qcEpo& qcEpo = _qcFile._qcEpo[iEpo]; 559 QMapIterator<t_prn, t_qcSat> it(qcEpo._qcSat); 560 while (it.hasNext()) { 561 it.next(); 562 const t_prn& prn = it.key(); 563 const t_qcSat& qcSat = it.value(); 564 if (qcSat._eleSet) { 565 566 QString frqType[2]; 567 568 for (int iFrq = 0; iFrq < qcSat._qcFrq.size(); iFrq++) { 569 const t_qcFrq& qcFrq = qcSat._qcFrq[iFrq]; 570 571 for (int ii = 0; ii < 2; ii++) { 572 if (frqType[ii].isEmpty()) { 573 QMapIterator<char, QVector<char> > it(_signalTypes); 574 while (it.hasNext()) { 575 it.next(); 576 if (it.key() == prn.system()) { 577 if (QString(it.value()[ii]) == qcFrq._rnxType2ch.left(1)) { 578 frqType[ii] = qcFrq._rnxType2ch; 579 break; 580 } 581 } 536 QVector<t_skyPlotData> skyPlotDataMP; 537 QVector<t_skyPlotData> skyPlotDataSN; 538 539 for(QMap<char, QVector<char> >::iterator it1 = _signalTypes.begin(); 540 it1 != _signalTypes.end(); it1++) { 541 542 for (int ii = 0; ii < it1.value().size(); ii++) { 543 544 skyPlotDataMP.append(t_skyPlotData()); t_skyPlotData& dataMP = skyPlotDataMP.last(); 545 skyPlotDataSN.append(t_skyPlotData()); t_skyPlotData& dataSN = skyPlotDataSN.last(); 546 547 dataMP._title = "Multipath\n" + QString(it1.key()) + ":" + it1.value()[ii] + " "; 548 dataSN._title = "Signal-to-Noise Ratio\n" + QString(it1.key()) + ":" + it1.value()[ii] + " "; 549 550 // Loop over all observations 551 // -------------------------- 552 for (int iEpo = 0; iEpo < _qcFile._qcEpo.size(); iEpo++) { 553 t_qcEpo& qcEpo = _qcFile._qcEpo[iEpo]; 554 QMapIterator<t_prn, t_qcSat> it2(qcEpo._qcSat); 555 while (it2.hasNext()) { 556 it2.next(); 557 const t_qcSat& qcSat = it2.value(); 558 if (qcSat._eleSet) { 559 for (int iFrq = 0; iFrq < qcSat._qcFrq.size(); iFrq++) { 560 const t_qcFrq& qcFrq = qcSat._qcFrq[iFrq]; 561 if (QString(it1.value()[ii]) == qcFrq._rnxType2ch.left(1)) { 562 dataMP._data << (new t_polarPoint(qcSat._azDeg, 90.0 - qcSat._eleDeg, qcFrq._stdMP)); 563 dataSN._data << (new t_polarPoint(qcSat._azDeg, 90.0 - qcSat._eleDeg, qcFrq._SNR)); 582 564 } 583 565 } 584 }585 if (qcFrq._rnxType2ch == frqType[0]) {586 (*dataSNR1) << (new t_polarPoint(qcSat._azDeg, 90.0 - qcSat._eleDeg, qcFrq._SNR));587 (*dataMP1) << (new t_polarPoint(qcSat._azDeg, 90.0 - qcSat._eleDeg, qcFrq._stdMP));588 }589 else if (qcFrq._rnxType2ch == frqType[1]) {590 (*dataSNR2) << (new t_polarPoint(qcSat._azDeg, 90.0 - qcSat._eleDeg, qcFrq._SNR));591 (*dataMP2) << (new t_polarPoint(qcSat._azDeg, 90.0 - qcSat._eleDeg, qcFrq._stdMP));592 566 } 593 567 } … … 601 575 QFileInfo fileInfo(obsFile->fileName()); 602 576 QByteArray title = fileInfo.fileName().toLatin1(); 603 emit dspSkyPlot(obsFile->fileName(), mp1Title, dataMP1, mp2Title, dataMP2,"Meters", 2.0);604 emit dspSkyPlot(obsFile->fileName(), s n1Title, dataSNR1, sn2Title, dataSNR2, "dbHz", 54.0);577 emit dspSkyPlot(obsFile->fileName(), skyPlotDataMP, "Meters", 2.0); 578 emit dspSkyPlot(obsFile->fileName(), skyPlotDataSN, "dbHz", 54.0); 605 579 emit dspAvailPlot(obsFile->fileName(), title); 606 580 } 607 else { 608 for (int ii = 0; ii < dataMP1->size(); ii++) { 609 delete dataMP1->at(ii); 610 } 611 delete dataMP1; 612 for (int ii = 0; ii < dataMP2->size(); ii++) { 613 delete dataMP2->at(ii); 614 } 615 delete dataMP2; 616 for (int ii = 0; ii < dataSNR1->size(); ii++) { 617 delete dataSNR1->at(ii); 618 } 619 delete dataSNR1; 620 for (int ii = 0; ii < dataSNR2->size(); ii++) { 621 delete dataSNR2->at(ii); 622 } 623 delete dataSNR2; 624 } 625 } 626 627 // 628 //////////////////////////////////////////////////////////////////////////// 629 void t_reqcAnalyze::slotDspSkyPlot(const QString& fileName, const QString& title1, 630 QVector<t_polarPoint*>* data1, const QString& title2, 631 QVector<t_polarPoint*>* data2, const QByteArray& scaleTitle, 632 double maxValue) { 581 } 582 583 // 584 //////////////////////////////////////////////////////////////////////////// 585 void t_reqcAnalyze::slotDspSkyPlot(const QString& fileName, 586 QVector<t_skyPlotData> skyPlotData, 587 const QByteArray& scaleTitle, double maxValue) { 633 588 634 589 if (BNC_CORE->GUIenabled()) { 635 590 636 591 if (maxValue == 0.0) { 637 if (data1) { 638 for (int ii = 0; ii < data1->size(); ii++) { 639 double val = data1->at(ii)->_value; 592 QVectorIterator<t_skyPlotData> it(skyPlotData); 593 while (it.hasNext()) { 594 const t_skyPlotData& plotData = it.next(); 595 const QVector<t_polarPoint*>& data = plotData._data; 596 for (int ii = 0; ii < data.size(); ii++) { 597 double val = data.at(ii)->_value; 640 598 if (maxValue < val) { 641 599 maxValue = val; … … 643 601 } 644 602 } 645 if (data2) {646 for (int ii = 0; ii < data2->size(); ii++) {647 double val = data2->at(ii)->_value;648 if (maxValue < val) {649 maxValue = val;650 }651 }652 }653 603 } 654 604 … … 656 606 657 607 QVector<QWidget*> plots; 658 if (data1) { 659 QwtText title(title1); 608 QMutableVectorIterator<t_skyPlotData> it(skyPlotData); 609 while (it.hasNext()) { 610 t_skyPlotData& plotData = it.next(); 611 QVector<t_polarPoint*>& data = plotData._data; 612 QwtText title(plotData._title); 660 613 QFont font = title.font(); font.setPointSize(font.pointSize()-1); title.setFont(font); 661 t_polarPlot* plot1 = new t_polarPlot(title, scaleInterval, BNC_CORE->mainWindow()); 662 plot1->addCurve(data1); 663 plots << plot1; 664 } 665 if (data2) { 666 QwtText title(title2); 667 QFont font = title.font(); font.setPointSize(font.pointSize()-1); title.setFont(font); 668 t_polarPlot* plot2 = new t_polarPlot(title, scaleInterval, BNC_CORE->mainWindow()); 669 plot2->addCurve(data2); 670 plots << plot2; 614 t_polarPlot* plot = new t_polarPlot(title, scaleInterval, BNC_CORE->mainWindow()); 615 plot->addCurve(&data); 616 plots << plot; 671 617 } 672 618 -
trunk/BNC/src/rinex/reqcanalyze.h
r8555 r8557 31 31 #include "ephemeris.h" 32 32 #include "satObs.h" 33 34 class t_polarPoint; 33 #include "polarplot.h" 35 34 36 35 class t_plotData { … … 58 57 ~t_reqcAnalyze(); 59 58 59 class t_skyPlotData { 60 public: 61 t_skyPlotData() {} 62 ~t_skyPlotData() {} 63 void clear() { 64 for (int ii = 0; ii < _data.size(); ii++) { 65 delete _data.at(ii); 66 } 67 } 68 QString _title; 69 QVector<t_polarPoint*> _data; 70 }; 71 60 72 signals: 61 73 void finished(); 62 void dspSkyPlot(const QString&, const QString&, QVector<t_polarPoint*>*,63 const Q String&, QVector<t_polarPoint*>*, const QByteArray&, double);74 void dspSkyPlot(const QString&, QVector<t_skyPlotData> skyPlotData, 75 const QByteArray&, double); 64 76 void dspAvailPlot(const QString&, const QByteArray&); 65 77 … … 158 170 159 171 private slots: 160 void slotDspSkyPlot(const QString& fileName, const QString& title1, 161 QVector<t_polarPoint*>* data1, const QString& title2, 162 QVector<t_polarPoint*>* data2, const QByteArray& scaleTitle, double maxValue); 172 void slotDspSkyPlot(const QString& fileName, QVector<t_skyPlotData> skyPlotData, 173 const QByteArray& scaleTitle, double maxValue); 163 174 164 175 void slotDspAvailPlot(const QString& fileName, const QByteArray& title);
Note:
See TracChangeset
for help on using the changeset viewer.