Changeset 3746 in ntrip for trunk/BNC/rinex
- Timestamp:
- Mar 30, 2012, 10:51:20 AM (13 years ago)
- Location:
- trunk/BNC/rinex
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/BNC/rinex/rnxnavfile.cpp ¶
r3721 r3746 88 88 t_rnxNavFile::t_rnxNavFile(QString fileName) { 89 89 expandEnvVar(fileName); 90 _file = new QFile(fileName); 91 _file->open(QIODevice::ReadOnly | QIODevice::Text); 92 _stream = new QTextStream(); 93 _stream->setDevice(_file); 94 _header.read(_stream); 90 QFile* file = new QFile(fileName); 91 file->open(QIODevice::ReadOnly | QIODevice::Text); 92 QTextStream* stream = new QTextStream(); 93 stream->setDevice(file); 94 _header.read(stream); 95 this->read(stream); 96 delete stream; 97 delete file; 95 98 } 96 99 … … 98 101 //////////////////////////////////////////////////////////////////////////// 99 102 t_rnxNavFile::~t_rnxNavFile() { 100 delete _stream;101 delete _file;102 103 } 103 104 104 // Read Next Ephemeris105 // Read File Content 105 106 //////////////////////////////////////////////////////////////////////////// 106 t_eph*t_rnxNavFile::getNextEph() {107 void t_rnxNavFile::read(QTextStream* stream) { 107 108 108 t_eph* eph = 0; 109 110 while (_stream->status() == QTextStream::Ok && !_stream->atEnd()) { 111 QString line = _stream->readLine(); 109 while (stream->status() == QTextStream::Ok && !stream->atEnd()) { 110 QString line = stream->readLine(); 112 111 if (line.isEmpty()) { 113 112 continue; … … 126 125 } 127 126 } 127 t_eph* eph = 0; 128 128 QStringList lines; lines << line; 129 129 if (prn[0] == 'G') { 130 130 for (int ii = 1; ii < 8; ii++) { 131 lines << _stream->readLine();131 lines << stream->readLine(); 132 132 } 133 133 eph = new t_ephGPS(version(), lines); … … 135 135 else if (prn[0] == 'R') { 136 136 for (int ii = 1; ii < 4; ii++) { 137 lines << _stream->readLine();137 lines << stream->readLine(); 138 138 } 139 139 eph = new t_ephGlo(version(), lines); … … 141 141 else if (prn[0] == 'E') { 142 142 for (int ii = 1; ii < 8; ii++) { 143 lines << _stream->readLine();143 lines << stream->readLine(); 144 144 } 145 145 eph = new t_ephGal(version(), lines); 146 146 } 147 147 if (eph && eph->ok()) { 148 // ColumnVector xc(4); 149 // ColumnVector vv(3); 150 // eph->position(eph->GPSweek(), eph->GPSweeks(), xc.data(), vv.data()); 151 // cout << eph->prn().toAscii().data() << " " << xc.t(); 152 return eph; 148 _ephs.push(eph); 149 } 150 else { 151 delete eph; 153 152 } 154 153 } 154 } 155 155 156 delete eph; 156 // Read Next Ephemeris 157 //////////////////////////////////////////////////////////////////////////// 158 t_eph* t_rnxNavFile::getNextEph() { 159 if (!_ephs.empty()) { 160 t_eph* eph = _ephs.front(); 161 _ephs.pop(); 162 return eph; 163 } 157 164 return 0; 158 165 } -
TabularUnified trunk/BNC/rinex/rnxnavfile.h ¶
r3721 r3746 26 26 #define RNXNAVFILE_H 27 27 28 #include <queue> 28 29 #include <QtCore> 29 30 #include "bncconst.h" … … 55 56 56 57 private: 57 t_rnxNavHeader _header;58 QFile* _file;59 QTextStream* _stream;58 void read(QTextStream* stream); 59 std::queue<t_eph*> _ephs; 60 t_rnxNavHeader _header; 60 61 }; 61 62
Note:
See TracChangeset
for help on using the changeset viewer.