Ignore:
Timestamp:
Jul 21, 2016, 11:27:01 AM (8 years ago)
Author:
stuerze
Message:

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
  • branches/BNC_2.12/src/rinex/reqcedit.cpp

    r7941 r7983  
    643643  int key = 0;
    644644  QString systems = obsFile->header().usedSystems();
    645   QString comment = QString("RINEX 3 => 2 CONVERSION DETAILS:");
     645  QString comment = QString("Signal priorities for RINEX 3 => 2 conversion:");
    646646  QString commentKey = QString("COMMENT %1").arg(key, 3, 10, QChar('0'));
    647647  txtMap.insert(commentKey, comment);
    648648
    649649  for(int ii = 0; ii < obsFile->numSys(); ii++) {
    650     key++;
    651650    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'));
    655651    txtMap.insert(commentKey, comment);
     652    QMap <char, QString>  signalPriorityMap;
     653    QStringList preferredAttribListSys = obsFile->signalPriorities(sys);
    656654    QStringList types = obsFile->header().obsTypes(sys);
    657655    for (int jj = 0; jj < types.size(); jj++) {
    658       key++;
    659656      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 }
     657      char band = inType[1].toAscii();
     658      for (int ii = 0; ii < preferredAttribListSys.size(); ii++) {
     659        QString preferredAttrib;
     660        if (preferredAttribListSys[ii].indexOf("&") != -1) {
     661          QStringList hlp = preferredAttribListSys[ii].split("&", QString::SkipEmptyParts);
     662          if (hlp.size() == 2 && hlp[0].contains(band)) {
     663            preferredAttrib = hlp[1];
     664          }
     665        }
     666        else {
     667          preferredAttrib = preferredAttribListSys[ii];
     668        }
     669        if (!signalPriorityMap.contains(band) && !preferredAttrib.isEmpty()){
     670          signalPriorityMap[band] = preferredAttrib;
     671        }
     672      }
     673    }
     674    QMapIterator<char, QString> it(signalPriorityMap);
     675    while (it.hasNext()) {
     676        it.next();
     677        key++;
     678        comment = QString("%1 band %2: %3").arg(sys).arg(it.key()).arg(it.value());
     679        commentKey = QString("COMMENT %1").arg(key, 3, 10, QChar('0'));
     680        txtMap.insert(commentKey, comment);
     681    }
     682  }
     683}
Note: See TracChangeset for help on using the changeset viewer.