Changeset 5905 in ntrip


Ignore:
Timestamp:
Aug 9, 2014, 11:45:37 AM (10 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src
Files:
8 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;
  • trunk/BNC/src/bnccore.cpp

    r5903 r5905  
    872872//
    873873////////////////////////////////////////////////////////////////////////////
    874 void t_bncCore::startPPP() {
    875   _pppMain->start();
     874void t_bncCore::startPPP(bool ownThread) {
     875  _pppMain->start(ownThread);
    876876}
    877877
  • trunk/BNC/src/bnccore.h

    r5903 r5905  
    7171  void setMainWindow(QWidget* mainWindow){_mainWindow = mainWindow;}
    7272  bool GUIenabled() const {return _GUIenabled;}
    73   void startPPP();
     73  void startPPP(bool ownThread);
    7474  void stopPPP();
    7575
  • trunk/BNC/src/bncmain.cpp

    r5900 r5905  
    189189    BNC_CORE->slotMessage("========== Start BNC v" BNCVERSION " =========", true);
    190190
    191     // PPP Client(s) (in separate threads)
    192     // -----------------------------------   
    193     BNC_CORE->startPPP();
    194 
    195191    // Normal case - data from Internet
    196192    // --------------------------------
    197193    if ( rawFileName.isEmpty() ) {
    198194      BNC_CORE->setMode(t_bncCore::nonInteractive);
     195      BNC_CORE->startPPP(true);
     196
    199197      caster->readMountPoints();
    200198      if (caster->numStations() == 0) {
     
    207205    else {
    208206      BNC_CORE->setMode(t_bncCore::batchPostProcessing);
    209       bncRawFile*   rawFile   = new bncRawFile(rawFileName, "",
    210                                                bncRawFile::input);
     207      BNC_CORE->startPPP(false);
     208
     209      bncRawFile*   rawFile   = new bncRawFile(rawFileName, "", bncRawFile::input);
    211210      bncGetThread* getThread = new bncGetThread(rawFile);
    212211      caster->addGetThread(getThread, true);
  • trunk/BNC/src/bncwindow.cpp

    r5902 r5905  
    16501650    startRealTime();
    16511651  }
    1652   BNC_CORE->startPPP();
     1652  BNC_CORE->startPPP(true);
    16531653}
    16541654
Note: See TracChangeset for help on using the changeset viewer.