source: ntrip/trunk/BNC/src/PPP_free/pppClient.cpp@ 6082

Last change on this file since 6082 was 6082, checked in by mervart, 10 years ago
File size: 3.7 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_pppClient
31 *
32 * Purpose: PPP Client processing starts here
33 *
34 * Author: L. Mervart
35 *
36 * Created: 29-Jul-2014
37 *
38 * Changes:
39 *
40 * -----------------------------------------------------------------------*/
41
42#include <QThreadStorage>
43
44#include <iostream>
45#include <iomanip>
46#include <stdlib.h>
47#include <string.h>
48#include <stdexcept>
49
50#include "pppClient.h"
51#include "bncconst.h"
52#include "bncutils.h"
53#include "bncantex.h"
54
55using namespace BNC_PPP;
56using namespace std;
57
58// Global variable holding thread-specific pointers
59//////////////////////////////////////////////////////////////////////////////
60t_pppClient* PPP_CLIENT = 0;
61
62// Static function returning thread-specific pointer
63//////////////////////////////////////////////////////////////////////////////
64t_pppClient* t_pppClient::instance() {
65 return PPP_CLIENT;
66}
67
68// Constructor
69//////////////////////////////////////////////////////////////////////////////
70t_pppClient::t_pppClient(const t_pppOptions* opt) {
71 _opt = new t_pppOptions(*opt);
72 _log = new ostringstream();
73 _client = new bncPPPclient(QByteArray(_opt->_roverName.c_str()), _opt);
74 PPP_CLIENT = this;
75}
76
77// Destructor
78//////////////////////////////////////////////////////////////////////////////
79t_pppClient::~t_pppClient() {
80 delete _log;
81 delete _opt;
82 delete _client;
83}
84
85//
86//////////////////////////////////////////////////////////////////////////////
87void t_pppClient::putEphemeris(const t_eph* eph) {
88 const t_ephGPS* ephGPS = dynamic_cast<const t_ephGPS*>(eph);
89 const t_ephGlo* ephGlo = dynamic_cast<const t_ephGlo*>(eph);
90 const t_ephGal* ephGal = dynamic_cast<const t_ephGal*>(eph);
91 if (ephGPS) {
92 _client->putNewEph(new t_ephGPS(*ephGPS));
93 }
94 else if (ephGlo) {
95 _client->putNewEph(new t_ephGlo(*ephGlo));
96 }
97 else if (ephGal) {
98 _client->putNewEph(new t_ephGal(*ephGal));
99 }
100}
101
102//
103//////////////////////////////////////////////////////////////////////////////
104void t_pppClient::putOrbCorrections(const vector<t_orbCorr*>& corr) {
105 _client->putOrbCorrections(corr);
106}
107
108//
109//////////////////////////////////////////////////////////////////////////////
110void t_pppClient::putClkCorrections(const vector<t_clkCorr*>& corr) {
111 _client->putClkCorrections(corr);
112}
113
114//
115//////////////////////////////////////////////////////////////////////////////
116void t_pppClient::putBiases(const vector<t_satBias*>& biases) {
117}
118
119//
120//////////////////////////////////////////////////////////////////////////////
121void t_pppClient::processEpoch(const vector<t_satObs*>& satObs, t_output* output) {
122 _client->processEpoch(satObs, output);
123}
124
Note: See TracBrowser for help on using the repository browser.