source: ntrip/trunk/BNC/src/pppThread.cpp@ 10590

Last change on this file since 10590 was 7856, checked in by stuerze, 9 years ago

minor changes to allow a clean end of program

File size: 2.5 KB
RevLine 
[4757]1
[5719]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 *
[5813]30 * Class: t_pppThread, t_pppRun
[5719]31 *
32 * Purpose: Single PPP Client (running in its own thread)
33 *
34 * Author: L. Mervart
35 *
36 * Created: 29-Jul-2014
37 *
[7856]38 * Changes:
[5719]39 *
40 * -----------------------------------------------------------------------*/
41
42
[4757]43#include <iostream>
[4775]44#include <iomanip>
[4757]45#include <string.h>
[5782]46#include <map>
[4757]47
[5813]48#include "pppThread.h"
[5068]49#include "bnccore.h"
[5834]50#include "bncephuser.h"
[4757]51
[5814]52using namespace BNC_PPP;
[4757]53using namespace std;
54
55// Constructor
56////////////////////////////////////////////////////////////////////////////
[5946]57t_pppThread::t_pppThread(const t_pppOptions* opt) : QThread(0) {
[5883]58
[5905]59 _opt = opt;
60 _pppRun = 0;
61
[5930]62 connect(this, SIGNAL(finished()), this, SLOT(deleteLater()));
63
[7856]64 connect(this, SIGNAL(newMessage(QByteArray,bool)),
[5767]65 BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
[4763]66}
67
68// Destructor
69////////////////////////////////////////////////////////////////////////////
[5813]70t_pppThread::~t_pppThread() {
[5883]71 delete _pppRun;
[4763]72}
73
74// Run (virtual)
75////////////////////////////////////////////////////////////////////////////
[5813]76void t_pppThread::run() {
[7856]77
[5742]78 try {
[5883]79 _pppRun = new t_pppRun(_opt);
80 if (_opt->_realTime) {
[5946]81 QThread::exec();
[5883]82 }
83 else {
[5884]84 _pppRun->processFiles();
[5883]85 }
[5742]86 }
[5825]87 catch (t_except exc) {
[5930]88 _pppRun = 0;
[5766]89 emit newMessage(QByteArray(exc.what().c_str()), true);
[5742]90 }
[5731]91}
92
Note: See TracBrowser for help on using the repository browser.