source: ntrip/trunk/BNC/src/PPP/pppMain.cpp@ 5716

Last change on this file since 5716 was 5716, checked in by mervart, 10 years ago
File size: 5.1 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_pppMain
31 *
32 * Purpose: Start of the PPP client(s)
33 *
34 * Author: L. Mervart
35 *
36 * Created: 29-Jul-2014
37 *
38 * Changes:
39 *
40 * -----------------------------------------------------------------------*/
41
42#include "pppMain.h"
43#include "bncsettings.h"
44
45using namespace BNC;
46using namespace std;
47
48// Constructor
49//////////////////////////////////////////////////////////////////////////////
50t_pppMain::t_pppMain() {
51}
52
53// Destructor
54//////////////////////////////////////////////////////////////////////////////
55t_pppMain::~t_pppMain() {
56}
57
58//
59//////////////////////////////////////////////////////////////////////////////
60void t_pppMain::start() {
61 readOptions();
62}
63
64//
65//////////////////////////////////////////////////////////////////////////////
66void t_pppMain::stop() {
67}
68
69//
70//////////////////////////////////////////////////////////////////////////////
71void t_pppMain::readOptions() {
72
73 _options.clear();
74
75 bncSettings settings;
76
77 _logFile = settings.value("PPP/logFile").toString();
78 _nmeaFile = settings.value("PPP/nmeaFile").toString();
79 _nmeaPort = settings.value("PPP/nmeaPort").toInt();
80
81 bool realTime = false;
82 if (settings.value("PPP/dataSource").toString() == "Real-Time Streams") {
83 realTime = true;
84 }
85 else if (settings.value("PPP/dataSource").toString() == "RINEX Files") {
86 realTime = false;
87 }
88 else {
89 return;
90 }
91
92 QListIterator<QString> it(settings.value("PPP/staTable").toStringList());
93 while (it.hasNext()) {
94 QStringList hlp = it.next().split(",");
95
96 if (hlp.size() < 9) {
97 throw "pppMain: wrong option staTable";
98 }
99
100 QSharedPointer<t_options> opt(new t_options());
101
102 opt->_realTime = realTime;
103 opt->_roverName = hlp[0].toAscii().data();
104 opt->_sigCrd[0] = hlp[1].toDouble();
105 opt->_sigCrd[1] = hlp[2].toDouble();
106 opt->_sigCrd[2] = hlp[3].toDouble();
107 opt->_noiseCrd[0] = hlp[4].toDouble();
108 opt->_noiseCrd[1] = hlp[5].toDouble();
109 opt->_noiseCrd[2] = hlp[6].toDouble();
110 opt->_sigTropo = hlp[7].toDouble();
111 opt->_noiseTropo = hlp[8].toDouble();
112
113 if (realTime) {
114 opt->_corrMount = settings.value("PPP/corrMount").toString().toAscii().data();
115 }
116 else {
117 opt->_rinexObs = settings.value("PPP/rinexObs").toString().toAscii().data();
118 opt->_rinexNav = settings.value("PPP/rinexNav").toString().toAscii().data();
119 opt->_corrFile = settings.value("PPP/corrFile").toString().toAscii().data();
120 }
121
122 opt->_crdFile = settings.value("PPP/crdFile").toString().toAscii().data();
123 opt->_antexFile = settings.value("PPP/antexFile").toString().toAscii().data();
124
125 opt->_sigmaC1 = settings.value("PPP/sigmaC1").toDouble();
126 opt->_sigmaL1 = settings.value("PPP/sigmaL1").toDouble();
127 opt->_corrWaitTime = settings.value("PPP/corrWaitTime").toDouble();
128
129 if (settings.value("PPP/lcGPS").toString() == "P3") {
130 opt->_lcGPS.push_back(t_lc::cIF);
131 }
132 else if (settings.value("PPP/lcGPS").toString() == "L3") {
133 opt->_lcGPS.push_back(t_lc::lIF);
134 }
135 else if (settings.value("PPP/lcGPS").toString() == "P3&L3") {
136 opt->_lcGPS.push_back(t_lc::cIF);
137 opt->_lcGPS.push_back(t_lc::lIF);
138 }
139
140 if (settings.value("PPP/lcGLONASS").toString() == "P3") {
141 opt->_lcGLONASS.push_back(t_lc::cIF);
142 }
143 else if (settings.value("PPP/lcGLONASS").toString() == "L3") {
144 opt->_lcGLONASS.push_back(t_lc::lIF);
145 }
146 else if (settings.value("PPP/lcGLONASS").toString() == "P3&L3") {
147 opt->_lcGLONASS.push_back(t_lc::cIF);
148 opt->_lcGLONASS.push_back(t_lc::lIF);
149 }
150
151 if (settings.value("PPP/lcGalileo").toString() == "P3") {
152 opt->_lcGalileo.push_back(t_lc::cIF);
153 }
154 else if (settings.value("PPP/lcGalileo").toString() == "L3") {
155 opt->_lcGalileo.push_back(t_lc::lIF);
156 }
157 else if (settings.value("PPP/lcGalileo").toString() == "P3&L3") {
158 opt->_lcGalileo.push_back(t_lc::cIF);
159 opt->_lcGalileo.push_back(t_lc::lIF);
160 }
161
162 _options << opt;
163 }
164}
165
Note: See TracBrowser for help on using the repository browser.