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

Last change on this file since 5729 was 5729, checked in by mervart, 10 years ago
File size: 4.0 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 *
30 * Class: t_pppThread
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
[4757]43#include <iostream>
[4775]44#include <iomanip>
[4757]45#include <string.h>
46
[5680]47#include "pppThread.h"
[5068]48#include "bnccore.h"
[4757]49
[5719]50using namespace BNC;
[4757]51using namespace std;
52
53// Constructor
54////////////////////////////////////////////////////////////////////////////
[5721]55t_pppThread::t_pppThread(const t_options* opt) : QThread(0) {
[5723]56 _opt = *opt;
[4763]57}
58
59// Destructor
60////////////////////////////////////////////////////////////////////////////
[5680]61t_pppThread::~t_pppThread() {
[4763]62}
63
64// Run (virtual)
65////////////////////////////////////////////////////////////////////////////
[5680]66void t_pppThread::run() {
[5681]67
[5729]68 cout << _opt._roverName << " run" << endl;
69
[4757]70 // Connect to BNC Signals
71 // ----------------------
[5722]72 if (BNC_CORE->caster()) {
[5729]73 connect(BNC_CORE->caster(), SIGNAL(newObs(QByteArray, QList<t_obs>)),
74 this, SLOT(slotNewObs(QByteArray, QList<t_obs>)));
[4757]75
[5722]76 connect(BNC_CORE, SIGNAL(newEphGPS(gpsephemeris)),
77 this, SLOT(slotNewEphGPS(gpsephemeris)));
78
79 connect(BNC_CORE, SIGNAL(newEphGlonass(glonassephemeris)),
80 this, SLOT(slotNewEphGlonass(glonassephemeris)));
81
82 connect(BNC_CORE, SIGNAL(newEphGalileo(galileoephemeris)),
83 this, SLOT(slotNewEphGalileo(galileoephemeris)));
[4757]84
[5722]85 connect(BNC_CORE, SIGNAL(newCorrections(QList<QString>)),
86 this, SLOT(slotNewCorrections(QList<QString>)));
87 }
[4764]88
89 // Start processing loop
90 // ---------------------
91 QThread::exec();
[5729]92
93 cout << _opt._roverName << " exit" << endl;
[4757]94}
95
96//
97////////////////////////////////////////////////////////////////////////////
[5680]98void t_pppThread::slotNewEphGPS(gpsephemeris gpseph) {
[4757]99 QMutexLocker locker(&_mutex);
[5723]100 cout << _opt._roverName << " slotNewEphGPS" << endl;
[4757]101}
102
103//
104////////////////////////////////////////////////////////////////////////////
[5680]105void t_pppThread::slotNewEphGlonass(glonassephemeris gloeph) {
[4757]106 QMutexLocker locker(&_mutex);
[5723]107 cout << _opt._roverName << " slotNewEphGlonass" << endl;
[4757]108}
109
110//
111////////////////////////////////////////////////////////////////////////////
[5680]112void t_pppThread::slotNewEphGalileo(galileoephemeris /* galeph */) {
[5681]113 QMutexLocker locker(&_mutex);
[5723]114 cout << _opt._roverName << " slotNewEphGalileo" << endl;
[4757]115}
116
117//
118////////////////////////////////////////////////////////////////////////////
[5680]119void t_pppThread::slotNewCorrections(QList<QString> corrList) {
[4757]120 QMutexLocker locker(&_mutex);
[5726]121 cout << _opt._roverName << " slotNewCorrections" << endl;
[4757]122}
123//
124////////////////////////////////////////////////////////////////////////////
[5680]125void t_pppThread::slotNewObs(QByteArray staID, QList<t_obs> obsList) {
[4757]126 QMutexLocker locker(&_mutex);
[5726]127 cout << _opt._roverName << " slotNewObs" << endl;
[5589]128}
[5525]129
Note: See TracBrowser for help on using the repository browser.