Changeset 6455 in ntrip for trunk/BNC/src/rinex


Ignore:
Timestamp:
Dec 27, 2014, 3:58:55 PM (9 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src/rinex
Files:
2 edited

Legend:

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

    r6187 r6455  
    5050t_corrFile::t_corrFile(QString fileName) {
    5151  expandEnvVar(fileName);
    52   _file   = new QFile(fileName);
    53   _file->open(QIODevice::ReadOnly | QIODevice::Text);
    54   _stream = new QTextStream();
    55   _stream->setDevice(_file);
    56   _lastOrbCorr = 0;
    57   _lastClkCorr = 0;
     52  _stream.open(fileName.toAscii().data());
    5853}
    5954
     
    6156////////////////////////////////////////////////////////////////////////////
    6257t_corrFile::~t_corrFile() {
    63   delete _stream;
    64   delete _file;
    6558}
    6659
     
    7265  _clkCorr.clear();
    7366
    74   while (!stopRead(tt) && _stream->status() == QTextStream::Ok && !_stream->atEnd()) {
    75     QString line = _stream->readLine().trimmed();
    76     if (line.isEmpty() || line[0] == '!') {
    77       continue;
    78     }
    79     if      (line[0] == 'O') {
    80       delete _lastOrbCorr; _lastOrbCorr = new t_orbCorr(line.toAscii().data());
    81     }
    82     else if (line[0] == 'C') {
    83       delete _lastClkCorr; _lastClkCorr = new t_clkCorr(line.toAscii().data());
    84     }
     67  while (!stopRead(tt) && _stream.good()) {
    8568    if (stopRead(tt)) {
    8669      break;
     
    10184////////////////////////////////////////////////////////////////////////////
    10285bool t_corrFile::stopRead(const bncTime& tt) {
    103   if (_lastOrbCorr) {
    104     if (_lastOrbCorr->_time > tt) {
    105       return true;
    106     }
    107     else {
    108       _orbCorr.push_back(*_lastOrbCorr);
    109       _corrIODs[QString(_lastOrbCorr->_prn.toString().c_str())] = _lastOrbCorr->_iod;
    110       delete _lastOrbCorr; _lastOrbCorr = 0;
    111     }
    112   }
    113   if (_lastClkCorr) {
    114     if (_lastClkCorr->_time > tt) {
    115       return true;
    116     }
    117     else {
    118       _clkCorr.push_back(*_lastClkCorr);
    119       _corrIODs[QString(_lastClkCorr->_prn.toString().c_str())] = _lastClkCorr->_iod;
    120       delete _lastClkCorr; _lastClkCorr = 0;
    121     }
    122   }
    123   return false;
     86  return true;
    12487}
  • trunk/BNC/src/rinex/corrfile.h

    r6183 r6455  
    2626#define CORRFILE_H
    2727
     28#include <fstream>
    2829#include <QtCore>
    2930#include "bncconst.h"
     
    4647 private:
    4748  bool stopRead(const bncTime& tt);
    48   QFile*             _file;
    49   QTextStream*       _stream;
     49  std::fstream       _stream;
    5050  QList<t_orbCorr>   _orbCorr;
    5151  QList<t_clkCorr>   _clkCorr;
    52   t_orbCorr*         _lastOrbCorr;
    53   t_clkCorr*         _lastClkCorr;
    5452  QMap<QString, int> _corrIODs;
    5553};
Note: See TracChangeset for help on using the changeset viewer.