Changeset 9765 in ntrip for trunk/BNC/src/rinex/rnxnavfile.cpp


Ignore:
Timestamp:
Jun 20, 2022, 4:54:59 PM (23 months ago)
Author:
stuerze
Message:

some more changes to consider RINEX Version 4 nav file (EPH key only)

File:
1 edited

Legend:

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

    r9366 r9765  
    146146////////////////////////////////////////////////////////////////////////////
    147147void t_rnxNavFile::read(QTextStream* stream) {
     148  QString navTypeStr;
    148149
    149150  while (stream->status() == QTextStream::Ok && !stream->atEnd()) {
     151
    150152    QString line = stream->readLine();
    151153    if (line.isEmpty()) {
    152154      continue;
    153155    }
     156
    154157    QStringList hlp = line.split(QRegExp("\\s+"), QString::SkipEmptyParts);
     158    QString firstStr = hlp.at(0);
    155159    QString prn;
    156     if (version() >= 3.0) {
    157       prn = hlp.at(0);
     160
     161    if      (version() >= 3.0 &&  firstStr != ">") {
     162      prn = firstStr;
     163    }
     164    else if (version() >= 4.0 && firstStr == ">") {
     165      int lines2skip = 0;
     166      QString key = hlp.at(1);
     167      // EPH is used
     168      if (key == "EPH") {
     169          navTypeStr = hlp.at(3);
     170      }
     171      // all others are currently ignored
     172      else if (key == "STO") {
     173        lines2skip = 2;
     174      }
     175      else if (key == "EOP" || key == "ION") {
     176        lines2skip = 3;
     177      }
     178      if (lines2skip) {
     179        for (int ii = 1; ii < lines2skip; ii++) {
     180          stream->readLine();
     181        }
     182      }
     183      continue;
    158184    }
    159185    else {
     
    213239      }
    214240      eph = new t_ephGPS(version(), lines);
     241    }
     242    else {
     243      continue;
     244    }
     245    if (version() >= 4.0) {
     246      if (eph->setNavType(navTypeStr) != success) {
     247        delete eph;
     248        continue;
     249      }
    215250    }
    216251    _ephs.push_back(eph);
     
    264299//
    265300////////////////////////////////////////////////////////////////////////////
    266 void t_rnxNavFile::writeHeader(const QMap<QString, QString>* txtMap) {
     301void t_rnxNavFile::writeHeader(const QMap<QString, QString>* txtMap, int numMergedFiles, int leapSecs) {
    267302
    268303  QString     runBy = BNC_CORE->userName();
     
    334369           << "PGM / RUN BY / DATE\n";
    335370
     371  if (version() >= 4.0) {
     372    *_stream << QString("%1").arg(leapSecs, 6, 10, QLatin1Char(' ')).left(60).leftJustified(60)
     373        << "LEAP SECONDS\n";
     374
     375    *_stream << QString("%1").arg(numMergedFiles, 19, 10, QLatin1Char(' ')).leftJustified(60)
     376        << "MERGED FILE\n";
     377  }
     378
    336379  QStringListIterator itCmnt(comments);
    337380  while (itCmnt.hasNext()) {
     
    339382  }
    340383
     384
    341385  *_stream << QString()
    342386    .leftJustified(60)
Note: See TracChangeset for help on using the changeset viewer.