Changeset 10630 in ntrip for trunk/BNC


Ignore:
Timestamp:
Mar 17, 2025, 5:01:45 PM (2 days ago)
Author:
stuerze
Message:

minor changes

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

Legend:

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

    r10614 r10630  
    6464  _logFileName     = settings.value("reqcOutLogFile").toString(); expandEnvVar(_logFileName);
    6565  _logFile         = 0;
    66   _log             = 0;
     66  _logStream       = 0;
    6767  _currEpo         = 0;
    6868  _obsFileNames    = settings.value("reqcObsFile").toString().split(",", Qt::SkipEmptyParts);
     
    9595    delete _ephs[ii];
    9696  }
    97   delete _log;     _log    = 0;
     97  delete _logStream; _logStream = 0;
    9898  delete _logFile; _logFile = 0;
    9999  if (BNC_CORE->mode() != t_bncCore::interactive) {
     
    114114    _logFile = new QFile(_logFileName);
    115115    if (_logFile->open(QIODevice::WriteOnly | QIODevice::Text)) {
    116       _log = new QTextStream();
    117       _log->setDevice(_logFile);
    118     }
    119   }
    120 
    121   if (_log) {
    122     *_log << "QC Format Version  : " << QString("%1").arg(QC_FORMAT_VERSION,3,'f',1)  << Qt::endl << Qt::endl;
     116      _logStream = new QTextStream();
     117      _logStream->setDevice(_logFile);
     118    }
     119  }
     120
     121  if (_logStream) {
     122    *_logStream << "QC Format Version  : " << QString("%1").arg(QC_FORMAT_VERSION,3,'f',1)  << Qt::endl << Qt::endl;
    123123  }
    124124
    125125  // Initialize RINEX Observation Files
    126126  // ----------------------------------
    127   t_reqcEdit::initRnxObsFiles(_obsFileNames, _rnxObsFiles, _log);
     127  t_reqcEdit::initRnxObsFiles(_obsFileNames, _rnxObsFiles, _logStream);
    128128
    129129  // Read Ephemerides
    130130  // ----------------
    131   t_reqcEdit::readEphemerides(_navFileNames, _ephs, _log, _checkEph);
     131  t_reqcEdit::readEphemerides(_navFileNames, _ephs, _logStream, _checkEph);
    132132
    133133  // Loop over all RINEX Files
     
    225225  }
    226226  catch (QString str) {
    227     if (_log) {
    228       *_log << "Exception " << str << Qt::endl;
     227    if (_logStream) {
     228      *_logStream << "Exception " << str << Qt::endl;
    229229    }
    230230    else {
     
    733733void t_reqcAnalyze::printReport(const t_rnxObsFile* obsFile) {
    734734
    735   if (!_log) {
     735  if (!_logStream) {
    736736    return;
    737737  }
     
    742742  // Summary
    743743  // -------
    744   *_log << "Observation File   : " << obsFileName                                   << Qt::endl
     744  *_logStream << "Observation File   : " << obsFileName                                   << Qt::endl
    745745        << "RINEX Version      : " << QString("%1").arg(obsFile->version(),4,'f',2) << Qt::endl
    746746        << "Marker Name        : " << _qcFile._markerName                           << Qt::endl
     
    766766    char sys = obsFile->system(iSys);
    767767    if (sys != ' ') {
    768       *_log << "Observation Types " << sys << ":";
     768      *_logStream << "Observation Types " << sys << ":";
    769769      for (int iType = 0; iType < obsFile->nTypes(sys); iType++) {
    770770        QString type = obsFile->obsType(sys, iType);
    771         *_log << " " << type;
    772       }
    773       *_log << Qt::endl;
     771        *_logStream << " " << type;
     772      }
     773      *_logStream << Qt::endl;
    774774    }
    775775  }
     
    785785    systemMap[prn.system()].push_back(&qcSatSum);
    786786  }
    787   *_log << "Analysed GNSS      : " << systemMap.size() << "   ";
     787  *_logStream << "Analysed GNSS      : " << systemMap.size() << "   ";
    788788  QMapIterator<QChar, QVector<const t_qcSatSum*> > itSys(systemMap);
    789789  while (itSys.hasNext()) {
    790790    itSys.next();
    791     *_log << ' ' << itSys.key();
    792   }
    793   *_log << Qt::endl;
     791    *_logStream << ' ' << itSys.key();
     792  }
     793  *_logStream << Qt::endl;
    794794
    795795
     
    819819      }
    820820    }
    821     *_log << Qt::endl
     821    *_logStream << Qt::endl
    822822          << prefixSys << "Satellites: " << qcSatVec.size() << Qt::endl
    823823          << prefixSys << "Signals   : " << frqMap.size() << "   ";
     
    826826      itFrq.next();
    827827      QString frqType = itFrq.key(); if (frqType.length() < 2) frqType += '?';
    828       *_log << ' ' << frqType;
    829     }
    830     *_log << Qt::endl;
     828      *_logStream << ' ' << frqType;
     829    }
     830    *_logStream << Qt::endl;
    831831    QString prefixSys2 = "    " + prefixSys;
    832832    itFrq.toFront();
     
    864864      double ratio = (double(numObs) / double(numExpectedObs)) * 100.0;
    865865
    866       *_log << Qt::endl
     866      *_logStream << Qt::endl
    867867            << prefixSys2 << prefixFrq << "Observations      : ";
    868868      if(_navFileNames.isEmpty() || numExpectedObs == 0.0  || _navFileIncomplete.contains(sys.toLatin1())) {
    869         *_log << QString("%1\n").arg(numObs,           6);
     869        *_logStream << QString("%1\n").arg(numObs,           6);
    870870      }
    871871      else {
    872         *_log << QString("%1 (%2) %3 \%\n").arg(numObs,           6).arg(numExpectedObs,           8).arg(ratio, 8, 'f', 2);
    873       }
    874       *_log << prefixSys2 << prefixFrq << "Slips (file+found): " << QString("%1 +").arg(numSlipsFlagged,  8)
     872        *_logStream << QString("%1 (%2) %3 \%\n").arg(numObs,           6).arg(numExpectedObs,           8).arg(ratio, 8, 'f', 2);
     873      }
     874      *_logStream << prefixSys2 << prefixFrq << "Slips (file+found): " << QString("%1 +").arg(numSlipsFlagged,  8)
    875875                                                                 << QString("%1\n").arg(numSlipsFound,    8)
    876876            << prefixSys2 << prefixFrq << "Gaps              : " << QString("%1\n").arg(numGaps,          8)
     
    886886    return;
    887887  }
    888   *_log << Qt::endl;
     888  *_logStream << Qt::endl;
    889889  for (int iEpo = 0; iEpo < _qcFile._qcEpo.size(); iEpo++) {
    890890    const t_qcEpo& qcEpo = _qcFile._qcEpo[iEpo];
     
    904904      .arg(sec,  11, 'f', 7);
    905905
    906     *_log << dateStr << QString(" %1").arg(qcEpo._qcSat.size(), 2)
     906    *_logStream << dateStr << QString(" %1").arg(qcEpo._qcSat.size(), 2)
    907907          << QString(" %1").arg(qcEpo._PDOP, 4, 'f', 1)
    908908          << Qt::endl;
     
    914914      const t_qcSat& qcSat = itSat.value();
    915915
    916       *_log << prn.toString().c_str()
     916      *_logStream << prn.toString().c_str()
    917917            << QString(" %1 %2").arg(qcSat._eleDeg, 6, 'f', 2).arg(qcSat._azDeg, 7, 'f', 2);
    918918
     
    927927        }
    928928      }
    929       *_log << QString("  %1").arg(numObsTypes, 2);
     929      *_logStream << QString("  %1").arg(numObsTypes, 2);
    930930
    931931      for (int iFrq = 0; iFrq < qcSat._qcFrq.size(); iFrq++) {
    932932        const t_qcFrq& qcFrq = qcSat._qcFrq[iFrq];
    933933        if (qcFrq._phaseValid) {
    934           *_log << "  L" << qcFrq._rnxType2ch << ' ';
     934          *_logStream << "  L" << qcFrq._rnxType2ch << ' ';
    935935          if (qcFrq._slip) {
    936             *_log << 's';
     936            *_logStream << 's';
    937937          }
    938938          else {
    939             *_log << '.';
     939            *_logStream << '.';
    940940          }
    941941          if (qcFrq._gap) {
    942             *_log << 'g';
     942            *_logStream << 'g';
    943943          }
    944944          else {
    945             *_log << '.';
    946           }
    947           *_log << QString(" %1").arg(qcFrq._SNR,   4, 'f', 1);
     945            *_logStream << '.';
     946          }
     947          *_logStream << QString(" %1").arg(qcFrq._SNR,   4, 'f', 1);
    948948        }
    949949        if (qcFrq._codeValid) {
    950           *_log << "  C" << qcFrq._rnxType2ch << ' ';
     950          *_logStream << "  C" << qcFrq._rnxType2ch << ' ';
    951951          if (qcFrq._gap) {
    952             *_log << " g";
     952            *_logStream << " g";
    953953          }
    954954          else {
    955             *_log << " .";
    956           }
    957           *_log << QString(" %1").arg(qcFrq._stdMP, 3, 'f', 2);
    958         }
    959       }
    960       *_log << Qt::endl;
    961     }
    962   }
    963   _log->flush();
     955            *_logStream << " .";
     956          }
     957          *_logStream << QString(" %1").arg(qcFrq._stdMP, 3, 'f', 2);
     958        }
     959      }
     960      *_logStream << Qt::endl;
     961    }
     962  }
     963  _logStream->flush();
    964964}
    965965
  • trunk/BNC/src/rinex/reqcanalyze.h

    r10614 r10630  
    204204  QString                    _logFileName;
    205205  QFile*                     _logFile;
    206   QTextStream*               _log;
     206  QTextStream*               _logStream;
    207207  bool                       _checkEph;
    208208  QStringList                _obsFileNames;
  • trunk/BNC/src/rinex/reqcedit.cpp

    r10619 r10630  
    5757  _logFileName    = settings.value("reqcOutLogFile").toString(); expandEnvVar(_logFileName);
    5858  _logFile        = 0;
    59   _log            = 0;
     59  _logStream      = 0;
    6060  _obsFileNames   = settings.value("reqcObsFile").toString().split(",", Qt::SkipEmptyParts);
    6161  _outObsFileName = settings.value("reqcOutObsFile").toString();
     
    8989    delete _ephs[ii];
    9090  }
    91   delete _log;     _log     = 0;
     91  delete _logStream; _logStream     = 0;
    9292  delete _logFile; _logFile = 0;
    9393}
     
    102102    _logFile = new QFile(_logFileName);
    103103    if (_logFile->open(QIODevice::WriteOnly | QIODevice::Text)) {
    104       _log = new QTextStream();
    105       _log->setDevice(_logFile);
     104      _logStream = new QTextStream();
     105      _logStream->setDevice(_logFile);
    106106    }
    107107  }
     
    109109  // Log File Header
    110110  // ---------------
    111   if (_log) {
    112     *_log << QByteArray(78, '-') << Qt::endl;
    113     *_log << "RINEX File Editing\n";
    114     *_log << QByteArray(78, '-') << Qt::endl;
    115 
    116     *_log << QByteArray("Program").leftJustified(15) << ": "
     111  if (_logStream) {
     112    *_logStream << QByteArray(78, '-') << Qt::endl;
     113    *_logStream << "RINEX File Editing\n";
     114    *_logStream << QByteArray(78, '-') << Qt::endl;
     115
     116    *_logStream << QByteArray("Program").leftJustified(15) << ": "
    117117          << BNC_CORE->pgmName() << Qt::endl;
    118     *_log << QByteArray("Run by").leftJustified(15) << ": "
     118    *_logStream << QByteArray("Run by").leftJustified(15) << ": "
    119119          << BNC_CORE->userName() << Qt::endl;
    120     *_log << QByteArray("Date").leftJustified(15) << ": "
     120    *_logStream << QByteArray("Date").leftJustified(15) << ": "
    121121          << QDateTime::currentDateTime().toUTC().toString("yyyy-MM-dd hh:mm:ss") << Qt::endl;
    122     *_log << QByteArray("RINEX Version").leftJustified(15) << ": "
     122    *_logStream << QByteArray("RINEX Version").leftJustified(15) << ": "
    123123          << _rnxVersion << Qt::endl;
    124     *_log << QByteArray("Sampling").leftJustified(15) << ": "
     124    *_logStream << QByteArray("Sampling").leftJustified(15) << ": "
    125125          << _samplingRate << " sec" << Qt::endl;
    126     *_log << QByteArray("Start time").leftJustified(15) << ": "
     126    *_logStream << QByteArray("Start time").leftJustified(15) << ": "
    127127          << _begTime.datestr().c_str() << ' '
    128128          << _begTime.timestr(0).c_str() << Qt::endl;
    129     *_log << QByteArray("End time").leftJustified(15) << ": "
     129    *_logStream << QByteArray("End time").leftJustified(15) << ": "
    130130          << _endTime.datestr().c_str() << ' '
    131131          << _endTime.timestr(0).c_str() << Qt::endl;
    132     *_log << QByteArray("Input Obs Files").leftJustified(15) << ": "
     132    *_logStream << QByteArray("Input Obs Files").leftJustified(15) << ": "
    133133          << _obsFileNames.join(",") << Qt::endl;
    134     *_log << QByteArray("Input Nav Files").leftJustified(15) << ": "
     134    *_logStream << QByteArray("Input Nav Files").leftJustified(15) << ": "
    135135          << _navFileNames.join(",") << Qt::endl;
    136     *_log << QByteArray("Output Obs File").leftJustified(15) << ": "
     136    *_logStream << QByteArray("Output Obs File").leftJustified(15) << ": "
    137137          << _outObsFileName << Qt::endl;
    138     *_log << QByteArray("Output Nav File").leftJustified(15) << ": "
     138    *_logStream << QByteArray("Output Nav File").leftJustified(15) << ": "
    139139          << _outNavFileName << Qt::endl;
    140140
    141     *_log << QByteArray(78, '-') << Qt::endl;
    142     _log->flush();
     141    *_logStream << QByteArray(78, '-') << Qt::endl;
     142    _logStream->flush();
    143143  }
    144144
     
    221221  }
    222222
    223   t_reqcEdit::initRnxObsFiles(_obsFileNames, _rnxObsFiles, _log);
     223  t_reqcEdit::initRnxObsFiles(_obsFileNames, _rnxObsFiles, _logStream);
    224224
    225225  // Initialize output observation file
     
    318318  for (int ii = 0; ii < _rnxObsFiles.size(); ii++) {
    319319    t_rnxObsFile* obsFile = _rnxObsFiles[ii];
    320     if (_log) {
    321       *_log << "Input Obs File: " << obsFile->fileName() << "  start: "
     320    if (_logStream) {
     321      *_logStream << "Input Obs File: " << obsFile->fileName() << "  start: "
    322322            << obsFile->startTime().datestr().c_str() << ' '
    323323            << obsFile->startTime().timestr(0).c_str() << Qt::endl;
     
    369369    }
    370370    catch (QString str) {
    371       if (_log) {
    372         *_log << "Exception " << str << Qt::endl;
     371      if (_logStream) {
     372        *_logStream << "Exception " << str << Qt::endl;
    373373      }
    374374      else {
     
    378378    }
    379379    catch (...) {
    380       if (_log) {
    381         *_log << "Exception unknown" << Qt::endl;
     380      if (_logStream) {
     381        *_logStream << "Exception unknown" << Qt::endl;
    382382      }
    383383      else {
     
    586586  // Read Ephemerides
    587587  // ----------------
    588   t_reqcEdit::readEphemerides(_navFileNames, _ephs, _log, _checkEph);
     588  t_reqcEdit::readEphemerides(_navFileNames, _ephs, _logStream, _checkEph);
    589589
    590590  // Check Satellite Systems
     
    796796          if (log) {
    797797            *log << "                   : "
    798                  << QString("WRONG %2:%3\n")
     798                 << QString("WRONG     %2:%3\n")
    799799                         .arg(eph->typeStr(eph->type(), eph->prn(), 99.0))
    800800                         .arg(eph->rinexDateStr(eph->TOC(), eph->prn(), 99.0)).toLatin1();
    801801          }
    802         }
     802        }/* switched off because of to many SBAS satellites are set to unhealthy
     803        if (eph->checkState() == t_eph::unhealthy) {
     804          if (log) {
     805            *log << "                   : "
     806                 << QString("UNHEALTHY %2:%3\n")
     807                         .arg(eph->typeStr(eph->type(), eph->prn(), 99.0))
     808                         .arg(eph->rinexDateStr(eph->TOC(), eph->prn(), 99.0)).toLatin1();
     809          }
     810        }*/
    803811      }
    804812    }
  • trunk/BNC/src/rinex/reqcedit.h

    r10614 r10630  
    5151                              QTextStream* log);
    5252  static void readEphemerides(const QStringList& navFileNames,
    53                               QVector<t_eph*>& ephs, QTextStream* log, 
     53                              QVector<t_eph*>& ephs, QTextStream* log,
    5454                              bool checkEph);
    55   static void appendEphemerides(const QString& fileName, 
     55  static void appendEphemerides(const QString& fileName,
    5656                                QVector<t_eph*>& ephs,
    5757                                QTextStream* log, bool checkEph);
     
    6767  QString                _logFileName;
    6868  QFile*                 _logFile;
    69   QTextStream*           _log;
     69  QTextStream*           _logStream;
    7070  bool                   _checkEph;
    7171  QStringList            _obsFileNames;
Note: See TracChangeset for help on using the changeset viewer.