Changeset 758 in ntrip


Ignore:
Timestamp:
Mar 30, 2008, 5:47:55 PM (16 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNS
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNS/bns.cpp

    r757 r758  
    2424////////////////////////////////////////////////////////////////////////////
    2525t_bns::t_bns(QObject* parent) : QThread(parent) {
     26  _bnseph = new t_bnseph(parent);
     27  connect(_bnseph, SIGNAL(newMessage(QByteArray)),
     28          this, SLOT(slotMessage(const QByteArray)));
    2629}
    2730
     
    2932////////////////////////////////////////////////////////////////////////////
    3033t_bns::~t_bns() {
     34  delete _bnseph;
    3135}
    3236
    3337// Write a Program Message
    3438////////////////////////////////////////////////////////////////////////////
    35 void t_bns::message(const QByteArray msg) {
     39void t_bns::slotMessage(const QByteArray msg) {
    3640  cout << msg.data() << endl;
    3741  emit(newMessage(msg));
     
    4145////////////////////////////////////////////////////////////////////////////
    4246void t_bns::run() {
    43   message("============ Start BNS ============");
     47  slotMessage("============ Start BNS ============");
     48  _bnseph->start();
    4449}
    4550
  • trunk/BNS/bns.h

    r757 r758  
    22#define BNS_H
    33
    4 #include <QApplication>
    54#include <QThread>
    65#include <QMutex>
     6
     7#include "bnseph.h"
    78
    89class t_bns : public QThread {
     
    1617  void newMessage(const QByteArray msg);
    1718 
     19 private slots:
     20  void slotMessage(const QByteArray msg);
     21
    1822 private:
    19   void message(const QByteArray msg);
    20   QMutex _mutex;
     23  t_bnseph* _bnseph;
     24  QMutex    _mutex;
    2125};
    2226#endif
  • trunk/BNS/bns.pro

    r756 r758  
    2121release:MOC_DIR=.moc/release
    2222
    23 HEADERS =             bns.h   bnswindow.h   bnshlpdlg.h   bnshtml.h
     23HEADERS =             bns.h   bnswindow.h   bnshlpdlg.h   bnshtml.h   \
     24          bnseph.h
    2425
    25 SOURCES = bnsmain.cpp bns.cpp bnswindow.cpp bnshlpdlg.cpp bnshtml.cpp
     26SOURCES = bnsmain.cpp bns.cpp bnswindow.cpp bnshlpdlg.cpp bnshtml.cpp \
     27          bnseph.cpp
    2628
    2729RC_FILE = bns.rc
  • trunk/BNS/bnsmain.cpp

    r757 r758  
    4444  app.setApplicationName("BKG_NTRIP_Server");
    4545
    46   // Main processing class
    47   // ---------------------
    48   t_bns* bns = new t_bns();
    49 
    5046  // Interactive Mode - open the main window
    5147  // ---------------------------------------
    5248  if (GUIenabled) {
    53     bnsWindow* bnsWin = new bnsWindow(bns);
     49    bnsWindow* bnsWin = new bnsWindow();
    5450    bnsWin->show();
    5551  }
     
    5854  // ----------------------------
    5955  else {
     56    t_bns* bns = new t_bns();
    6057    bns->start();
    6158  }
  • trunk/BNS/bnswindow.cpp

    r757 r758  
    5858// Constructor
    5959////////////////////////////////////////////////////////////////////////////
    60 bnsWindow::bnsWindow(t_bns* bns) {
    61 
    62   _bns = bns;
    63 
    64   connect(bns, SIGNAL(newMessage(QByteArray)),
    65           this, SLOT(slotMessage(const QByteArray)));
     60bnsWindow::bnsWindow() {
     61
     62  _bns = 0;
    6663
    6764  QSettings settings;
     
    292289    _actStart->setEnabled(true);
    293290    _actStop->setEnabled(false);
     291    delete _bns;
     292    _bns = 0;
    294293  }
    295294}
     
    303302  _actStop->setEnabled(true);
    304303
     304  _bns = new t_bns(0);
     305  connect(_bns, SIGNAL(newMessage(QByteArray)),
     306          this, SLOT(slotMessage(const QByteArray)));
    305307  _bns->start();
    306308}
  • trunk/BNS/bnswindow.h

    r757 r758  
    1818
    1919 public:
    20   bnsWindow(t_bns* bns);
     20  bnsWindow();
    2121  ~bnsWindow();
    2222
Note: See TracChangeset for help on using the changeset viewer.