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

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