Index: trunk/BNC/src/rinex/reqcanalyze.cpp
===================================================================
--- trunk/BNC/src/rinex/reqcanalyze.cpp	(revision 8542)
+++ trunk/BNC/src/rinex/reqcanalyze.cpp	(revision 8555)
@@ -74,5 +74,5 @@
     _reqcPlotSignals = _defaultSignalTypes.join(" ");
   }
-  analyzePlotSignals(_signalTypes);
+  analyzePlotSignals();
 
   connect(this, SIGNAL(dspSkyPlot(const QString&, const QString&, QVector<t_polarPoint*>*,
@@ -150,5 +150,5 @@
 //
 ////////////////////////////////////////////////////////////////////////////
-void t_reqcAnalyze::analyzePlotSignals(QMap<char, QVector<QString> >& signalTypes) {
+void t_reqcAnalyze::analyzePlotSignals() {
 
   QStringList signalsOpt = _reqcPlotSignals.split(" ", QString::SkipEmptyParts);
@@ -157,25 +157,11 @@
     QStringList input = signalsOpt.at(ii).split(QRegExp("[:&]"), QString::SkipEmptyParts);
     if (input.size() > 1 && input[0].length() == 1) {
-      char system = input[0].toLatin1().constData()[0];
-      QStringList sysValid       = _defaultSignalTypes.filter(QString(system));
-      QStringList defaultSignals = sysValid.at(0).split(QRegExp("[:&]"));
-      if (sysValid.isEmpty()) {continue;}
-      if (input[1][0].isDigit()) {
-        signalTypes[system].append(input[1]);
-      }
-      else {
-        signalTypes[system].append(defaultSignals[1]);
-      }
-      if (input.size() > 2) {
-        if (input[2][0].isDigit()) {
-          signalTypes[system].append(input[2]);
-        }
-        else {
-          signalTypes[system].append(defaultSignals[2]);
-        }
-      } else {
-        signalTypes[system].append(defaultSignals[2]);
-        if (signalTypes[system][0] == signalTypes[system][1]) {
-          signalTypes[system][0] = defaultSignals[1];
+      char        system   = input[0].toLatin1().constData()[0];
+      QStringList sysValid = _defaultSignalTypes.filter(QString(system));
+      if (!sysValid.isEmpty()) {
+        for (int iSig = 1; iSig < input.size(); iSig++) {
+          if (input[iSig].length() == 1 && input[iSig][0].isDigit()) {
+            _signalTypes[system].append(input[iSig][0].toLatin1());
+          }
         }
       }
@@ -397,44 +383,46 @@
       t_frequency::type fB = t_frequency::dummy;
       char sys             = satObs._prn.system();
-      std::string frqType1, frqType2;
-      if (_signalTypes.find(sys) != _signalTypes.end()) {
-        frqType1.push_back(sys);
-        frqType1.push_back(_signalTypes[sys][0][0].toLatin1());
-        frqType2.push_back(sys);
-        frqType2.push_back(_signalTypes[sys][1][0].toLatin1());
-        if      (frqObs->_rnxType2ch[0] == frqType1[1]) {
-          fA = t_frequency::toInt(frqType1);
-          fB = t_frequency::toInt(frqType2);
-        }
-        else if (frqObs->_rnxType2ch[0] == frqType2[1]) {
-          fA = t_frequency::toInt(frqType2);
-          fB = t_frequency::toInt(frqType1);
-        }
-      }
-      if (fA != t_frequency::dummy && fB != t_frequency::dummy) {
-        double f_a = t_CST::freq(fA, qcSat._slotNum);
-        double f_b = t_CST::freq(fB, qcSat._slotNum);
-        double C_a = frqObs->_code;
-
-        bool   foundA = false;
-        double L_a    = 0.0;
-        bool   foundB = false;
-        double L_b    = 0.0;
-        for (unsigned jj = 0; jj < satObs._obs.size(); jj++) {
-          const t_frqObs* frqObsHlp = satObs._obs[jj];
-          if      (frqObsHlp->_rnxType2ch[0] == t_frequency::toString(fA)[1] &&
-              frqObsHlp->_phaseValid) {
-            foundA = true;
-            L_a    = frqObsHlp->_phase * t_CST::c / f_a;
-          }
-          else if (frqObsHlp->_rnxType2ch[0] == t_frequency::toString(fB)[1] &&
-              frqObsHlp->_phaseValid) {
-            foundB = true;
-            L_b    = frqObsHlp->_phase * t_CST::c / f_b;
-          }
-        }
-        if (foundA && foundB) {
-          qcFrq._setMP = true;
-          qcFrq._rawMP = C_a - L_a - 2.0*f_b*f_b/(f_a*f_a-f_b*f_b) * (L_a - L_b);
+      for (int iSig = 1; iSig < _signalTypes[sys].size(); iSig++) {
+        std::string frqType1, frqType2;
+        if (_signalTypes.find(sys) != _signalTypes.end()) {
+          frqType1.push_back(sys);
+          frqType1.push_back(_signalTypes[sys][0]);
+          frqType2.push_back(sys);
+          frqType2.push_back(_signalTypes[sys][iSig]);
+          if      (frqObs->_rnxType2ch[0] == frqType1[1]) {
+            fA = t_frequency::toInt(frqType1);
+            fB = t_frequency::toInt(frqType2);
+          }
+          else if (frqObs->_rnxType2ch[0] == frqType2[1]) {
+            fA = t_frequency::toInt(frqType2);
+            fB = t_frequency::toInt(frqType1);
+          }
+        }
+        if (fA != t_frequency::dummy && fB != t_frequency::dummy) {
+          double f_a = t_CST::freq(fA, qcSat._slotNum);
+          double f_b = t_CST::freq(fB, qcSat._slotNum);
+          double C_a = frqObs->_code;
+        
+          bool   foundA = false;
+          double L_a    = 0.0;
+          bool   foundB = false;
+          double L_b    = 0.0;
+          for (unsigned jj = 0; jj < satObs._obs.size(); jj++) {
+            const t_frqObs* frqObsHlp = satObs._obs[jj];
+            if      (frqObsHlp->_rnxType2ch[0] == t_frequency::toString(fA)[1] &&
+                frqObsHlp->_phaseValid) {
+              foundA = true;
+              L_a    = frqObsHlp->_phase * t_CST::c / f_a;
+            }
+            else if (frqObsHlp->_rnxType2ch[0] == t_frequency::toString(fB)[1] &&
+                frqObsHlp->_phaseValid) {
+              foundB = true;
+              L_b    = frqObsHlp->_phase * t_CST::c / f_b;
+            }
+          }
+          if (foundA && foundB) {
+            qcFrq._setMP = true;
+            qcFrq._rawMP = C_a - L_a - 2.0*f_b*f_b/(f_a*f_a-f_b*f_b) * (L_a - L_b);
+          }
         }
       }
@@ -552,5 +540,5 @@
   QString sn2Title = "Signal-to-Noise Ratio\n";
 
-  for(QMap<char, QVector<QString> >::iterator it = _signalTypes.begin();
+  for(QMap<char, QVector<char> >::iterator it = _signalTypes.begin();
       it != _signalTypes.end(); it++) {
       mp1Title += QString(it.key()) + ":" + it.value()[0] + " ";
@@ -583,9 +571,9 @@
           for (int ii = 0; ii < 2; ii++) {
             if (frqType[ii].isEmpty()) {
-              QMapIterator<char, QVector<QString> > it(_signalTypes);
+              QMapIterator<char, QVector<char> > it(_signalTypes);
               while (it.hasNext()) {
                 it.next();
                 if (it.key() == prn.system()) {
-                  if (it.value()[ii] == qcFrq._rnxType2ch || it.value()[ii] == qcFrq._rnxType2ch.left(1)) {
+                  if (QString(it.value()[ii]) == qcFrq._rnxType2ch.left(1)) {
                     frqType[ii] = qcFrq._rnxType2ch;
                     break;
@@ -725,37 +713,23 @@
       }
 
-      char frqChar1 = _signalTypes[prn.system()][0][0].toLatin1();
-      char frqChar2 = _signalTypes[prn.system()][1][0].toLatin1();
-
-      QString frqType1;
-      QString frqType2;
-      for (int iFrq = 0; iFrq < qcSat._qcFrq.size(); iFrq++) {
-        const t_qcFrq& qcFrq = qcSat._qcFrq[iFrq];
-        if (qcFrq._rnxType2ch[0] == frqChar1 && frqType1.isEmpty()) {
-          frqType1 = qcFrq._rnxType2ch;
-        }
-        if (qcFrq._rnxType2ch[0] == frqChar2 && frqType2.isEmpty()) {
-          frqType2 = qcFrq._rnxType2ch;
-        }
-        if      (qcFrq._rnxType2ch == frqType1) {
-          if      (qcFrq._slip) {
-            data._L1slip << mjdX24;
-          }
-          else if (qcFrq._gap) {
-            data._L1gap << mjdX24;
-          }
-          else {
-            data._L1ok << mjdX24;
-          }
-        }
-        else if (qcFrq._rnxType2ch == frqType2) {
-          if      (qcFrq._slip) {
-            data._L2slip << mjdX24;
-          }
-          else if (qcFrq._gap) {
-            data._L2gap << mjdX24;
-          }
-          else {
-            data._L2ok << mjdX24;
+      for (int iSig = 0; iSig < _signalTypes[prn.system()].size(); iSig++) {
+        char    frqChar = _signalTypes[prn.system()][iSig];
+        QString frqType;
+        for (int iFrq = 0; iFrq < qcSat._qcFrq.size(); iFrq++) {
+          const t_qcFrq& qcFrq = qcSat._qcFrq[iFrq];
+          if (qcFrq._rnxType2ch[0] == frqChar && frqType.isEmpty()) {
+            frqType = qcFrq._rnxType2ch;
+          }
+          if      (qcFrq._rnxType2ch == frqType) {
+            t_plotData::t_hlpStatus& status = data._status[frqChar];
+            if      (qcFrq._slip) {
+              status._slip << mjdX24;
+            }
+            else if (qcFrq._gap) {
+              status._gap << mjdX24;
+            }
+            else {
+              status._ok << mjdX24;
+            }
           }
         }
