source: ntrip/trunk/BNC/src/PPP/pppThread.cpp@ 5901

Last change on this file since 5901 was 5901, checked in by mervart, 10 years ago
File size: 2.5 KB
Line 
1
2// Part of BNC, a utility for retrieving decoding and
3// converting GNSS data streams from NTRIP broadcasters.
4//
5// Copyright (C) 2007
6// German Federal Agency for Cartography and Geodesy (BKG)
7// http://www.bkg.bund.de
8// Czech Technical University Prague, Department of Geodesy
9// http://www.fsv.cvut.cz
10//
11// Email: euref-ip@bkg.bund.de
12//
13// This program is free software; you can redistribute it and/or
14// modify it under the terms of the GNU General Public License
15// as published by the Free Software Foundation, version 2.
16//
17// This program is distributed in the hope that it will be useful,
18// but WITHOUT ANY WARRANTY; without even the implied warranty of
19// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20// GNU General Public License for more details.
21//
22// You should have received a copy of the GNU General Public License
23// along with this program; if not, write to the Free Software
24// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
26/* -------------------------------------------------------------------------
27 * BKG NTRIP Client
28 * -------------------------------------------------------------------------
29 *
30 * Class: t_pppThread, t_pppRun
31 *
32 * Purpose: Single PPP Client (running in its own thread)
33 *
34 * Author: L. Mervart
35 *
36 * Created: 29-Jul-2014
37 *
38 * Changes:
39 *
40 * -----------------------------------------------------------------------*/
41
42
43#include <iostream>
44#include <iomanip>
45#include <string.h>
46#include <map>
47
48#include "pppThread.h"
49#include "bnccore.h"
50#include "bncephuser.h"
51
52using namespace BNC_PPP;
53using namespace std;
54
55// Constructor
56////////////////////////////////////////////////////////////////////////////
57t_pppThread::t_pppThread(const t_pppOptions* opt) : QThread(0) {
58 _opt = opt;
59 _pppRun = 0;
60
61 connect(this, SIGNAL(finished()), this, SLOT(deleteLater()));
62
63 connect(this, SIGNAL(newMessage(QByteArray,bool)),
64 BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
65}
66
67// Destructor
68////////////////////////////////////////////////////////////////////////////
69t_pppThread::~t_pppThread() {
70 delete _pppRun;
71}
72
73// Run (virtual)
74////////////////////////////////////////////////////////////////////////////
75void t_pppThread::run() {
76
77 connect(BNC_CORE, SIGNAL(quitPPP()), this, SLOT(quit()));
78
79 try {
80 _pppRun = new t_pppRun(_opt);
81 if (_opt->_realTime) {
82 QThread::exec();
83 }
84 else {
85 _pppRun->processFiles();
86 }
87 }
88 catch (t_except exc) {
89 _pppRun = 0;
90 emit newMessage(QByteArray(exc.what().c_str()), true);
91 }
92}
93
Note: See TracBrowser for help on using the repository browser.