Changeset 2523 in ntrip
- Timestamp:
- Aug 3, 2010, 1:13:59 PM (15 years ago)
- Location:
- trunk/BNC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/BNC/bncgetthread.cpp ¶
r2519 r2523 387 387 } 388 388 else if (_rawFile) { 389 data = _rawFile->read(); 389 data = _rawFile->readChunk(); 390 390 391 391 if (data.isEmpty()) { -
TabularUnified trunk/BNC/bncrawfile.cpp ¶
r2522 r2523 52 52 _format = format; 53 53 _staID = fileName.mid(fileName.lastIndexOf(QDir::separator())+1,5); 54 _inp OutFlag = ioFlg;54 _inpFile = 0; 55 55 _outFile = 0; 56 _version = 0; 56 57 57 // Initialize 58 // ---------- 59 if (_inpOutFlag == input) { 58 // Initialize for Input 59 // -------------------- 60 if (ioFlg == input) { 61 _inpFile = new QFile(_fileName); 62 _inpFile->open(QIODevice::ReadOnly); 63 QString line = _inpFile->readLine(); 64 QStringList lst1 = line.split(' '); 65 _version = lst1.value(0).toInt(); 66 67 line = _inpFile->readLine(); 60 68 bncApp* app = (bncApp*) qApp; 61 // TODO: set date and time 69 app->_currentDateAndTimeGPS = 70 new QDateTime(QDateTime::fromString(line, Qt::ISODate)); 71 } 72 73 // Initialize for Output 74 // --------------------- 75 else { 76 _outFile = new QFile(_fileName); 77 _outFile->open(QIODevice::WriteOnly); 78 QByteArray header = "1 Version of BNC raw file\n" + 79 currentDateAndTimeGPS().toString(Qt::ISODate).toAscii(); 80 _outFile->write(header); 62 81 } 63 82 } … … 73 92 void bncRawFile::writeRawData(const QByteArray& data, const QByteArray& staID, 74 93 const QByteArray& format) { 75 76 if ( !_outFile && !_fileName.isEmpty() ) {77 _outFile = new QFile(_fileName);78 _outFile->open(QIODevice::WriteOnly);79 QByteArray header = "1 Version of BNC raw file\n" +80 currentDateAndTimeGPS().toString(Qt::ISODate).toAscii();81 _outFile->write(header);82 }83 84 94 if (_outFile) { 85 95 QString chunkHeader = … … 94 104 // Raw Input 95 105 //////////////////////////////////////////////////////////////////////////// 96 QByteArray bncRawFile::read() { 106 QByteArray bncRawFile::readChunk() { 97 107 98 108 return ""; -
TabularUnified trunk/BNC/bncrawfile.h ¶
r2520 r2523 43 43 QByteArray format() const {return _format;} 44 44 QByteArray staID() const {return _staID;} 45 QByteArray read(); 45 QByteArray readChunk(); 46 46 void writeRawData(const QByteArray& data, const QByteArray& staID, 47 47 const QByteArray& format); … … 50 50 QByteArray _format; 51 51 QByteArray _staID; 52 QFile* _inpFile; 52 53 QFile* _outFile; 53 in pOutFlag _inpOutFlag; // whether used for input or output54 int _version; 54 55 }; 55 56 #endif
Note:
See TracChangeset
for help on using the changeset viewer.