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 |
|
---|
21 | using namespace std;
|
---|
22 |
|
---|
23 | // Constructor
|
---|
24 | ////////////////////////////////////////////////////////////////////////////
|
---|
25 | t_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 | ////////////////////////////////////////////////////////////////////////////
|
---|
38 | t_bns::~t_bns() {
|
---|
39 | delete _bnseph;
|
---|
40 | }
|
---|
41 |
|
---|
42 | // Write a Program Message
|
---|
43 | ////////////////////////////////////////////////////////////////////////////
|
---|
44 | void t_bns::slotMessage(const QByteArray msg) {
|
---|
45 | cout << msg.data() << endl;
|
---|
46 | emit(newMessage(msg));
|
---|
47 | }
|
---|
48 |
|
---|
49 | // Write a Program Message
|
---|
50 | ////////////////////////////////////////////////////////////////////////////
|
---|
51 | void t_bns::slotError(const QByteArray msg) {
|
---|
52 | cerr << msg.data() << endl;
|
---|
53 | emit(error(msg));
|
---|
54 | }
|
---|
55 |
|
---|
56 | // Start
|
---|
57 | ////////////////////////////////////////////////////////////////////////////
|
---|
58 | void t_bns::run() {
|
---|
59 | slotMessage("============ Start BNS ============");
|
---|
60 | _bnseph->start();
|
---|
61 | }
|
---|
62 |
|
---|