Changeset 2519 in ntrip for trunk/BNC/bncgetthread.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/bncgetthread.cpp

    r2518 r2519  
    7575// Constructor 1
    7676////////////////////////////////////////////////////////////////////////////
    77 bncGetThread::bncGetThread(const QByteArray& rawInpFileName,
    78                            const QByteArray& format) {
    79 
    80   _rawInpFile = new QFile(rawInpFileName);
    81   _rawInpFile->open(QIODevice::ReadOnly);
    82   _format     = format;
    83   _staID      = rawInpFileName.mid(
    84                        rawInpFileName.lastIndexOf(QDir::separator())+1,5); 
    85 
    86   _rawOutput = false;
    87 
     77bncGetThread::bncGetThread(bncRawFile* rawFile) {
     78
     79  _rawFile      = rawFile;
     80  _format       = rawFile->format();
     81  _staID        = rawFile->staID();
     82  _rawOutput    = false;
    8883  _ntripVersion = "N";
    8984
     
    9994                           const QByteArray& nmea,
    10095                           const QByteArray& ntripVersion, const QByteArray& extraStaID) {
    101   _rawInpFile   = 0;
     96  _rawFile      = 0;
    10297  _mountPoint   = mountPoint;
    10398  _staID        = (extraStaID.size() == 0 ? mountPoint.path().mid(1).toAscii() : extraStaID);
     
    305300           _format.indexOf("RTCM 3") != -1 ) {
    306301    emit(newMessage(_staID + ": Get data in RTCM 3.x format", true));
    307     bool inputFromFile = false;
    308     if (_rawInpFile != 0) {
    309       inputFromFile = true;
    310     }
    311     _decoder = new RTCM3Decoder(_staID, inputFromFile);
     302    _decoder = new RTCM3Decoder(_staID, bool(_rawFile != 0));
    312303    connect((RTCM3Decoder*) _decoder, SIGNAL(newMessage(QByteArray,bool)),
    313304            this, SIGNAL(newMessage(QByteArray,bool)));
     
    348339  delete _decoder;
    349340  delete _rnx;
    350   delete _rawInpFile;
     341  delete _rawFile;
    351342  delete _serialOutFile;
    352343  delete _serialPort;
     
    395386        _query->waitForReadyRead(data);
    396387      }
    397       else if (_rawInpFile) {
    398         const qint64 maxBytes = 1024;
    399         data = _rawInpFile->read(maxBytes);
    400 
    401         //// beg test
    402         msleep(10);
    403         //// end test
     388      else if (_rawFile) {
     389        data = _rawFile->read();
    404390
    405391        if (data.isEmpty()) {
     
    457443        // Check observation epoch
    458444        // -----------------------
    459         if (!_rawInpFile && !dynamic_cast<gpssDecoder*>(_decoder)) {
     445        if (!_rawFile && !dynamic_cast<gpssDecoder*>(_decoder)) {
    460446          int week;
    461447          double sec;
     
    525511  // Start a new query
    526512  // -----------------
    527   if (!_rawInpFile) {
     513  if (!_rawFile) {
    528514
    529515    sleep(_nextSleep);
Note: See TracChangeset for help on using the changeset viewer.