Changeset 758 in ntrip
- Timestamp:
- Mar 30, 2008, 5:47:55 PM (17 years ago)
- Location:
- trunk/BNS
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNS/bns.cpp
r757 r758 24 24 //////////////////////////////////////////////////////////////////////////// 25 25 t_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))); 26 29 } 27 30 … … 29 32 //////////////////////////////////////////////////////////////////////////// 30 33 t_bns::~t_bns() { 34 delete _bnseph; 31 35 } 32 36 33 37 // Write a Program Message 34 38 //////////////////////////////////////////////////////////////////////////// 35 void t_bns:: message(const QByteArray msg) {39 void t_bns::slotMessage(const QByteArray msg) { 36 40 cout << msg.data() << endl; 37 41 emit(newMessage(msg)); … … 41 45 //////////////////////////////////////////////////////////////////////////// 42 46 void t_bns::run() { 43 message("============ Start BNS ============"); 47 slotMessage("============ Start BNS ============"); 48 _bnseph->start(); 44 49 } 45 50 -
trunk/BNS/bns.h
r757 r758 2 2 #define BNS_H 3 3 4 #include <QApplication>5 4 #include <QThread> 6 5 #include <QMutex> 6 7 #include "bnseph.h" 7 8 8 9 class t_bns : public QThread { … … 16 17 void newMessage(const QByteArray msg); 17 18 19 private slots: 20 void slotMessage(const QByteArray msg); 21 18 22 private: 19 void message(const QByteArray msg);20 QMutex _mutex;23 t_bnseph* _bnseph; 24 QMutex _mutex; 21 25 }; 22 26 #endif -
trunk/BNS/bns.pro
r756 r758 21 21 release:MOC_DIR=.moc/release 22 22 23 HEADERS = bns.h bnswindow.h bnshlpdlg.h bnshtml.h 23 HEADERS = bns.h bnswindow.h bnshlpdlg.h bnshtml.h \ 24 bnseph.h 24 25 25 SOURCES = bnsmain.cpp bns.cpp bnswindow.cpp bnshlpdlg.cpp bnshtml.cpp 26 SOURCES = bnsmain.cpp bns.cpp bnswindow.cpp bnshlpdlg.cpp bnshtml.cpp \ 27 bnseph.cpp 26 28 27 29 RC_FILE = bns.rc -
trunk/BNS/bnsmain.cpp
r757 r758 44 44 app.setApplicationName("BKG_NTRIP_Server"); 45 45 46 // Main processing class47 // ---------------------48 t_bns* bns = new t_bns();49 50 46 // Interactive Mode - open the main window 51 47 // --------------------------------------- 52 48 if (GUIenabled) { 53 bnsWindow* bnsWin = new bnsWindow( bns);49 bnsWindow* bnsWin = new bnsWindow(); 54 50 bnsWin->show(); 55 51 } … … 58 54 // ---------------------------- 59 55 else { 56 t_bns* bns = new t_bns(); 60 57 bns->start(); 61 58 } -
trunk/BNS/bnswindow.cpp
r757 r758 58 58 // Constructor 59 59 //////////////////////////////////////////////////////////////////////////// 60 bnsWindow::bnsWindow(t_bns* bns) { 61 62 _bns = bns; 63 64 connect(bns, SIGNAL(newMessage(QByteArray)), 65 this, SLOT(slotMessage(const QByteArray))); 60 bnsWindow::bnsWindow() { 61 62 _bns = 0; 66 63 67 64 QSettings settings; … … 292 289 _actStart->setEnabled(true); 293 290 _actStop->setEnabled(false); 291 delete _bns; 292 _bns = 0; 294 293 } 295 294 } … … 303 302 _actStop->setEnabled(true); 304 303 304 _bns = new t_bns(0); 305 connect(_bns, SIGNAL(newMessage(QByteArray)), 306 this, SLOT(slotMessage(const QByteArray))); 305 307 _bns->start(); 306 308 } -
trunk/BNS/bnswindow.h
r757 r758 18 18 19 19 public: 20 bnsWindow( t_bns* bns);20 bnsWindow(); 21 21 ~bnsWindow(); 22 22
Note:
See TracChangeset
for help on using the changeset viewer.