Changeset 2519 in ntrip for trunk/BNC/bncapp.cpp


Ignore:
Timestamp:
Aug 3, 2010, 12:10:19 PM (14 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncapp.cpp

    r2518 r2519  
    6060  _logStream   = 0;
    6161  _caster      = 0;
    62   _rawOutFile  = 0;
     62  _rawFile     = 0;
    6363
    6464  // Lists of Ephemeris
     
    129129  delete _currentDateAndTimeGPS;
    130130
    131   delete _rawOutFile;
     131  delete _rawFile;
    132132}
    133133
     
    713713  QMutexLocker locker(&_mutex);
    714714
    715   if (!_rawOutFile) {
     715  if (!_rawFile) {
    716716    bncSettings settings;
    717     QString rawOutFileName = settings.value("rawOutFile").toString();
    718     if (!rawOutFileName.isEmpty()) {
    719       _rawOutFile = new QFile(rawOutFileName);
    720       _rawOutFile->open(QIODevice::WriteOnly);
    721 
    722       QByteArray header =
    723         "1 Version of BNC raw file\n" +
    724         currentDateAndTimeGPS().toString(Qt::ISODate).toAscii();
    725 
    726       _rawOutFile->write(header);
    727     }
    728   }
    729 
    730   if (_rawOutFile) {
    731     QString chunkHeader =
    732       QString("\n%1 %2 %3\n").arg(QString(staID)).arg(QString(format)).arg(data.size());
    733     _rawOutFile->write(chunkHeader.toAscii());
    734     _rawOutFile->write(data);
    735     _rawOutFile->flush();
    736   }
    737 }
     717    QByteArray fileName = settings.value("rawOutFile").toByteArray();
     718    if (!fileName.isEmpty()) {
     719      _rawFile = new bncRawFile(fileName, format, bncRawFile::output);
     720    }
     721  }
     722
     723  if (_rawFile) {
     724    _rawFile->writeRawData(data, staID, format);
     725  }
     726}
Note: See TracChangeset for help on using the changeset viewer.