Changeset 7474 in ntrip for trunk/BNC/src/rinex/rnxobsfile.cpp


Ignore:
Timestamp:
Sep 29, 2015, 9:29:30 AM (9 years ago)
Author:
stuerze
Message:

in case of RINEX3 to RINEX 2 conversion now some comment lines are written into the RINEX header

File:
1 edited

Legend:

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

    r6943 r7474  
    3535 * Created:    24-Jan-2012
    3636 *
    37  * Changes:   
     37 * Changes:
    3838 *
    3939 * -----------------------------------------------------------------------*/
     
    310310  _obsTypes.clear();
    311311  if (_version < 3.0) {
    312     _obsTypes['G'] << "C1" << "P1" << "L1" << "S1" 
     312    _obsTypes['G'] << "C1" << "P1" << "L1" << "S1"
    313313                   << "C2" << "P2" << "L2" << "S2";
    314314    _obsTypes['R'] = _obsTypes['G'];
     
    319319  }
    320320  else {
    321     _obsTypes['G'] << "C1C" << "L1C"  << "S1C" 
     321    _obsTypes['G'] << "C1C" << "L1C"  << "S1C"
    322322                   << "C1W" << "L1W"  << "S1W"
    323323                   << "C2X" << "L2X"  << "S2X"
    324                    << "C2W" << "L2W"  << "S2W" 
     324                   << "C2W" << "L2W"  << "S2W"
    325325                   << "C5X" << "L5X"  << "S5X";
    326326
    327327    _obsTypes['J'] = _obsTypes['G'];
    328    
    329     _obsTypes['R'] << "C1C" << "L1C" << "S1C" 
     328
     329    _obsTypes['R'] << "C1C" << "L1C" << "S1C"
    330330                   << "C2P" << "L2P" << "S2P";
    331    
     331
    332332    _obsTypes['E'] << "C1X" << "L1X" << "SX1"
    333333                   << "C5X" << "L5X" << "SX5"
    334334                   << "C7X" << "L7X" << "SX7"
    335335                   << "C8X" << "L8X" << "SX8";
    336    
     336
    337337    _obsTypes['S'] << "C1C" << "L1C" << "S1C"
    338338                   << "C5I" << "L5I" << "S5I"
    339339                   << "C5Q" << "L5Q" << "S5Q";
    340    
     340
    341341    _obsTypes['C'] << "C2I" << "L2I" << "S2I"
    342342                   << "C6I" << "L6I" << "S6I"
     
    359359    _version = t_rnxObsHeader::defaultRnxObsVersion3;
    360360  }
    361   _interval        = header._interval;   
    362   _antennaNumber   = header._antennaNumber; 
    363   _antennaName     = header._antennaName; 
    364   _markerName      = header._markerName; 
    365   _markerNumber    = header._markerNumber; 
     361  _interval        = header._interval;
     362  _antennaNumber   = header._antennaNumber;
     363  _antennaName     = header._antennaName;
     364  _markerName      = header._markerName;
     365  _markerNumber    = header._markerNumber;
    366366  _markerType      = header._markerType;
    367   _antNEU          = header._antNEU;     
    368   _antXYZ          = header._antXYZ;     
    369   _antBSG          = header._antBSG;     
    370   _xyz             = header._xyz;         
    371   _observer        = header._observer;       
    372   _agency          = header._agency;         
    373   _receiverNumber  = header._receiverNumber; 
    374   _receiverType    = header._receiverType;   
     367  _antNEU          = header._antNEU;
     368  _antXYZ          = header._antXYZ;
     369  _antBSG          = header._antBSG;
     370  _xyz             = header._xyz;
     371  _observer        = header._observer;
     372  _agency          = header._agency;
     373  _receiverNumber  = header._receiverNumber;
     374  _receiverType    = header._receiverType;
    375375  _receiverVersion = header._receiverVersion;
    376   _startTime       = header._startTime;   
     376  _startTime       = header._startTime;
    377377  _comments        = header._comments;
    378378  _usedSystems     = header._usedSystems;
    379379
    380380  for (unsigned iPrn = 1; iPrn <= t_prn::MAXPRN_GPS; iPrn++) {
    381     _wlFactorsL1[iPrn] =  header._wlFactorsL1[iPrn]; 
    382     _wlFactorsL2[iPrn] =  header._wlFactorsL2[iPrn]; 
     381    _wlFactorsL1[iPrn] =  header._wlFactorsL1[iPrn];
     382    _wlFactorsL2[iPrn] =  header._wlFactorsL2[iPrn];
    383383  }
    384384
     
    444444        for (int iSys = 0; iSys < _usedSystems.length(); iSys++) {
    445445          char    sys  = _usedSystems[iSys].toAscii();
    446           QString type = _version >= 3.0 ? t_rnxObsFile::type2to3(sys, useObsTypes->at(iType)) : 
     446          QString type = _version >= 3.0 ? t_rnxObsFile::type2to3(sys, useObsTypes->at(iType)) :
    447447                                           t_rnxObsFile::type3to2(sys, useObsTypes->at(iType));
    448448          if (!_obsTypes[sys].contains(type)) {
     
    523523
    524524  if (txtMap) {
    525     QMapIterator<QString, QString> it(*txtMap);
     525   QMapIterator<QString, QString> it(*txtMap);
    526526    while (it.hasNext()) {
    527527      it.next();
     
    529529        runBy = it.value();
    530530      }
    531       else if (it.key() == "COMMENT") {
    532         newComments = it.value().split("\\n", QString::SkipEmptyParts);
     531      else if ((it.key().indexOf("COMMENT")) != -1) {
     532        newComments += it.value().split("\\n", QString::SkipEmptyParts);
    533533      }
    534534    }
     
    570570    .leftJustified(60)
    571571           << "MARKER TYPE\n";
    572            
     572
    573573  *stream << QString("%1%2")
    574574    .arg(_observer, -20)
     
    766766}
    767767
    768 // 
     768//
    769769////////////////////////////////////////////////////////////////////////////
    770770char t_rnxObsHeader::system(int iSys) const {
     
    781781}
    782782
     783//
     784////////////////////////////////////////////////////////////////////////////
     785QString t_rnxObsHeader::usedSystems(void) const {
     786  return _usedSystems;
     787}
     788
     789QStringList t_rnxObsHeader::obsTypes(char sys) const {
     790  if (_obsTypes.contains(sys)) {
     791    return _obsTypes[sys];
     792  }
     793  else {
     794    return QStringList();
     795  }
     796}
     797
    783798// Number of Observation Types (satellite-system specific)
    784799////////////////////////////////////////////////////////////////////////////
     
    873888    QTextStream(&hlp) << QString("%1").arg(_obsTypes[sys0].size(), 6);
    874889    for (int ii = 0; ii < _obsTypes[sys0].size(); ii++) {
    875       QTextStream(&hlp) << QString("%1").arg(_obsTypes[sys0][ii], 6);   
     890      QTextStream(&hlp) << QString("%1").arg(_obsTypes[sys0][ii], 6);
    876891      if ((ii+1) % 9 == 0 || ii == _obsTypes[sys0].size()-1) {
    877892        strList.append(hlp.leftJustified(60) + "# / TYPES OF OBSERV\n");
     
    887902      for (int iType = 0; iType < nTypes(sys); iType++) {
    888903        QString type = obsType(sys, iType);
    889         QTextStream(&hlp) << QString(" %1").arg(type, -3);   
     904        QTextStream(&hlp) << QString(" %1").arg(type, -3);
    890905        if ((iType+1) % 13 == 0 || iType == nTypes(sys)-1) {
    891906          strList.append(hlp.leftJustified(60) + "SYS / # / OBS TYPES\n");
     
    9851000// Handle Special Epoch Flag
    9861001////////////////////////////////////////////////////////////////////////////
    987 void t_rnxObsFile::handleEpochFlag(int flag, const QString& line, 
     1002void t_rnxObsFile::handleEpochFlag(int flag, const QString& line,
    9881003                                   bool& headerReRead) {
    9891004
     
    10031018
    10041019  // Re-Read Header
    1005   // -------------- 
     1020  // --------------
    10061021  else if (flag == 3 || flag == 4 || flag == 5) {
    10071022    int numLines = 0;
     
    10771092    int numSat;
    10781093    readInt(line, 32, 3, numSat);
    1079  
     1094
    10801095    _currEpo.rnxSat.resize(numSat);
    10811096
     
    10901105        int pos = 3 + 16*iType;
    10911106        double obsValue = 0.0;
    1092         int    lli      = 0; 
     1107        int    lli      = 0;
    10931108        int    snr      = 0;
    10941109        readDbl(line, pos,     14, obsValue);
     
    11541169    int numSat;
    11551170    readInt(line, 29, 3, numSat);
    1156  
     1171
    11571172    _currEpo.rnxSat.resize(numSat);
    11581173
     
    11721187      int satNum; readInt(line, pos + 1, 2, satNum);
    11731188      _currEpo.rnxSat[iSat].prn.set(sys, satNum);
    1174  
     1189
    11751190      pos += 3;
    11761191    }
     
    12061221      }
    12071222    }
    1208  
     1223
    12091224    _flgPowerFail = false;
    12101225
    12111226    return &_currEpo;
    12121227  }
    1213  
     1228
    12141229  return 0;
    12151230}
     
    12261241    const t_rnxSat& rnxSat = epo->rnxSat[ii];
    12271242    if (_header._obsTypes[rnxSat.prn.system()].size() > 0) {
    1228       epoLocal.rnxSat.push_back(rnxSat);   
     1243      epoLocal.rnxSat.push_back(rnxSat);
    12291244    }
    12301245  }
     
    12401255// Write Data Epoch (RINEX Version 2)
    12411256////////////////////////////////////////////////////////////////////////////
    1242 void t_rnxObsFile::writeEpochV2(QTextStream* stream, const t_rnxObsHeader& header, 
     1257void t_rnxObsFile::writeEpochV2(QTextStream* stream, const t_rnxObsHeader& header,
    12431258                                const t_rnxEpo* epo) {
    12441259
     
    12781293      QString typeV2 = header.obsType(sys, iTypeV2);
    12791294      bool    found  = false;
    1280    
     1295
    12811296      QString preferredAttrib = signalPriorities(sys);
    12821297      for (int iPref = 0; iPref < preferredAttrib.length(); iPref++) {
     
    13241339// Write Data Epoch (RINEX Version 3)
    13251340////////////////////////////////////////////////////////////////////////////
    1326 void t_rnxObsFile::writeEpochV3(QTextStream* stream, const t_rnxObsHeader& header, 
     1341void t_rnxObsFile::writeEpochV3(QTextStream* stream, const t_rnxObsHeader& header,
    13271342                                const t_rnxEpo* epo) {
    13281343
     
    14311446// Set Observations from RINEX File
    14321447////////////////////////////////////////////////////////////////////////////
    1433 void t_rnxObsFile::setObsFromRnx(const t_rnxObsFile* rnxObsFile, const t_rnxObsFile::t_rnxEpo* epo, 
     1448void t_rnxObsFile::setObsFromRnx(const t_rnxObsFile* rnxObsFile, const t_rnxObsFile::t_rnxEpo* epo,
    14341449                                 const t_rnxObsFile::t_rnxSat& rnxSat, t_satObs& obs) {
    14351450  obs._staID = rnxObsFile->markerName().toAscii().constData();
     
    14611476      if (rnxObs.value != 0.0) {
    14621477        string type2ch(typeV3.mid(1).toAscii().data());
    1463        
     1478
    14641479        t_frqObs* frqObs = 0;
    14651480        for (unsigned iFrq = 0; iFrq < obs._obs.size(); iFrq++) {
     
    14741489          obs._obs.push_back(frqObs);
    14751490        }
    1476        
     1491
    14771492        switch( typeV3.toAscii().data()[0] ) {
    14781493        case 'C':
Note: See TracChangeset for help on using the changeset viewer.