Changeset 3690 in ntrip
- Timestamp:
- Feb 12, 2012, 2:27:04 PM (13 years ago)
- Location:
- trunk/BNC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/corrfile.cpp
r3689 r3690 66 66 void t_corrFile::syncRead(const bncTime& tt) { 67 67 68 QList<QString> corrs; 68 69 70 if (!_lastLine.isEmpty() && !stopRead(tt)) { 71 corrs << _lastLine; 72 } 73 74 while (_stream->status() == QTextStream::Ok && !_stream->atEnd()) { 75 QString line = _stream->readLine(); 76 if (line.isEmpty() || line[0] == '!') { 77 continue; 78 } 79 _lastLine = line; 80 81 if (stopRead(tt)) { 82 if (corrs.size()) { 83 emit newCorrections(corrs); 84 } 85 } 86 else { 87 corrs << _lastLine; 88 } 89 } 69 90 } 91 92 // Read till a given time 93 //////////////////////////////////////////////////////////////////////////// 94 bool t_corrFile::stopRead(const bncTime& tt) { 95 96 if (_lastLine.isEmpty()) { 97 return false; 98 } 99 100 QTextStream in(_lastLine.toAscii(), QIODevice::ReadOnly); 101 int messageType, updateInterval, GPSweek; 102 double GPSweeks; 103 in >> messageType >> updateInterval >> GPSweek >> GPSweeks; 104 105 bncTime tNew(GPSweek, GPSweeks); 106 107 if (tNew >= tt) { 108 return true; 109 } 110 else { 111 return false; 112 } 113 } -
trunk/BNC/corrfile.h
r3689 r3690 42 42 43 43 private: 44 QFile* _file; 45 QTextStream* _stream; 44 bool stopRead(const bncTime& tt); 45 QFile* _file; 46 QTextStream* _stream; 47 QString _lastLine; 46 48 }; 47 49
Note:
See TracChangeset
for help on using the changeset viewer.