Changeset 2529 in ntrip


Ignore:
Timestamp:
Aug 3, 2010, 7:43:07 PM (14 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncrawfile.cpp

    r2527 r2529  
    4545using namespace std;
    4646
     47#define RAW_FILE_VERSION "1"
     48
    4749// Constructor
    4850////////////////////////////////////////////////////////////////////////////
     
    6466    QStringList lst  = line.split(' ');
    6567    _version = lst.value(0).toInt();
    66 
    67     line = _inpFile->readLine();
    68     bncApp* app = (bncApp*) qApp;
    69     app->_currentDateAndTimeGPS =
    70                    new QDateTime(QDateTime::fromString(line, Qt::ISODate));
    7168  }
    7269
     
    7673    _outFile = new QFile(_fileName);
    7774    _outFile->open(QIODevice::WriteOnly);
    78     QByteArray header = "1 Version of BNC raw file\n" +
    79                         currentDateAndTimeGPS().toString(Qt::ISODate).toAscii();
    80     _outFile->write(header);
     75    _outFile->write(RAW_FILE_VERSION " Version of BNC raw file");
    8176  }
    8277}
     
    9489                              const QByteArray& format) {
    9590  if (_outFile) {
    96     QString chunkHeader =
    97       QString("\n%1 %2 %3\n").arg(QString(staID)).arg(QString(format)).arg(data.size());
     91    QString chunkHeader = QString("\n%1 %2 %3 %4\n")
     92                 .arg(currentDateAndTimeGPS().toString(Qt::ISODate))
     93                 .arg(QString(staID))
     94                 .arg(QString(format))
     95                 .arg(data.size());
    9896    _outFile->write(chunkHeader.toAscii());
    9997    _outFile->write(data);
     
    113111    QStringList lst  = line.split(' ');
    114112   
    115     _staID  = lst.value(0).toAscii();
    116     _format = lst.value(1).toAscii();
    117     int nBytes = lst.value(2).toInt();
     113    bncApp* app = (bncApp*) qApp;
     114    delete app->_currentDateAndTimeGPS;
     115    app->_currentDateAndTimeGPS =
     116      new QDateTime(QDateTime::fromString(lst.value(0), Qt::ISODate));
     117
     118    _staID  = lst.value(1).toAscii();
     119    _format = lst.value(2).toAscii();
     120    int nBytes = lst.value(3).toInt();
    118121
    119122    data = _inpFile->read(nBytes);
Note: See TracChangeset for help on using the changeset viewer.