source: ntrip/trunk/BNS/bns.cpp@ 762

Last change on this file since 762 was 762, checked in by mervart, 16 years ago

* empty log message *

File size: 1.6 KB
Line 
1/* -------------------------------------------------------------------------
2 * BKG NTRIP Server
3 * -------------------------------------------------------------------------
4 *
5 * Class: bns
6 *
7 * Purpose: This class implements the main application behaviour
8 *
9 * Author: L. Mervart
10 *
11 * Created: 29-Mar-2008
12 *
13 * Changes:
14 *
15 * -----------------------------------------------------------------------*/
16
17#include <iostream>
18
19#include "bns.h"
20
21using namespace std;
22
23// Constructor
24////////////////////////////////////////////////////////////////////////////
25t_bns::t_bns(QObject* parent) : QThread(parent) {
26
27 _bnseph = new t_bnseph(parent);
28
29 connect(_bnseph, SIGNAL(newMessage(QByteArray)),
30 this, SLOT(slotMessage(const QByteArray)));
31
32 connect(_bnseph, SIGNAL(error(QByteArray)),
33 this, SLOT(slotError(const QByteArray)));
34}
35
36// Destructor
37////////////////////////////////////////////////////////////////////////////
38t_bns::~t_bns() {
39 _bnseph->terminate();
40 _bnseph->wait();
41 delete _bnseph;
42}
43
44// Write a Program Message
45////////////////////////////////////////////////////////////////////////////
46void t_bns::slotMessage(const QByteArray msg) {
47 cout << msg.data() << endl;
48 emit(newMessage(msg));
49}
50
51// Write a Program Message
52////////////////////////////////////////////////////////////////////////////
53void t_bns::slotError(const QByteArray msg) {
54 cerr << msg.data() << endl;
55 emit(error(msg));
56}
57
58// Start
59////////////////////////////////////////////////////////////////////////////
60void t_bns::run() {
61 slotMessage("============ Start BNS ============");
62 _bnseph->start();
63}
64
Note: See TracBrowser for help on using the repository browser.