source: ntrip/trunk/BNC/src/pppOptions.cpp@ 10588

Last change on this file since 10588 was 10251, checked in by stuerze, 13 months ago

changes regarding PPP: allow single frequency PPP and allow to select the frequency bands that are used

File size: 4.4 KB
RevLine 
[5708]1// Part of BNC, a utility for retrieving decoding and
2// converting GNSS data streams from NTRIP broadcasters.
3//
4// Copyright (C) 2007
5// German Federal Agency for Cartography and Geodesy (BKG)
6// http://www.bkg.bund.de
7// Czech Technical University Prague, Department of Geodesy
8// http://www.fsv.cvut.cz
9//
10// Email: euref-ip@bkg.bund.de
11//
12// This program is free software; you can redistribute it and/or
13// modify it under the terms of the GNU General Public License
14// as published by the Free Software Foundation, version 2.
15//
16// This program is distributed in the hope that it will be useful,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19// GNU General Public License for more details.
20//
21// You should have received a copy of the GNU General Public License
22// along with this program; if not, write to the Free Software
23// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
25/* -------------------------------------------------------------------------
26 * BKG NTRIP Client
27 * -------------------------------------------------------------------------
28 *
[5810]29 * Class: t_pppOptions
[5708]30 *
31 * Purpose: Options for PPP client
32 *
33 * Author: L. Mervart
34 *
35 * Created: 29-Jul-2014
36 *
[8905]37 * Changes:
[5708]38 *
39 * -----------------------------------------------------------------------*/
40
41#include <newmatio.h>
[5810]42#include "pppOptions.h"
[5708]43
[5814]44using namespace BNC_PPP;
[5708]45using namespace std;
46
47// Constructor
48//////////////////////////////////////////////////////////////////////////////
[5810]49t_pppOptions::t_pppOptions() {
[5790]50 _xyzAprRover.ReSize(3); _xyzAprRover = 0.0;
51 _neuEccRover.ReSize(3); _neuEccRover = 0.0;
[5912]52 _aprSigCrd.ReSize(3); _aprSigCrd = 0.0;
53 _noiseCrd.ReSize(3); _noiseCrd = 0.0;
[5708]54}
55
[5736]56// Destructor
57//////////////////////////////////////////////////////////////////////////////
[5810]58t_pppOptions::~t_pppOptions() {
[5736]59}
60
[8905]61//
[5757]62//////////////////////////////////////////////////////////////////////////////
[5912]63const std::vector<t_lc::type>& t_pppOptions::LCs(char system) const {
[6965]64
[5912]65 if (system == 'R') {
66 return _LCsGLONASS;
67 }
68 else if (system == 'E') {
69 return _LCsGalileo;
70 }
[6965]71 else if (system == 'C') {
72 return _LCsBDS;
73 }
[5912]74 else {
75 return _LCsGPS;
76 }
[5757]77}
78
[8905]79//
[5757]80//////////////////////////////////////////////////////////////////////////////
[10251]81const std::vector<char>& t_pppOptions::frqBands(char system) const {
82
83 if (system == 'R') {
84 return _frqBandsGLONASS;
85 }
86 else if (system == 'E') {
87 return _frqBandsGalileo;
88 }
89 else if (system == 'C') {
90 return _frqBandsBDS;
91 }
92 else {
93 return _frqBandsGPS;
94 }
95}
96
97//
98//////////////////////////////////////////////////////////////////////////////
[5912]99bool t_pppOptions::useOrbClkCorr() const {
100 if (_realTime) {
101 return !_corrMount.empty();
[5837]102 }
103 else {
[5912]104 return !_corrFile.empty();
[5837]105 }
[5789]106}
107
[5912]108// Processed satellite systems
109/////////////////////////////////////////////////////////////////////////////
110vector<char> t_pppOptions::systems() const {
111 vector<char> answ;
112 if (_LCsGPS.size() > 0) answ.push_back('G');
113 if (_LCsGLONASS.size() > 0) answ.push_back('R');
[6035]114 if (_LCsGalileo.size() > 0) answ.push_back('E');
[6965]115 if (_LCsBDS.size() > 0) answ.push_back('C');
[5912]116 return answ;
[5757]117}
118
[8905]119//
[5912]120/////////////////////////////////////////////////////////////////////////////
121vector<t_lc::type> t_pppOptions::ambLCs(char system) const {
[8905]122
[5912]123 const vector<t_lc::type>& allLCs = LCs(system);
124 vector<t_lc::type> phaseLCs;
125 for (unsigned ii = 0; ii < allLCs.size(); ii++) {
126 if (t_lc::includesPhase(allLCs[ii])) {
127 phaseLCs.push_back(allLCs[ii]);
[5797]128 }
[5757]129 }
[5797]130
[5912]131 vector<t_lc::type> answ;
132 if (phaseLCs.size() == 1) {
133 answ.push_back(phaseLCs[0]);
[5757]134 }
[5912]135 else if (phaseLCs.size() > 1) {
136 answ.push_back(t_lc::l1);
137 answ.push_back(t_lc::l2);
138 }
[5797]139
[5912]140 return answ;
[5757]141}
[7048]142
143//
144/////////////////////////////////////////////////////////////////////////////
145vector<t_lc::type> t_pppOptions::codeLCs(char system) const {
146
147 const vector<t_lc::type>& allLCs = LCs(system);
148 vector<t_lc::type> codeLCs;
149 for (unsigned ii = 0; ii < allLCs.size(); ii++) {
150 if (t_lc::includesCode(allLCs[ii])) {
151 codeLCs.push_back(allLCs[ii]);
152 }
153 }
154
155 vector<t_lc::type> answ;
156 if (codeLCs.size() == 1) {
157 answ.push_back(codeLCs[0]);
158 }
159 else if (codeLCs.size() > 1) {
160 answ.push_back(t_lc::c1);
161 answ.push_back(t_lc::c2);
162 }
163
164 return answ;
165}
[8905]166
167
Note: See TracBrowser for help on using the repository browser.