- Timestamp:
- Mar 30, 2008, 5:30:50 PM (17 years ago)
- Location:
- trunk/BNS
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNS/bns.cpp
r756 r757 23 23 // Constructor 24 24 //////////////////////////////////////////////////////////////////////////// 25 bns::bns(QObject* parent) : QThread(parent) {25 t_bns::t_bns(QObject* parent) : QThread(parent) { 26 26 } 27 27 28 28 // Destructor 29 29 //////////////////////////////////////////////////////////////////////////// 30 bns::~bns() {30 t_bns::~t_bns() { 31 31 } 32 32 33 33 // Write a Program Message 34 34 //////////////////////////////////////////////////////////////////////////// 35 void bns::slotMessage(const QByteArray msg) { 36 QMutexLocker locker(&_mutex); 35 void t_bns::message(const QByteArray msg) { 37 36 cout << msg.data() << endl; 37 emit(newMessage(msg)); 38 38 } 39 39 40 40 // Start 41 41 //////////////////////////////////////////////////////////////////////////// 42 void bns::run() {43 slotMessage("============ Start BNS ============");42 void t_bns::run() { 43 message("============ Start BNS ============"); 44 44 } 45 45 -
trunk/BNS/bns.h
r756 r757 6 6 #include <QMutex> 7 7 8 class bns : public QThread {9 8 class t_bns : public QThread { 9 Q_OBJECT 10 10 public: 11 bns(QObject* parent = 0);12 virtual ~ bns();11 t_bns(QObject* parent = 0); 12 virtual ~t_bns(); 13 13 virtual void run(); 14 14 15 protected: 16 17 public slots: 18 void slotMessage(const QByteArray msg); 19 20 private slots: 15 signals: 16 void newMessage(const QByteArray msg); 21 17 22 18 private: 19 void message(const QByteArray msg); 23 20 QMutex _mutex; 24 21 }; -
trunk/BNS/bnsmain.cpp
r756 r757 26 26 int main(int argc, char *argv[]) { 27 27 28 // Command-Line Options 29 // -------------------- 28 30 bool GUIenabled = true; 29 31 for (int ii = 1; ii < argc; ii++) { … … 34 36 } 35 37 38 // Main Qt Class 39 // ------------- 36 40 QApplication app(argc, argv, GUIenabled); 37 41 … … 40 44 app.setApplicationName("BKG_NTRIP_Server"); 41 45 46 // Main processing class 47 // --------------------- 48 t_bns* bns = new t_bns(); 49 42 50 // Interactive Mode - open the main window 43 51 // --------------------------------------- 44 52 if (GUIenabled) { 45 bnsWindow* bnsWin = new bnsWindow( );53 bnsWindow* bnsWin = new bnsWindow(bns); 46 54 bnsWin->show(); 47 55 } … … 50 58 // ---------------------------- 51 59 else { 52 60 bns->start(); 53 61 } 54 62 -
trunk/BNS/bnswindow.cpp
r756 r757 58 58 // Constructor 59 59 //////////////////////////////////////////////////////////////////////////// 60 bnsWindow::bnsWindow() { 60 bnsWindow::bnsWindow(t_bns* bns) { 61 62 _bns = bns; 63 64 connect(bns, SIGNAL(newMessage(QByteArray)), 65 this, SLOT(slotMessage(const QByteArray))); 61 66 62 67 QSettings settings; … … 298 303 _actStop->setEnabled(true); 299 304 300 slotMessage("============ Start BNS ============"); 301 302 } 305 _bns->start(); 306 } -
trunk/BNS/bnswindow.h
r754 r757 4 4 #include <QtGui> 5 5 #include <QWhatsThis> 6 7 #include "bns.h" 6 8 7 9 class bnsAboutDlg : public QDialog { … … 16 18 17 19 public: 18 bnsWindow( );20 bnsWindow(t_bns* bns); 19 21 ~bnsWindow(); 20 22 … … 58 60 59 61 QTextEdit* _log; 62 63 t_bns* _bns; 60 64 }; 61 65 #endif
Note:
See TracChangeset
for help on using the changeset viewer.