Changeset 6455 in ntrip for trunk/BNC/src/rinex
- Timestamp:
- Dec 27, 2014, 3:58:55 PM (10 years ago)
- Location:
- trunk/BNC/src/rinex
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/rinex/corrfile.cpp
r6187 r6455 50 50 t_corrFile::t_corrFile(QString fileName) { 51 51 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()); 58 53 } 59 54 … … 61 56 //////////////////////////////////////////////////////////////////////////// 62 57 t_corrFile::~t_corrFile() { 63 delete _stream;64 delete _file;65 58 } 66 59 … … 72 65 _clkCorr.clear(); 73 66 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()) { 85 68 if (stopRead(tt)) { 86 69 break; … … 101 84 //////////////////////////////////////////////////////////////////////////// 102 85 bool 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; 124 87 } -
trunk/BNC/src/rinex/corrfile.h
r6183 r6455 26 26 #define CORRFILE_H 27 27 28 #include <fstream> 28 29 #include <QtCore> 29 30 #include "bncconst.h" … … 46 47 private: 47 48 bool stopRead(const bncTime& tt); 48 QFile* _file; 49 QTextStream* _stream; 49 std::fstream _stream; 50 50 QList<t_orbCorr> _orbCorr; 51 51 QList<t_clkCorr> _clkCorr; 52 t_orbCorr* _lastOrbCorr;53 t_clkCorr* _lastClkCorr;54 52 QMap<QString, int> _corrIODs; 55 53 };
Note:
See TracChangeset
for help on using the changeset viewer.