Changeset 7980 in ntrip for trunk/BNC/src/rinex/reqcedit.cpp


Ignore:
Timestamp:
Jul 21, 2016, 10:31:16 AM (8 years ago)
Author:
stuerze
Message:

System and frequency specific signal priorities are added for RINEX3 to RINEX2 conversion and the default 'Signal priority' list is improved

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/rinex/reqcedit.cpp

    r7942 r7980  
    156156    deleteLater();
    157157  }
     158
    158159}
    159160
     
    643644  int key = 0;
    644645  QString systems = obsFile->header().usedSystems();
    645   QString comment = QString("RINEX 3 => 2 CONVERSION DETAILS:");
     646  QString comment = QString("Signal priorities for RINEX 3 => 2 conversion:");
    646647  QString commentKey = QString("COMMENT %1").arg(key, 3, 10, QChar('0'));
    647648  txtMap.insert(commentKey, comment);
    648649
    649650  for(int ii = 0; ii < obsFile->numSys(); ii++) {
    650     key++;
    651651    char sys = systems[ii].toAscii();
    652     QString preferredAttrib = obsFile->signalPriorities(sys);
    653     comment = QString("%1: Signal priority = %2").arg(sys).arg(preferredAttrib);
    654     commentKey = QString("COMMENT %1").arg(key, 3, 10, QChar('0'));
    655652    txtMap.insert(commentKey, comment);
     653    QMap <char, QString>  signalPriorityMap;
     654    QStringList preferredAttribListSys = obsFile->signalPriorities(sys);
    656655    QStringList types = obsFile->header().obsTypes(sys);
    657656    for (int jj = 0; jj < types.size(); jj++) {
    658       key++;
    659657      QString inType = types[jj];
    660       for (int iPref = 0; iPref < preferredAttrib.length(); iPref++) {
    661         if (preferredAttrib[iPref] == '?'                             ||
    662             (inType.length() == 2 && preferredAttrib[iPref] == '_'    ) ||
    663             (inType.length() == 3 && preferredAttrib[iPref] == inType[2]) ) {
    664           QString outType = t_rnxObsFile::type3to2(sys, inType);
    665           comment = QString("%1: %2 => %3").arg(sys).arg(inType).arg(outType);
    666           commentKey = QString("COMMENT %1").arg(key, 3, 10, QChar('0'));
    667           txtMap.insert(commentKey, comment);
    668           break;
    669         }
    670       }
    671     }
    672   }
    673 }
     658      char band = inType[1].toAscii();
     659      for (int ii = 0; ii < preferredAttribListSys.size(); ii++) {
     660        QString preferredAttrib;
     661        if (preferredAttribListSys[ii].indexOf("&") != -1) {
     662          QStringList hlp = preferredAttribListSys[ii].split("&", QString::SkipEmptyParts);
     663          if (hlp.size() == 2 && hlp[0].contains(band)) {
     664            preferredAttrib = hlp[1];
     665          }
     666        }
     667        else {
     668          preferredAttrib = preferredAttribListSys[ii];
     669        }
     670        if (!signalPriorityMap.contains(band) && !preferredAttrib.isEmpty()){
     671          signalPriorityMap[band] = preferredAttrib;
     672        }
     673      }
     674    }
     675    QMapIterator<char, QString> it(signalPriorityMap);
     676    while (it.hasNext()) {
     677        it.next();
     678        key++;
     679        comment = QString("%1 band %2: %3").arg(sys).arg(it.key()).arg(it.value());
     680        commentKey = QString("COMMENT %1").arg(key, 3, 10, QChar('0'));
     681        txtMap.insert(commentKey, comment);
     682    }
     683  }
     684}
Note: See TracChangeset for help on using the changeset viewer.