Changeset 757 in ntrip


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

* empty log message *

Location:
trunk/BNS
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNS/bns.cpp

    r756 r757  
    2323// Constructor
    2424////////////////////////////////////////////////////////////////////////////
    25 bns::bns(QObject* parent) : QThread(parent) {
     25t_bns::t_bns(QObject* parent) : QThread(parent) {
    2626}
    2727
    2828// Destructor
    2929////////////////////////////////////////////////////////////////////////////
    30 bns::~bns() {
     30t_bns::~t_bns() {
    3131}
    3232
    3333// Write a Program Message
    3434////////////////////////////////////////////////////////////////////////////
    35 void bns::slotMessage(const QByteArray msg) {
    36   QMutexLocker locker(&_mutex);
     35void t_bns::message(const QByteArray msg) {
    3736  cout << msg.data() << endl;
     37  emit(newMessage(msg));
    3838}
    3939
    4040// Start
    4141////////////////////////////////////////////////////////////////////////////
    42 void bns::run() {
    43   slotMessage("============ Start BNS ============");
     42void t_bns::run() {
     43  message("============ Start BNS ============");
    4444}
    4545
  • trunk/BNS/bns.h

    r756 r757  
    66#include <QMutex>
    77
    8 class bns : public QThread {
    9   Q_OBJECT
     8class t_bns : public QThread {
     9 Q_OBJECT
    1010 public:
    11   bns(QObject* parent = 0);
    12   virtual ~bns(); 
     11  t_bns(QObject* parent = 0);
     12  virtual ~t_bns(); 
    1313  virtual void run(); 
    1414
    15  protected:
    16 
    17  public slots:
    18   void slotMessage(const QByteArray msg);
    19    
    20  private slots:
     15 signals:
     16  void newMessage(const QByteArray msg);
    2117 
    2218 private:
     19  void message(const QByteArray msg);
    2320  QMutex _mutex;
    2421};
  • trunk/BNS/bnsmain.cpp

    r756 r757  
    2626int main(int argc, char *argv[]) {
    2727
     28  // Command-Line Options
     29  // --------------------
    2830  bool GUIenabled = true;
    2931  for (int ii = 1; ii < argc; ii++) {
     
    3436  }
    3537
     38  // Main Qt Class
     39  // -------------
    3640  QApplication app(argc, argv, GUIenabled);
    3741
     
    4044  app.setApplicationName("BKG_NTRIP_Server");
    4145
     46  // Main processing class
     47  // ---------------------
     48  t_bns* bns = new t_bns();
     49
    4250  // Interactive Mode - open the main window
    4351  // ---------------------------------------
    4452  if (GUIenabled) {
    45     bnsWindow* bnsWin = new bnsWindow();
     53    bnsWindow* bnsWin = new bnsWindow(bns);
    4654    bnsWin->show();
    4755  }
     
    5058  // ----------------------------
    5159  else {
    52 
     60    bns->start();
    5361  }
    5462
  • trunk/BNS/bnswindow.cpp

    r756 r757  
    5858// Constructor
    5959////////////////////////////////////////////////////////////////////////////
    60 bnsWindow::bnsWindow() {
     60bnsWindow::bnsWindow(t_bns* bns) {
     61
     62  _bns = bns;
     63
     64  connect(bns, SIGNAL(newMessage(QByteArray)),
     65          this, SLOT(slotMessage(const QByteArray)));
    6166
    6267  QSettings settings;
     
    298303  _actStop->setEnabled(true);
    299304
    300   slotMessage("============ Start BNS ============");
    301 
    302 }
     305  _bns->start();
     306}
  • trunk/BNS/bnswindow.h

    r754 r757  
    44#include <QtGui>
    55#include <QWhatsThis>
     6
     7#include "bns.h"
    68
    79class bnsAboutDlg : public QDialog {
     
    1618
    1719 public:
    18   bnsWindow();
     20  bnsWindow(t_bns* bns);
    1921  ~bnsWindow();
    2022
     
    5860
    5961  QTextEdit*  _log;
     62
     63  t_bns*      _bns;
    6064};
    6165#endif
Note: See TracChangeset for help on using the changeset viewer.