Changeset 9945 in ntrip for trunk


Ignore:
Timestamp:
Dec 15, 2022, 11:06:12 PM (16 months ago)
Author:
stuerze
Message:

multiple 'run by date' entries for rinex version 4 added

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

Legend:

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

    r9893 r9945  
    224224  t_rnxObsFile outObsFile(_outObsFileName, t_rnxObsFile::output);
    225225
     226
     227  // Put together all run by date entries
     228  // ------------------------------------
     229  QStringList runByDate;
     230  if (_rnxVersion >= 4.0 && _rnxObsFiles.size() > 1) {
     231    for (int ii = 0; ii < _rnxObsFiles.size(); ii++) {
     232      t_rnxObsFile* rnxObsFile = _rnxObsFiles[ii];
     233      QStringListIterator itRunByDt(rnxObsFile->runByDate());
     234      while (itRunByDt.hasNext()) {
     235        runByDate.append(itRunByDt.next());
     236      }
     237    }
     238    runByDate.removeDuplicates();
     239  }
     240
    226241  // Select observation types
    227242  // ------------------------
     
    307322    if (ii == 0) {
    308323      outObsFile.setHeader(obsFile->header(), int(_rnxVersion), &useObsTypes,
    309           &phaseShifts, &gloBiases, &gloSlots);
     324          &phaseShifts, &gloBiases, &gloSlots, &runByDate);
    310325      if (_begTime.valid() && _begTime > outObsFile.startTime()) {
    311326        outObsFile.setStartTime(_begTime);
     
    403418    }
    404419  }
    405 
    406420
    407421  const ColumnVector& obsFileAntNEU = obsFile.antNEU();
     
    539553    return;
    540554  }
    541   // Concatenate all comments
    542   // ------------------------
     555  // Concatenate all comments and all run by date lines
     556  // --------------------------------------------------
    543557  QStringList comments;
     558  QStringList runByDate;
    544559  bncSettings settings;
    545560  QString comment = settings.value("reqcComment").toString();
     
    555570      comments.append(itCmnt.next());
    556571    }
     572    QStringListIterator itRunByDt(rnxNavFile.runByDate());
     573    while (itRunByDt.hasNext()) {
     574      runByDate.append(itRunByDt.next());
     575    }
    557576  }
    558577  comments.removeDuplicates();
     578  runByDate.removeDuplicates();
    559579
    560580  // Read Ephemerides
     
    611631      outNavFile.setVersion(defaultRnxNavVersion2);
    612632    }
     633    if (!haveGPS && haveGlonass) {
     634      outNavFile.setVersion(defaultRnxNavVersion2);
     635    }
    613636  }
    614637
     
    634657  if (!runBy.isEmpty()) {
    635658    txtMap["RUN BY"]  = runBy;
     659  }
     660  if (!runByDate.empty()) {
     661          txtMap["RUN BY DATE"] = runByDate.join("\\n");
    636662  }
    637663  if (!comments.isEmpty()) {
     
    667693      continue;
    668694    }
     695
     696    if (outNavFile.version() < 3.0) {
     697          if (outNavFile.glonass() && eph->type() != t_eph::GLONASS) {
     698            continue;
     699          }
     700          if (!outNavFile.glonass() && eph->type() != t_eph::GPS) {
     701            continue;
     702      }
     703    }
     704
     705    if (outNavFile.version() < 4.0) {
     706      if (eph->navType() == t_eph::CNAV ||
     707          eph->navType() == t_eph::CNV1 ||
     708          eph->navType() == t_eph::CNV2 ||
     709          eph->navType() == t_eph::CNV3) {
     710        continue;
     711      }
     712    }
     713
    669714    if (outNavFile.version() >= 4.0 &&
    670715        eph->navType() == t_eph::undefined) { // input files < version 4.0
    671716      continue;
    672717    }
     718
    673719    outNavFile.writeEph(eph);
    674720  }
  • trunk/BNC/src/rinex/rnxnavfile.cpp

    r9788 r9945  
    8282    else if (key == "COMMENT") {
    8383      _comments.append(value.trimmed());
     84    }
     85    else if (key == "PGM / RUN BY / DATE") {
     86      _runByDate.append(value.trimmed());
    8487    }
    8588  }
     
    303306  QString     runBy = BNC_CORE->userName();
    304307  QStringList comments;
     308  QStringList runByDate;
    305309
    306310  if (txtMap) {
     
    310314      if      (it.key() == "RUN BY") {
    311315        runBy = it.value();
     316      }
     317      else if (it.key() == "RUN BY DATE") {
     318          runByDate = it.value().split("\\n", QString::SkipEmptyParts);
    312319      }
    313320      else if (it.key() == "COMMENT") {
     
    370377
    371378  if (version() >= 4.0) {
     379    QStringListIterator itRunByDt(runByDate);
     380    while (itRunByDt.hasNext()) {
     381      *_stream << itRunByDt.next().trimmed().left(60).leftJustified(60)
     382               << "PGM / RUN BY / DATE\n";
     383        }
    372384    *_stream << QString("%1").arg(leapSecs, 6, 10, QLatin1Char(' ')).left(60).leftJustified(60)
    373385        << "LEAP SECONDS\n";
     
    382394  }
    383395
    384 
    385396  *_stream << QString()
    386397    .leftJustified(60)
     
    391402////////////////////////////////////////////////////////////////////////////
    392403void t_rnxNavFile::writeEph(const t_eph* eph) {
    393   if (version() < 4.0) {
    394     if (eph->navType() == t_eph::CNAV ||
    395         eph->navType() == t_eph::CNV1 ||
    396         eph->navType() == t_eph::CNV2 ||
    397         eph->navType() == t_eph::CNV3) {
    398       return;
    399     }
    400   }
    401404  *_stream << eph->toString(version());
    402405}
  • trunk/BNC/src/rinex/rnxnavfile.h

    r9765 r9945  
    5454    t_eph::e_type _satSys;
    5555    QStringList _comments;
     56    QStringList _runByDate;
    5657  };
    5758
     
    6566  bool   glonass() const {return _header._glonass;}
    6667  QStringList comments() const {return _header._comments;}
     68  QStringList runByDate() const {return _header._runByDate;}
    6769  t_eph::e_type satSystem() const {return _header._satSys;}
    6870  void   setGlonass(bool glo) {_header._glonass = glo;}
  • trunk/BNC/src/rinex/rnxobsfile.cpp

    r9870 r9945  
    110110      in >> _version;
    111111    }
     112    else if (key == "PGM / RUN BY / DATE") {
     113      _runByDate.append(value.trimmed());
     114    }
    112115    else if (key == "MARKER NAME") {
    113116      _markerName = value;
     
    320323    _usedSystems += QChar(it.key());
    321324  }
    322  
     325
    323326  return success;
    324327}
     
    406409                         const QStringList* phaseShifts,
    407410                         const QStringList* gloBiases,
    408                          const QStringList* gloSlots) {
     411                         const QStringList* gloSlots,
     412                         const QStringList* runByDate) {
    409413
    410414  _version = versionFromInt(version);
     
    596600    }
    597601  }
     602  if (_version >= 4.0) {
     603    // set run by date entries
     604    if (!runByDate || runByDate->empty()) {
     605      _runByDate = header._runByDate;
     606    }
     607    else {
     608      foreach (const QString &str, *runByDate) {
     609        _runByDate.append(str);
     610      }
     611    }
     612  }
     613
    598614}
    599615
     
    604620
    605621  QStringList newComments;
     622  QStringList runByDate;
    606623  QString     runBy = BNC_CORE->userName();
    607624
    608625  if (txtMap) {
    609    QMapIterator<QString, QString> it(*txtMap);
     626    QMapIterator<QString, QString> it(*txtMap);
    610627    while (it.hasNext()) {
    611628      it.next();
    612629      if      (it.key() == "RUN BY") {
    613630        runBy = it.value();
     631      }
     632      else if (it.key() == "RUN BY DATE") {
     633          runByDate = it.value().split("\\n", QString::SkipEmptyParts);
    614634      }
    615635      else if ((it.key().indexOf("COMMENT")) != -1) {
     
    634654           << "PGM / RUN BY / DATE\n";
    635655
     656  if (_version >= 4.0) {
     657    QStringListIterator itRunByDt(_runByDate);
     658    while (itRunByDt.hasNext()) {
     659      *stream << itRunByDt.next().trimmed().left(60).leftJustified(60)
     660          << "PGM / RUN BY / DATE\n";
     661    }
     662  }
    636663  QStringListIterator itCmnt(_comments + newComments);
    637664  while (itCmnt.hasNext()) {
     
    882909}
    883910
     911//
     912////////////////////////////////////////////////////////////////////////////
    884913QStringList t_rnxObsHeader::obsTypes(char sys) const {
    885914  if (_obsTypes.contains(sys)) {
  • trunk/BNC/src/rinex/rnxobsfile.h

    r9770 r9945  
    5757  void        set(const t_rnxObsHeader& header, int version,
    5858                  const QStringList* useObsTypes = 0, const QStringList* phaseShifts = 0,
    59                   const QStringList* gloBiases = 0, const QStringList* gloSlots = 0);
     59                  const QStringList* gloBiases = 0, const QStringList* gloSlots = 0,
     60                  const QStringList* runByDate = 0);
    6061  int         numSys() const;
    6162  char        system(int iSys) const;
     
    6970  QStringList gloBiases() const;
    7071  QStringList gloSlots() const;
     72  QStringList runByDate() const {return _runByDate;}
    7173  void        write(QTextStream* stream, const QMap<QString, QString>* txtMap = 0) const;
    7274  bncTime     startTime() const {return _startTime;}
     
    9395  QStringList     _stationInformation;
    9496  QStringList     _comments;
     97  QStringList     _runByDate;
    9598  ColumnVector    _antNEU;
    9699  ColumnVector    _antXYZ;
     
    162165  QStringList gloBiases() const {return _header.gloBiases();}
    163166  QStringList gloSlots() const {return _header.gloSlots();}
     167  QStringList runByDate() const {return _header.runByDate();}
    164168  const QString& antennaName() const {return _header._antennaName;}
    165169  const QString& antennaNumber() const {return _header._antennaNumber;}
     
    192196  const ColumnVector& antBSG() const {return _header._antBSG;}
    193197
    194   const bncTime&      startTime() const {return _header._startTime;}
     198  const bncTime& startTime() const {return _header._startTime;}
    195199  void  setStartTime(const bncTime& startTime) {_header._startTime = startTime;}
    196200
     
    208212  void setHeader(const t_rnxObsHeader& header, int version,
    209213      const QStringList* useObsTypes = 0, const QStringList* phaseShifts = 0,
    210       const QStringList* gloBiases = 0, const QStringList* gloSlots = 0) {
    211     _header.set(header, version, useObsTypes, phaseShifts, gloBiases, gloSlots);
     214      const QStringList* gloBiases = 0, const QStringList* gloSlots = 0, const QStringList* runByDate = 0) {
     215    _header.set(header, version, useObsTypes, phaseShifts, gloBiases, gloSlots, runByDate);
    212216  }
    213217
Note: See TracChangeset for help on using the changeset viewer.