Changeset 5905 in ntrip for trunk/BNC/src/PPP


Ignore:
Timestamp:
Aug 9, 2014, 11:45:37 AM (10 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src/PPP
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/PPP/pppMain.cpp

    r5900 r5905  
    6262//
    6363//////////////////////////////////////////////////////////////////////////////
    64 void t_pppMain::start() {
     64void t_pppMain::start(bool ownThread) {
    6565  if (_running) {
    6666    return;
     
    7373    while (iOpt.hasNext()) {
    7474      const t_pppOptions* opt = iOpt.next();
    75       t_pppThread* pppThread = new t_pppThread(opt);
    76       pppThread->start();
     75      t_pppThread* pppThread = new t_pppThread(ownThread, opt);
     76      if (ownThread) {
     77        cout << "start" << endl;
     78        pppThread->start();
     79      }
     80      else {
     81        cout << "run" << endl;
     82        pppThread->run();
     83      }
    7784      _pppThreads << pppThread;
    7885      _running = true;
  • trunk/BNC/src/PPP/pppMain.h

    r5900 r5905  
    1010class t_pppMain {
    1111 public:
    12   t_pppMain();                                                     
     12  t_pppMain();
    1313  ~t_pppMain();
    14   void start();                                                     
    15   void stop();                                                     
     14  void start(bool ownThread);
     15  void stop();
    1616
    1717 private:
     
    2020  QList<t_pppOptions*> _options;
    2121  QList<t_pppThread*>  _pppThreads;
    22   QString              _logFile;
    23   QString              _nmeaFile;
    24   int                  _nmeaPort;
    25   bool                 _running;
     22  QString  _logFile;
     23  QString  _nmeaFile;
     24  int      _nmeaPort;
     25  bool     _running;
    2626};
    2727
  • trunk/BNC/src/PPP/pppThread.cpp

    r5904 r5905  
    5555// Constructor
    5656////////////////////////////////////////////////////////////////////////////
    57 t_pppThread::t_pppThread(const t_pppOptions* opt) : QThread(0) {
    58   _opt    = opt;
    59   _pppRun = 0;
     57t_pppThread::t_pppThread(bool ownThread, const t_pppOptions* opt) : QThread(0) {
     58
     59  _ownThread = ownThread;
     60  _opt       = opt;
     61  _pppRun    = 0;
    6062
    6163  connect(this, SIGNAL(finished()), this, SLOT(deleteLater()));
     
    7981    _pppRun = new t_pppRun(_opt);
    8082    if (_opt->_realTime) {
    81       QThread::exec();
     83      if (_ownThread) {
     84        QThread::exec();
     85      }
    8286    }
    8387    else {
  • trunk/BNC/src/PPP/pppThread.h

    r5891 r5905  
    1616 Q_OBJECT
    1717 public:
    18   t_pppThread(const t_pppOptions* opt);
     18  t_pppThread(bool ownThread, const t_pppOptions* opt);
    1919  ~t_pppThread();
    2020  virtual void run();
     
    2525
    2626 private:
     27  bool                _ownThread;
    2728  const t_pppOptions* _opt;
    2829  t_pppRun*           _pppRun;
Note: See TracChangeset for help on using the changeset viewer.