Changeset 2035 in ntrip for trunk/BNC/bncgetthread.cpp


Ignore:
Timestamp:
Nov 26, 2009, 2:22:40 PM (14 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncgetthread.cpp

    r2032 r2035  
    6363#include "bncsettings.h"
    6464#include "latencychecker.h"
    65 #include "bncpppthread.h"
     65#include "bncpppclient.h"
    6666
    6767#include "RTCM/RTCM2Decoder.h"
     
    123123  _nextSleep     = 0;
    124124  _rawOutFile    = 0;
    125   _PPPthread     = 0;
     125  _PPPclient     = 0;
    126126
    127127  bncSettings settings;
     
    284284  // _rawOutFile->open(QIODevice::WriteOnly);
    285285
    286   // Initialize PPP Clinet?
     286  // Initialize PPP Client?
    287287  // ----------------------
    288   bool pppClient = false;
    289288  if (settings.value("pppMount").toString() == _staID) {
    290     pppClient = true;
     289    _PPPclient = new bncPPPclient(_staID);
     290    connect(((bncApp*)qApp), SIGNAL(newEphGPS(gpsephemeris)),
     291            _PPPclient, SLOT(slotNewEphGPS(gpsephemeris)));
     292    connect(((bncApp*)qApp), SIGNAL(newCorrections(QList<QString>)),
     293            _PPPclient, SLOT(slotNewCorrections(QList<QString>)));
    291294  }
    292295
     
    297300    emit(newMessage(_staID + ": Get data in RTCM 2.x format", true));
    298301    _decoder = new RTCM2Decoder(_staID.data());
    299     if (pppClient) {
    300       _PPPthread = new bncPPPthread(_staID);
    301     }
    302302  }
    303303  else if (_format.indexOf("RTCM_3") != -1 || _format.indexOf("RTCM3") != -1 ||
     
    307307    connect((RTCM3Decoder*) _decoder, SIGNAL(newMessage(QByteArray,bool)),
    308308            this, SIGNAL(newMessage(QByteArray,bool)));
    309     if (pppClient) {
    310       _PPPthread = new bncPPPthread(_staID);
    311     }
    312309  }
    313310  else if (_format.indexOf("RTIGS") != -1) {
    314311    emit(newMessage(_staID + ": Get data in RTIGS format", true));
    315312    _decoder = new RTIGSDecoder();
    316     if (pppClient) {
    317       _PPPthread = new bncPPPthread(_staID);
    318     }
    319313  }
    320314  else if (_format.indexOf("GPSS") != -1 || _format.indexOf("BNC") != -1) {
     
    333327  _latencyChecker = new latencyChecker(_staID);
    334328
    335   if (_PPPthread) {
    336     connect(((bncApp*)qApp), SIGNAL(newEphGPS(gpsephemeris)),
    337             _PPPthread, SLOT(slotNewEphGPS(gpsephemeris)));
    338     connect(((bncApp*)qApp), SIGNAL(newCorrections(QList<QString>)),
    339             _PPPthread, SLOT(slotNewCorrections(QList<QString>)));
    340     ////    _PPPthread->start();  // currently processing in the same thread
    341   }
    342 
    343329  msleep(100); //sleep 0.1 sec
    344330}
     
    347333////////////////////////////////////////////////////////////////////////////
    348334bncGetThread::~bncGetThread() {
    349 
    350   if (_PPPthread) {
    351     _PPPthread->terminate();
    352   }
    353 
    354335  if (isRunning()) {
    355336    wait();
    356337  }
    357 
    358338  if (_query) {
    359339    _query->stop();
    360340    _query->deleteLater();
    361341  }
     342  delete _PPPclient;
    362343  delete _decoder;
    363344  delete _rnx;
     
    501482        // PPP Client
    502483        // ----------
    503         if (_PPPthread) {
    504           _PPPthread->putNewObs(obs);
     484        if (_PPPclient) {
     485          _PPPclient->putNewObs(obs);
    505486        }
    506487
Note: See TracChangeset for help on using the changeset viewer.