- Timestamp:
- Dec 12, 2018, 12:02:14 PM (6 years ago)
- Location:
- trunk/BNC/src/rinex
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/rinex/availplot.cpp
r8127 r8555 124 124 scaleDrawPrn->_yLabels[iC] = prn; 125 125 126 double eps = 0. 1;126 double eps = 0.0; 127 127 128 // L1 ok Curve 129 // ----------- 130 if (plotData._L1ok.size()) { 131 const QVector<double>& xData = plotData._L1ok; 132 QVector<double> yData(xData.size(), double(iC)+eps); 133 QwtPlotCurve* curve = addCurve(prn, symbGreen, xData, yData); 134 curve->setItemAttribute(QwtPlotItem::Legend, false); 135 } 128 for (QMap<char, t_plotData::t_hlpStatus >::const_iterator it = plotData._status.begin(); 129 it != plotData._status.end(); it++) { 136 130 137 // L2 ok Curve 138 // ----------- 139 if (plotData._L2ok.size()) { 140 const QVector<double>& xData = plotData._L2ok; 141 QVector<double> yData(xData.size(), double(iC)-eps); 142 QwtPlotCurve* curve = addCurve(prn, symbGreen, xData, yData); 143 curve->setItemAttribute(QwtPlotItem::Legend, false); 144 } 131 const t_plotData::t_hlpStatus& status = it.value(); 145 132 146 // L1 gaps Curve 147 // ------------- 148 if (plotData._L1gap.size()) { 149 const QVector<double>& xData = plotData._L1gap; 150 QVector<double> yData(xData.size(), double(iC)+eps); 151 QwtPlotCurve* curve = addCurve(prn, symbBlue, xData, yData); 152 curve->setItemAttribute(QwtPlotItem::Legend, false); 153 } 133 // OK Curve 134 // -------- 135 if (status._ok.size()) { 136 const QVector<double>& xData = status._ok; 137 QVector<double> yData(xData.size(), double(iC)+eps); 138 QwtPlotCurve* curve = addCurve(prn, symbGreen, xData, yData); 139 curve->setItemAttribute(QwtPlotItem::Legend, false); 140 } 141 142 // Gaps Curve 143 // ---------- 144 if (status._gap.size()) { 145 const QVector<double>& xData = status._gap; 146 QVector<double> yData(xData.size(), double(iC)+eps); 147 QwtPlotCurve* curve = addCurve(prn, symbBlue, xData, yData); 148 curve->setItemAttribute(QwtPlotItem::Legend, false); 149 } 150 151 // Slips Curve 152 // ----------- 153 if (status._slip.size()) { 154 const QVector<double>& xData = status._slip; 155 QVector<double> yData(xData.size(), double(iC)+eps); 156 QwtPlotCurve* curve = addCurve(prn, symbRed, xData, yData); 157 curve->setItemAttribute(QwtPlotItem::Legend, false); 158 } 154 159 155 // L2 gaps Curve 156 // ------------- 157 if (plotData._L2gap.size()) { 158 const QVector<double>& xData = plotData._L2gap; 159 QVector<double> yData(xData.size(), double(iC)-eps); 160 QwtPlotCurve* curve = addCurve(prn, symbBlue, xData, yData); 161 curve->setItemAttribute(QwtPlotItem::Legend, false); 162 } 163 164 // L1 slips Curve 165 // -------------- 166 if (plotData._L1slip.size()) { 167 const QVector<double>& xData = plotData._L1slip; 168 QVector<double> yData(xData.size(), double(iC)+eps); 169 QwtPlotCurve* curve = addCurve(prn, symbRed, xData, yData); 170 curve->setItemAttribute(QwtPlotItem::Legend, false); 171 } 172 173 // L2 slips Curve 174 // -------------- 175 if (plotData._L2slip.size()) { 176 const QVector<double>& xData = plotData._L2slip; 177 QVector<double> yData(xData.size(), double(iC)-eps); 178 QwtPlotCurve* curve = addCurve(prn, symbRed, xData, yData); 179 curve->setItemAttribute(QwtPlotItem::Legend, false); 160 eps += 0.1; 180 161 } 181 162 } -
trunk/BNC/src/rinex/reqcanalyze.cpp
r8542 r8555 74 74 _reqcPlotSignals = _defaultSignalTypes.join(" "); 75 75 } 76 analyzePlotSignals( _signalTypes);76 analyzePlotSignals(); 77 77 78 78 connect(this, SIGNAL(dspSkyPlot(const QString&, const QString&, QVector<t_polarPoint*>*, … … 150 150 // 151 151 //////////////////////////////////////////////////////////////////////////// 152 void t_reqcAnalyze::analyzePlotSignals( QMap<char, QVector<QString> >& signalTypes) {152 void t_reqcAnalyze::analyzePlotSignals() { 153 153 154 154 QStringList signalsOpt = _reqcPlotSignals.split(" ", QString::SkipEmptyParts); … … 157 157 QStringList input = signalsOpt.at(ii).split(QRegExp("[:&]"), QString::SkipEmptyParts); 158 158 if (input.size() > 1 && input[0].length() == 1) { 159 char system = input[0].toLatin1().constData()[0]; 160 QStringList sysValid = _defaultSignalTypes.filter(QString(system)); 161 QStringList defaultSignals = sysValid.at(0).split(QRegExp("[:&]")); 162 if (sysValid.isEmpty()) {continue;} 163 if (input[1][0].isDigit()) { 164 signalTypes[system].append(input[1]); 165 } 166 else { 167 signalTypes[system].append(defaultSignals[1]); 168 } 169 if (input.size() > 2) { 170 if (input[2][0].isDigit()) { 171 signalTypes[system].append(input[2]); 172 } 173 else { 174 signalTypes[system].append(defaultSignals[2]); 175 } 176 } else { 177 signalTypes[system].append(defaultSignals[2]); 178 if (signalTypes[system][0] == signalTypes[system][1]) { 179 signalTypes[system][0] = defaultSignals[1]; 159 char system = input[0].toLatin1().constData()[0]; 160 QStringList sysValid = _defaultSignalTypes.filter(QString(system)); 161 if (!sysValid.isEmpty()) { 162 for (int iSig = 1; iSig < input.size(); iSig++) { 163 if (input[iSig].length() == 1 && input[iSig][0].isDigit()) { 164 _signalTypes[system].append(input[iSig][0].toLatin1()); 165 } 180 166 } 181 167 } … … 397 383 t_frequency::type fB = t_frequency::dummy; 398 384 char sys = satObs._prn.system(); 399 std::string frqType1, frqType2; 400 if (_signalTypes.find(sys) != _signalTypes.end()) { 401 frqType1.push_back(sys); 402 frqType1.push_back(_signalTypes[sys][0][0].toLatin1()); 403 frqType2.push_back(sys); 404 frqType2.push_back(_signalTypes[sys][1][0].toLatin1()); 405 if (frqObs->_rnxType2ch[0] == frqType1[1]) { 406 fA = t_frequency::toInt(frqType1); 407 fB = t_frequency::toInt(frqType2); 408 } 409 else if (frqObs->_rnxType2ch[0] == frqType2[1]) { 410 fA = t_frequency::toInt(frqType2); 411 fB = t_frequency::toInt(frqType1); 412 } 413 } 414 if (fA != t_frequency::dummy && fB != t_frequency::dummy) { 415 double f_a = t_CST::freq(fA, qcSat._slotNum); 416 double f_b = t_CST::freq(fB, qcSat._slotNum); 417 double C_a = frqObs->_code; 418 419 bool foundA = false; 420 double L_a = 0.0; 421 bool foundB = false; 422 double L_b = 0.0; 423 for (unsigned jj = 0; jj < satObs._obs.size(); jj++) { 424 const t_frqObs* frqObsHlp = satObs._obs[jj]; 425 if (frqObsHlp->_rnxType2ch[0] == t_frequency::toString(fA)[1] && 426 frqObsHlp->_phaseValid) { 427 foundA = true; 428 L_a = frqObsHlp->_phase * t_CST::c / f_a; 429 } 430 else if (frqObsHlp->_rnxType2ch[0] == t_frequency::toString(fB)[1] && 431 frqObsHlp->_phaseValid) { 432 foundB = true; 433 L_b = frqObsHlp->_phase * t_CST::c / f_b; 434 } 435 } 436 if (foundA && foundB) { 437 qcFrq._setMP = true; 438 qcFrq._rawMP = C_a - L_a - 2.0*f_b*f_b/(f_a*f_a-f_b*f_b) * (L_a - L_b); 385 for (int iSig = 1; iSig < _signalTypes[sys].size(); iSig++) { 386 std::string frqType1, frqType2; 387 if (_signalTypes.find(sys) != _signalTypes.end()) { 388 frqType1.push_back(sys); 389 frqType1.push_back(_signalTypes[sys][0]); 390 frqType2.push_back(sys); 391 frqType2.push_back(_signalTypes[sys][iSig]); 392 if (frqObs->_rnxType2ch[0] == frqType1[1]) { 393 fA = t_frequency::toInt(frqType1); 394 fB = t_frequency::toInt(frqType2); 395 } 396 else if (frqObs->_rnxType2ch[0] == frqType2[1]) { 397 fA = t_frequency::toInt(frqType2); 398 fB = t_frequency::toInt(frqType1); 399 } 400 } 401 if (fA != t_frequency::dummy && fB != t_frequency::dummy) { 402 double f_a = t_CST::freq(fA, qcSat._slotNum); 403 double f_b = t_CST::freq(fB, qcSat._slotNum); 404 double C_a = frqObs->_code; 405 406 bool foundA = false; 407 double L_a = 0.0; 408 bool foundB = false; 409 double L_b = 0.0; 410 for (unsigned jj = 0; jj < satObs._obs.size(); jj++) { 411 const t_frqObs* frqObsHlp = satObs._obs[jj]; 412 if (frqObsHlp->_rnxType2ch[0] == t_frequency::toString(fA)[1] && 413 frqObsHlp->_phaseValid) { 414 foundA = true; 415 L_a = frqObsHlp->_phase * t_CST::c / f_a; 416 } 417 else if (frqObsHlp->_rnxType2ch[0] == t_frequency::toString(fB)[1] && 418 frqObsHlp->_phaseValid) { 419 foundB = true; 420 L_b = frqObsHlp->_phase * t_CST::c / f_b; 421 } 422 } 423 if (foundA && foundB) { 424 qcFrq._setMP = true; 425 qcFrq._rawMP = C_a - L_a - 2.0*f_b*f_b/(f_a*f_a-f_b*f_b) * (L_a - L_b); 426 } 439 427 } 440 428 } … … 552 540 QString sn2Title = "Signal-to-Noise Ratio\n"; 553 541 554 for(QMap<char, QVector< QString> >::iterator it = _signalTypes.begin();542 for(QMap<char, QVector<char> >::iterator it = _signalTypes.begin(); 555 543 it != _signalTypes.end(); it++) { 556 544 mp1Title += QString(it.key()) + ":" + it.value()[0] + " "; … … 583 571 for (int ii = 0; ii < 2; ii++) { 584 572 if (frqType[ii].isEmpty()) { 585 QMapIterator<char, QVector< QString> > it(_signalTypes);573 QMapIterator<char, QVector<char> > it(_signalTypes); 586 574 while (it.hasNext()) { 587 575 it.next(); 588 576 if (it.key() == prn.system()) { 589 if ( it.value()[ii] == qcFrq._rnxType2ch || it.value()[ii]== qcFrq._rnxType2ch.left(1)) {577 if (QString(it.value()[ii]) == qcFrq._rnxType2ch.left(1)) { 590 578 frqType[ii] = qcFrq._rnxType2ch; 591 579 break; … … 725 713 } 726 714 727 char frqChar1 = _signalTypes[prn.system()][0][0].toLatin1(); 728 char frqChar2 = _signalTypes[prn.system()][1][0].toLatin1(); 729 730 QString frqType1; 731 QString frqType2; 732 for (int iFrq = 0; iFrq < qcSat._qcFrq.size(); iFrq++) { 733 const t_qcFrq& qcFrq = qcSat._qcFrq[iFrq]; 734 if (qcFrq._rnxType2ch[0] == frqChar1 && frqType1.isEmpty()) { 735 frqType1 = qcFrq._rnxType2ch; 736 } 737 if (qcFrq._rnxType2ch[0] == frqChar2 && frqType2.isEmpty()) { 738 frqType2 = qcFrq._rnxType2ch; 739 } 740 if (qcFrq._rnxType2ch == frqType1) { 741 if (qcFrq._slip) { 742 data._L1slip << mjdX24; 743 } 744 else if (qcFrq._gap) { 745 data._L1gap << mjdX24; 746 } 747 else { 748 data._L1ok << mjdX24; 749 } 750 } 751 else if (qcFrq._rnxType2ch == frqType2) { 752 if (qcFrq._slip) { 753 data._L2slip << mjdX24; 754 } 755 else if (qcFrq._gap) { 756 data._L2gap << mjdX24; 757 } 758 else { 759 data._L2ok << mjdX24; 715 for (int iSig = 0; iSig < _signalTypes[prn.system()].size(); iSig++) { 716 char frqChar = _signalTypes[prn.system()][iSig]; 717 QString frqType; 718 for (int iFrq = 0; iFrq < qcSat._qcFrq.size(); iFrq++) { 719 const t_qcFrq& qcFrq = qcSat._qcFrq[iFrq]; 720 if (qcFrq._rnxType2ch[0] == frqChar && frqType.isEmpty()) { 721 frqType = qcFrq._rnxType2ch; 722 } 723 if (qcFrq._rnxType2ch == frqType) { 724 t_plotData::t_hlpStatus& status = data._status[frqChar]; 725 if (qcFrq._slip) { 726 status._slip << mjdX24; 727 } 728 else if (qcFrq._gap) { 729 status._gap << mjdX24; 730 } 731 else { 732 status._ok << mjdX24; 733 } 760 734 } 761 735 } -
trunk/BNC/src/rinex/reqcanalyze.h
r7918 r8555 36 36 class t_plotData { 37 37 public: 38 QVector<double> _mjdX24;39 QVector<double> _numSat;40 QVector<double> _PDOP;41 QVector<double> _L1ok;42 QVector<double> _L2ok;43 QVector<double> _L1slip;44 QVector<double> _L2slip;45 QVector<double> _L1gap;46 QVector<double> _L2gap;47 Q Vector<double> _eleDeg;38 struct t_hlpStatus { 39 QVector<double> _ok; 40 QVector<double> _slip; 41 QVector<double> _gap; 42 }; 43 QVector<double> _mjdX24; 44 QVector<double> _numSat; 45 QVector<double> _PDOP; 46 QVector<double> _eleDeg; 47 QMap<char, t_hlpStatus> _status; 48 48 }; 49 49 … … 167 167 void checkEphemerides(); 168 168 169 void analyzePlotSignals( QMap<char, QVector<QString> >& signalTypes);169 void analyzePlotSignals(); 170 170 171 171 void analyzeFile(t_rnxObsFile* obsFile); … … 187 187 void printReport(const t_rnxObsFile* obsFile); 188 188 189 QString 190 QFile* 191 QTextStream* 192 QStringList 193 QVector<t_rnxObsFile*> 194 QStringList 195 QString 196 QMap<char, QVector< QString> > _signalTypes;197 QMap<t_prn, int> 198 QVector<char> 199 QStringList 200 QVector<t_eph*> 201 t_rnxObsFile::t_rnxEpo* 202 t_qcFile 189 QString _logFileName; 190 QFile* _logFile; 191 QTextStream* _log; 192 QStringList _obsFileNames; 193 QVector<t_rnxObsFile*> _rnxObsFiles; 194 QStringList _navFileNames; 195 QString _reqcPlotSignals; 196 QMap<char, QVector<char> > _signalTypes; 197 QMap<t_prn, int> _numExpObs; 198 QVector<char> _navFileIncomplete; 199 QStringList _defaultSignalTypes; 200 QVector<t_eph*> _ephs; 201 t_rnxObsFile::t_rnxEpo* _currEpo; 202 t_qcFile _qcFile; 203 203 }; 204 204
Note:
See TracChangeset
for help on using the changeset viewer.