Changeset 6815 in ntrip


Ignore:
Timestamp:
May 6, 2015, 2:15:11 PM (9 years ago)
Author:
stuerze
Message:

updates regarding obs header etry "SYS / PHASE SHIFT": list of satellite is now considered, in case of RTCM MSM messages record values are set to zero;
default obs types modified; BDS frequency band changed again

Location:
trunk/BNC/src/rinex
Files:
2 edited

Legend:

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

    r6719 r6815  
    7575  _comments.clear();
    7676  int numLines = 0;
     77
    7778  while ( stream->status() == QTextStream::Ok && !stream->atEnd() ) {
    7879    QString line = stream->readLine(); ++ numLines;
     
    199200        QString hlp;
    200201        *in >> hlp;
    201         if (sys == 'C') {
     202        if (sys == 'C' && _version == 3.02){
    202203          hlp.replace('2', '1');
    203204        }
     
    214215    }
    215216    else if (key == "SYS / PHASE SHIFT"){
    216       QTextStream in(value.toAscii(), QIODevice::ReadOnly);
    217       char sys;
    218       QString obstype;
    219       double shift;
    220       in >> sys >> obstype >> shift;
    221       if (obstype.size())
    222         _phaseShifts.insert(sys, QPair<QString, double>(obstype, shift));
     217      QTextStream* in = new QTextStream(value.toAscii(), QIODevice::ReadOnly);
     218      char        sys;
     219      QString     obstype;
     220      double      shift;
     221      int         satnum = 0;
     222      QStringList satList;
     223      QString     sat;
     224      *in >> sys >> obstype >> shift >> satnum;
     225      if (obstype.size()) {
     226        for (int ii = 0; ii < satnum; ii++) {
     227          if (ii > 0 && ii % 10 == 0) {
     228            line = stream->readLine(); ++numLines;
     229            delete in;
     230            in = new QTextStream(line.left(60).toAscii(), QIODevice::ReadOnly);
     231          }
     232          *in >> sat;
     233          satList.append(sat);
     234        }
     235        _phaseShifts.insert(sys+obstype, QPair<double, QStringList>(shift, satList));
     236        delete in;
     237      }
    223238    }
    224239    else if (key == "GLONASS COD/PHS/BIS"){
     
    302317  else {
    303318    _obsTypes['G'] << "C1C" << "L1C"  << "S1C"
     319                   << "C1W" << "L1W"  << "S1W"
     320                   << "C2X" << "L2X"  << "S2X"
    304321                   << "C2W" << "L2W"  << "S2W"
    305                    << "C5"  << "L5"   << "S5";
    306    
     322                   << "C5X" << "L5X"  << "S5X";
     323
    307324    _obsTypes['J'] = _obsTypes['G'];
    308325   
     
    310327                   << "C2P" << "L2P" << "S2P";
    311328   
    312     _obsTypes['E'] << "C1" << "L1" << "S1"
    313                    << "C5" << "L5" << "S5"
    314                    << "C7" << "L7" << "S7"
    315                    << "C8" << "L8" << "S8";
     329    _obsTypes['E'] << "C1X" << "L1X" << "SX1"
     330                   << "C5X" << "L5X" << "SX5"
     331                   << "C7X" << "L7X" << "SX7"
     332                   << "C8X" << "L8X" << "SX8";
    316333   
    317     _obsTypes['S'] << "C1" << "L1" << "S1"
    318                    << "C5" << "L5" << "S5";
     334    _obsTypes['S'] << "C1C" << "L1C" << "S1C"
     335                   << "C5I" << "L5I" << "S5I"
     336                   << "C5Q" << "L5Q" << "S5Q";
    319337   
    320     _obsTypes['C'] << "C1" << "L1" << "S1"
    321                    << "C6" << "L6" << "S6"
    322                    << "C7" << "L7" << "S7";
     338    _obsTypes['C'] << "C2I" << "L2I" << "S2I"
     339                   << "C6I" << "L6I" << "S6I"
     340                   << "C7I" << "L7I" << "S7I";
    323341  }
    324342}
     
    353371  _usedSystems     = header._usedSystems;
    354372  if (_version >= 3.0) {
    355     _phaseShifts   = header._phaseShifts;
     373    _phaseShifts    = header._phaseShifts;
    356374    _gloPhaseBiases = header._gloPhaseBiases;
    357375    _gloSlots       = header._gloSlots;
     
    561579  if (_version >= 3.0) {
    562580    if (_phaseShifts.empty()) {
    563       QString sys = _usedSystems;
    564       for (int ii = 0; ii < sys.size(); ii++) {
    565         *stream << QString("%1")
    566           .arg(sys[ii], 0)
     581      QMap<char, QStringList>::const_iterator it;
     582      for (it = _obsTypes.begin(); it != _obsTypes.end(); ++it) {
     583        char sys = it.key();
     584        double shift = 0.0;
     585        foreach (const QString &obstype, it.value()) {
     586          if (obstype.left(1).contains('L')) {
     587          *stream << QString("%1 %2 %3")
     588            .arg(sys, 0)
     589            .arg(obstype, 0)
     590            .arg(shift, 9, 'f', 5)
     591            .leftJustified(60)
     592             << "SYS / PHASE SHIFT\n";
     593          }
     594        }
     595      }
     596    } else {
     597      QMap<QString, QPair<double, QStringList> >::const_iterator it;
     598      QString emptyFillStr;
     599      for(it = _phaseShifts.begin(); it!= _phaseShifts.end(); ++it) {
     600        QString sys         = it.key().left(1);
     601        QString obstype     = it.key().mid(1);
     602        double shift        = it.value().first;
     603        QStringList satList =  it.value().second;
     604        QString hlp = QString("%1 %2 %3 ")
     605          .arg(sys.toStdString().c_str(), 0)
     606          .arg(obstype, 4)
     607          .arg(shift, 9, 'f', 5);
     608        if (!satList.empty()) {
     609          hlp += QString("%1 ").arg(satList.size(), 2);
     610        }
     611        else {
     612          *stream << QString("%1")
     613            .arg(hlp, 0)
     614            .leftJustified(60)
     615             << "SYS / PHASE SHIFT\n";
     616          hlp = "";
     617        }
     618        int ii = 0;
     619        QStringList::const_iterator it_s;
     620        for (it_s = satList.begin(); it_s != satList.end(); ++it_s) {
     621          (hlp.contains(obstype)) ?
     622             emptyFillStr = "":
     623             emptyFillStr = "                    ";
     624          hlp += QString("%1 ").arg(*it_s);
     625          ii++;
     626          if (ii % 10 == 0) {
     627            *stream << QString("%1%2")
     628              .arg(emptyFillStr, 0)
     629              .arg(hlp, 0)
     630              .leftJustified(60)
     631              << "SYS / PHASE SHIFT\n";
     632            hlp = "";
     633          }
     634        }
     635        if (hlp.size()) {
     636        *stream <<  QString("%1%2")
     637          .arg(emptyFillStr, 0)
     638          .arg(hlp, 0)
    567639          .leftJustified(60)
    568            << "SYS / PHASE SHIFT\n";
    569       }
    570     } else {
    571       QMultiHash<char, QPair<QString, double> >::const_iterator it = _phaseShifts.begin();
    572       while(it != _phaseShifts.end()) {
    573         *stream << QString("%1%2%3")
    574           .arg(it.key(), 0)
    575           .arg(it.value().first, 4)
    576           .arg(it.value().second, 9, 'f', 5)
    577           .leftJustified(60)
    578            << "SYS / PHASE SHIFT\n";
    579         it++;
     640          << "SYS / PHASE SHIFT\n";
     641        }
    580642      }
    581643    }
     
    623685    }
    624686  }
    625 
    626687
    627688  *stream << QString()
  • trunk/BNC/src/rinex/rnxobsfile.h

    r6795 r6815  
    4444 public:
    4545  static const double  defaultRnxObsVersion2 = 2.11;
    46   static const double  defaultRnxObsVersion3 = 3.02;
     46  static const double  defaultRnxObsVersion3 = 3.03;
    4747  static const QString defaultSystems;
    4848
     
    8787  int                     _wlFactorsL2[t_prn::MAXPRN_GPS+1];
    8888  bncTime                 _startTime;
    89   QMultiHash<char, QPair<QString, double> > _phaseShifts;
     89  QMap<QString, QPair<double, QStringList> > _phaseShifts;
    9090};
    9191
Note: See TracChangeset for help on using the changeset viewer.