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 | *
|
---|
29 | * Class: t_pppWidgets
|
---|
30 | *
|
---|
31 | * Purpose: This class stores widgets for PPP options
|
---|
32 | *
|
---|
33 | * Author: L. Mervart
|
---|
34 | *
|
---|
35 | * Created: 29-Jul-2014
|
---|
36 | *
|
---|
37 | * Changes:
|
---|
38 | *
|
---|
39 | * -----------------------------------------------------------------------*/
|
---|
40 |
|
---|
41 | #include <iostream>
|
---|
42 |
|
---|
43 | #include <QCheckBox>
|
---|
44 | #include <QComboBox>
|
---|
45 | #include <QHeaderView>
|
---|
46 | #include <QLineEdit>
|
---|
47 | #include <QPushButton>
|
---|
48 | #include <QRadioButton>
|
---|
49 | #include <QSpinBox>
|
---|
50 | #include <QTableWidget>
|
---|
51 |
|
---|
52 | #include "pppWidgets.h"
|
---|
53 | #include "qtfilechooser.h"
|
---|
54 | #include "bncsettings.h"
|
---|
55 | #include "bnccore.h"
|
---|
56 |
|
---|
57 | using namespace std;
|
---|
58 |
|
---|
59 | // Constructor
|
---|
60 | ////////////////////////////////////////////////////////////////////////////
|
---|
61 | t_pppWidgets::t_pppWidgets() {
|
---|
62 |
|
---|
63 | _dataSource = new QComboBox(); _dataSource ->setObjectName("PPP/dataSource"); _widgets << _dataSource;
|
---|
64 | _rinexObs = new qtFileChooser(); _rinexObs ->setObjectName("PPP/rinexObs"); _widgets << _rinexObs;
|
---|
65 | _rinexNav = new qtFileChooser(); _rinexNav ->setObjectName("PPP/rinexNav"); _widgets << _rinexNav;
|
---|
66 | _corrMount = new QLineEdit(); _corrMount ->setObjectName("PPP/corrMount"); _widgets << _corrMount;
|
---|
67 | _ionoMount = new QLineEdit(); _ionoMount ->setObjectName("PPP/ionoMount"); _widgets << _ionoMount;
|
---|
68 | _corrFile = new qtFileChooser(); _corrFile ->setObjectName("PPP/corrFile"); _widgets << _corrFile;
|
---|
69 | _ionoFile = new qtFileChooser(); _ionoFile ->setObjectName("PPP/ionoFile"); _widgets << _ionoFile;
|
---|
70 | _crdFile = new qtFileChooser(); _crdFile ->setObjectName("PPP/crdFile"); _widgets << _crdFile;
|
---|
71 | _antexFile = new qtFileChooser(); _antexFile ->setObjectName("PPP/antexFile"); _widgets << _antexFile;
|
---|
72 | _blqFile = new qtFileChooser(); _blqFile ->setObjectName("PPP/blqFile"); _widgets << _blqFile;
|
---|
73 | _logPath = new QLineEdit(); _logPath ->setObjectName("PPP/logPath"); _widgets << _logPath;
|
---|
74 | _nmeaPath = new QLineEdit(); _nmeaPath ->setObjectName("PPP/nmeaPath"); _widgets << _nmeaPath;
|
---|
75 | _snxtroPath = new QLineEdit(); _snxtroPath ->setObjectName("PPP/snxtroPath"); _widgets << _snxtroPath;
|
---|
76 | _snxtroSampl = new QComboBox(); _snxtroSampl->setObjectName("PPP/snxtroSampl"); _widgets << _snxtroSampl;
|
---|
77 | _snxtroIntr = new QComboBox(); _snxtroIntr ->setObjectName("PPP/snxtroIntr"); _widgets << _snxtroIntr;
|
---|
78 | _snxtroAc = new QLineEdit(); _snxtroAc ->setObjectName("PPP/snxtroAc"); _widgets << _snxtroAc;
|
---|
79 | _snxtroSolId = new QLineEdit(); _snxtroSolId ->setObjectName("PPP/snxtroSolId"); _widgets << _snxtroSolId;
|
---|
80 | _snxtroSolType= new QLineEdit(); _snxtroSolType->setObjectName("PPP/snxtroSolType");_widgets << _snxtroSolType;
|
---|
81 | _snxtroCampId = new QLineEdit(); _snxtroCampId ->setObjectName("PPP/snxtroCampId"); _widgets << _snxtroCampId;
|
---|
82 | _staTable = new QTableWidget(); _staTable ->setObjectName("PPP/staTable"); _widgets << _staTable;
|
---|
83 | _lcGPS = new QComboBox(); _lcGPS ->setObjectName("PPP/lcGPS"); _widgets << _lcGPS;
|
---|
84 | _lcGLONASS = new QComboBox(); _lcGLONASS ->setObjectName("PPP/lcGLONASS"); _widgets << _lcGLONASS;
|
---|
85 | _lcGalileo = new QComboBox(); _lcGalileo ->setObjectName("PPP/lcGalileo"); _widgets << _lcGalileo;
|
---|
86 | _lcBDS = new QComboBox(); _lcBDS ->setObjectName("PPP/lcBDS"); _widgets << _lcBDS;
|
---|
87 | _constraints = new QComboBox(); _constraints ->setObjectName("PPP/constraints"); _widgets << _constraints;
|
---|
88 | _sigmaC1 = new QLineEdit(); _sigmaC1 ->setObjectName("PPP/sigmaC1"); _widgets << _sigmaC1;
|
---|
89 | _sigmaL1 = new QLineEdit(); _sigmaL1 ->setObjectName("PPP/sigmaL1"); _widgets << _sigmaL1;
|
---|
90 | _sigmaGIM = new QLineEdit(); _sigmaGIM ->setObjectName("PPP/sigmaGIM"); _widgets << _sigmaGIM;
|
---|
91 | _maxResC1 = new QLineEdit(); _maxResC1 ->setObjectName("PPP/maxResC1"); _widgets << _maxResC1;
|
---|
92 | _maxResL1 = new QLineEdit(); _maxResL1 ->setObjectName("PPP/maxResL1"); _widgets << _maxResL1;
|
---|
93 | _maxResGIM = new QLineEdit(); _maxResGIM ->setObjectName("PPP/maxResGIM"); _widgets << _maxResGIM;
|
---|
94 | _minObs = new QSpinBox(); _minObs ->setObjectName("PPP/minObs"); _widgets << _minObs;
|
---|
95 | _minEle = new QSpinBox(); _minEle ->setObjectName("PPP/minEle"); _widgets << _minEle;
|
---|
96 | _eleWgtCode = new QCheckBox(); _eleWgtCode ->setObjectName("PPP/eleWgtCode"); _widgets << _eleWgtCode;
|
---|
97 | _eleWgtPhase = new QCheckBox(); _eleWgtPhase ->setObjectName("PPP/eleWgtPhase"); _widgets << _eleWgtPhase;
|
---|
98 | _seedingTime = new QLineEdit(); _seedingTime ->setObjectName("PPP/seedingTime"); _widgets << _seedingTime;
|
---|
99 | _corrWaitTime = new QSpinBox(); _corrWaitTime->setObjectName("PPP/corrWaitTime"); _widgets << _corrWaitTime;
|
---|
100 |
|
---|
101 | _addStaButton = new QPushButton("Add Station"); _widgets << _addStaButton;
|
---|
102 | _delStaButton = new QPushButton("Delete Station"); _widgets << _delStaButton;
|
---|
103 |
|
---|
104 | _addStaButton->setWhatsThis(tr("<p>Hit the 'Add Station' button to add a new line to the Station table.</p>"));
|
---|
105 | _delStaButton->setWhatsThis(tr("<p>Hit the 'Delete Station' button to delete a highlighted row from the Station table.</p>"));
|
---|
106 |
|
---|
107 | _plotCoordinates = new QLineEdit; _plotCoordinates ->setObjectName("PPP/plotCoordinates"); _widgets << _plotCoordinates;
|
---|
108 | _mapWinButton = new QPushButton; _mapWinButton ->setObjectName("PPP/mapWinButton"); _widgets << _mapWinButton;
|
---|
109 | _audioResponse = new QLineEdit; _audioResponse ->setObjectName("PPP/audioResponse"); _widgets << _audioResponse;
|
---|
110 | _mapWinDotSize = new QLineEdit; _mapWinDotSize ->setObjectName("PPP/mapWinDotSize"); _widgets << _mapWinDotSize;
|
---|
111 | _mapWinDotColor = new QComboBox; _mapWinDotColor ->setObjectName("PPP/mapWinDotColor"); _widgets << _mapWinDotColor;
|
---|
112 | _mapSpeedSlider = new QSlider; _mapSpeedSlider ->setObjectName("PPP/mapSpeedSlider"); _widgets << _mapSpeedSlider;
|
---|
113 |
|
---|
114 | _dataSource->setEditable(false);
|
---|
115 | _dataSource->addItems(QString(",Real-Time Streams,RINEX Files").split(","));
|
---|
116 | connect(_dataSource, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(slotEnableWidgets()));
|
---|
117 | connect(_constraints, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(slotEnableWidgets()));
|
---|
118 | connect(_snxtroPath, SIGNAL(textChanged(const QString &)), this, SLOT(slotPPPTextChanged()));
|
---|
119 | connect(_snxtroAc, SIGNAL(textChanged(const QString &)), this, SLOT(slotPPPTextChanged()));
|
---|
120 | connect(_snxtroSolId, SIGNAL(textChanged(const QString &)), this, SLOT(slotPPPTextChanged()));
|
---|
121 | connect(_snxtroSolType, SIGNAL(textChanged(const QString &)), this, SLOT(slotPPPTextChanged()));
|
---|
122 | connect(_snxtroCampId, SIGNAL(textChanged(const QString &)), this, SLOT(slotPPPTextChanged()));
|
---|
123 |
|
---|
124 | slotEnableWidgets();
|
---|
125 |
|
---|
126 | _lcGPS->setEditable(false);
|
---|
127 | #ifdef USE_PPP_SSR_I
|
---|
128 | _lcGPS->addItems(QString("P3,P3&L3").split(","));
|
---|
129 | #else
|
---|
130 | _lcGPS->addItems(QString("Pi&Li,Pi,Li,P1&L1,P1,L1,P3&L3,P3,L3,no").split(","));
|
---|
131 | #endif
|
---|
132 |
|
---|
133 | _lcGLONASS->setEditable(false);
|
---|
134 | #ifdef USE_PPP_SSR_I
|
---|
135 | _lcGLONASS->addItems(QString("no,P3,L3,P3&L3").split(","));
|
---|
136 | #else
|
---|
137 | _lcGLONASS->addItems(QString("Pi&Li,Pi,Li,P1&L1,P1,L1,P3&L3,P3,L3,no").split(","));
|
---|
138 | #endif
|
---|
139 |
|
---|
140 | _lcGalileo->setEditable(false);
|
---|
141 | #ifdef USE_PPP_SSR_I
|
---|
142 | _lcGalileo->addItems(QString("no,P3,L3,P3&L3").split(","));
|
---|
143 | #else
|
---|
144 | _lcGalileo->addItems(QString("Pi&Li,Pi,Li,P1&L1,P1,L1,P3&L3,P3,L3,no").split(","));
|
---|
145 | #endif
|
---|
146 |
|
---|
147 | _lcBDS->setEditable(false);
|
---|
148 | #ifdef USE_PPP_SSR_I
|
---|
149 | _lcBDS->addItems(QString("no,P3,L3,P3&L3").split(","));
|
---|
150 | #else
|
---|
151 | _lcBDS->addItems(QString("Pi&Li,Pi,Li,P1&L1,P1,L1,P3&L3,P3,L3,no").split(","));
|
---|
152 | #endif
|
---|
153 |
|
---|
154 | #ifdef USE_PPP
|
---|
155 | _constraints->setEditable(false);
|
---|
156 | _constraints->addItems(QString("no,Ionosphere: pseudo-obs").split(","));
|
---|
157 | #endif
|
---|
158 | _snxtroSampl->setEditable(false);
|
---|
159 | _snxtroSampl->addItems(QString("1 sec,5 sec,10 sec,30 sec,60 sec,300 sec").split(","));
|
---|
160 |
|
---|
161 | _snxtroIntr->setEditable(false);
|
---|
162 | _snxtroIntr->addItems(QString("1 min,2 min,5 min,10 min,15 min,30 min,1 hour,1 day").split(","));
|
---|
163 | _snxtroIntr->setCurrentIndex(6);
|
---|
164 |
|
---|
165 | _minObs->setMinimum(4);
|
---|
166 | _minObs->setMaximum(6);
|
---|
167 | _minObs->setSingleStep(1);
|
---|
168 |
|
---|
169 | _minEle->setMinimum(0);
|
---|
170 | _minEle->setMaximum(20);
|
---|
171 | _minEle->setSingleStep(1);
|
---|
172 | _minEle->setSuffix(" deg");
|
---|
173 |
|
---|
174 | _corrWaitTime->setMinimum(0);
|
---|
175 | _corrWaitTime->setMaximum(20);
|
---|
176 | _corrWaitTime->setSingleStep(1);
|
---|
177 | _corrWaitTime->setSuffix(" sec");
|
---|
178 |
|
---|
179 | _staTable->setColumnCount(11);
|
---|
180 | _staTable->setRowCount(0);
|
---|
181 | _staTable->setHorizontalHeaderLabels(
|
---|
182 | QString("Station,Sigma N,Sigma E,Sigma H,Noise N,Noise E,Noise H,Tropo Sigma,Tropo Noise, NMEA Port,Signal Priorities").split(","));
|
---|
183 | _staTable->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
---|
184 | _staTable->setSelectionBehavior(QAbstractItemView::SelectRows);
|
---|
185 | _staTable->setColumnWidth(0,120);
|
---|
186 | _staTable->setColumnWidth(10,220);
|
---|
187 | #if QT_VERSION >= 0x050000
|
---|
188 | _staTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
|
---|
189 | #endif
|
---|
190 | _staTable->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft);
|
---|
191 | connect(_addStaButton, SIGNAL(clicked()), this, SLOT(slotAddStation()));
|
---|
192 | connect(_delStaButton, SIGNAL(clicked()), this, SLOT(slotDelStation()));
|
---|
193 |
|
---|
194 | _mapWinButton->setText("Open Map");
|
---|
195 |
|
---|
196 | _mapWinDotColor->setEditable(false);
|
---|
197 | _mapWinDotColor->addItems(QString("red,yellow").split(","));
|
---|
198 |
|
---|
199 | _mapSpeedSlider->setOrientation(Qt::Horizontal);
|
---|
200 | _mapSpeedSlider->setRange(1, 100);
|
---|
201 | _mapSpeedSlider->setTickPosition(QSlider::TicksBelow);
|
---|
202 | _mapSpeedSlider->setTickInterval(10);
|
---|
203 | connect(_mapSpeedSlider, SIGNAL(valueChanged(int)), BNC_CORE, SIGNAL(mapSpeedSliderChanged(int)));
|
---|
204 |
|
---|
205 | // WhatsThis, PPP (2)
|
---|
206 | // ------------------
|
---|
207 | _corrWaitTime->setWhatsThis(tr("<p>Zero value means that BNC processes each epoch of data immediately after its arrival using satellite clock corrections available at that time.</p><p> Specifying a non-zero value (i.e. 5 sec) means that the epochs of data are buffered and the processing of each epoch is postponed till the satellite clock corrections not older than '5 sec' (example) become available. <i>[key: PPP/corrWaitTime]</i><p>"));
|
---|
208 | _seedingTime->setWhatsThis(tr("<p>Enter the length of a startup period in seconds for which you want to fix the PPP solutions to known a priori coordinates as introduced through option 'Coordinates file'. Adjust 'Sigma N/E/H' in the PPP Stations table according to the coordinate's precision. Fixing a priori coordinates is done in BNC through setting 'Noise N/E/H' temporarily to zero.</p><p>This option allows the PPP solution to rapidly converge. It requires that the antenna remains unmoved on the a priori known position throughout the startup period.</p><p>A value of 60 is likely to be an appropriate choice.</p><p>Default is an empty option field, meaning that you don't want BNC to fix PPP solutions during startup to an a priori coordinate. <i>[key: PPP/seedingTime]</i></p>"));
|
---|
209 |
|
---|
210 | // WhatsThis, PPP (3)
|
---|
211 | // ------------------
|
---|
212 | #ifdef USE_PPP
|
---|
213 | _staTable->setWhatsThis(tr("<p>Specify values for Sigma and white Noise of the Stations North, East and Height coordinate components in meters. Specify also a Sigma in meters for a priori model based Tropospheric delays and a Sigma in meters per second for the delay's Noise. You can also specify a 'NMEA Port' to output coordinates in NMEA format through an IP port of your local host. Specify a list of signal priorities for the observations that shall be used for PPP.</p>"
|
---|
214 | "<p>'Sigma' is meant to describe the uncertainty of a single coordinate or tropospheric delay estimated for one epoch. 'Noise' is meant to describe the variation of estimates from epoch to epoch.</p><p><ul><li>A Sigma of 100.0 meters may be an appropriate choice e.g. for the initial N/E/H coordinates. However, this value may be significantly smaller (i.e. 0.01) for stations with well-known a priori coordinates.</li><li>A Noise of 100.0 meters for the estimated N/E/H coordinates may also be appropriate considering the potential movement of a rover position.</li><li>A value of 0.1 meters may be an appropriate Sigma for the a priori model based Tropospheric delay estimation.</li><li>Specify a Noise to describe the expected variation of the tropospheric effect over time. Supposing 1Hz observation data, specifying a value of 3e-6 would mean that the tropospheric effect may vary 3600 * 3e-6 = 0.01 meters per hour.</li></ul></p>"
|
---|
215 | "<p>'Signal Priorities' can be specified as system (G,R,E,C) and frequency specific. Two frequency bands per GNSS are allowed and will be considered. The following frequency bands are available for selection: <ul>"
|
---|
216 | "<li>G: 1, 2, 5</li>"
|
---|
217 | "<li>R: 1, 2</li>"
|
---|
218 | "<li>E: 1, 5, 6, 7, 8</li>"
|
---|
219 | "<li>C: 1, 2, 5, 6, 7, 8</li>"
|
---|
220 | "</ul>"
|
---|
221 | "<p>'Default is the following list of 'Signal Priorities': <ul><li>'G:12&CWPSLX R:12&CP E:1&CBX E:5&QIX C:26&IQX'</li></ul>"
|
---|
222 | "<p>But it is recommended to specify it in more detail per individual station, e.g.:</p> <ul> <li>'G:12&W R:12&P E:1&C E:5&Q C:26&I'</li></ul> "
|
---|
223 | "<p> <i>[key: PPP/staTable]</i></p>"));
|
---|
224 | #else
|
---|
225 | _staTable->setWhatsThis(tr("<p>Specify values for Sigma and white Noise of the Stations North, East and Height coordinate components in meters. Specify also a Sigma in meters for a priori model based Tropospheric delays and a Sigma in meters per second for the delay's Noise. You can also specify a 'NMEA Port' to output coordinates in NMEA format through an IP port of your local host.<i>[key: PPP/staTable]</i></p>"));
|
---|
226 | #endif
|
---|
227 | // WhatsThis, PPP (4)
|
---|
228 | // ------------------
|
---|
229 | _plotCoordinates->setWhatsThis(tr("<p>For one of your PPP Stations BNC can produce a time series plot of coordinate displacements in the 'PPP Plot' tab below. Specify a 'Mountpoint' (when in 'Real-Time Streams' mode) or the 9/4-character station ID (when in 'RINEX Files' mode) to define the station whose coordinate displacements you would like to see plotted.</p><p>Note that this option makes only sense for a stationary receiver with known a priori marker coordinates as specified through PPP option 'Coordinates file'.</p><p>Default is an empty option field, meaning that BNC shall not produce a time series plot of PPP coordinate displacements. <i>[key: PPP/plotCoordinates]</i></p>"));
|
---|
230 | _audioResponse->setWhatsThis(tr("<p>Specify an 'Audio response' threshold in meters. A beep is produced by BNC whenever a horizontal PPP coordinate component differs by more than the threshold value from the a priori marker coordinate.</p><p>Default is an empty option field, meaning that you don't want BNC to produce alarm signals. <i>[key: PPP/audioResponse]</i></p>"));
|
---|
231 | _mapWinButton->setWhatsThis(tr("<p>You may like to track your rover position using Open Street Map as a background map. A 'Track map' can be produced with BNC in 'Real-Time Streams' or 'RINEX files' PPP mode.</p><p>The 'Open Map' button opens a windows showing a map according to specified options.</p><p>Even in 'RINEX files' post processing mode you should not forget to specify a proxy under the 'Network' tab if that is operated in front of BNC because the program needs to download the map data. Without any entry, BNC will try to use the system proxies.</p>"));
|
---|
232 | _mapWinDotSize->setWhatsThis(tr("<p>Specify the size of dots showing rover positions on the track map.</p><p>A dot size of '3' may be appropriate. The maximum possible dot size is '10'. An empty option field or a size of '0' would mean that you don't want BNC to show the rover's track on the map. <i>[key: PPP/mapWinDotSize]</i></p>"));
|
---|
233 | _mapWinDotColor->setWhatsThis(tr("<p>Specify the color of dots showing the rover track on the map. <i>[key: PPP/mapWinDotColor]</i></p>"));
|
---|
234 | _mapSpeedSlider->setWhatsThis(tr("<p>With BNC in 'RINEX files' PPP post processing mode you can specify the speed of computations as appropriate for 'Track map' visualization.</p><p>Note that you can adjust 'Post-processing speed' on-the-fly while BNC is already processing your observations. <i>[key: PPP/mapSpeedSlider]</i></p>"));
|
---|
235 |
|
---|
236 | readOptions();
|
---|
237 | }
|
---|
238 |
|
---|
239 | //
|
---|
240 | ////////////////////////////////////////////////////////////////////////////
|
---|
241 | t_pppWidgets::~t_pppWidgets() {
|
---|
242 | delete _dataSource;
|
---|
243 | delete _rinexObs;
|
---|
244 | delete _rinexNav;
|
---|
245 | delete _corrMount;
|
---|
246 | delete _ionoMount;
|
---|
247 | delete _corrFile;
|
---|
248 | delete _ionoFile;
|
---|
249 | delete _crdFile;
|
---|
250 | delete _antexFile;
|
---|
251 | delete _blqFile;
|
---|
252 | delete _logPath;
|
---|
253 | delete _nmeaPath;
|
---|
254 | delete _snxtroPath;
|
---|
255 | delete _snxtroSampl;
|
---|
256 | delete _snxtroIntr;
|
---|
257 | delete _snxtroAc;
|
---|
258 | delete _snxtroSolId;
|
---|
259 | delete _snxtroSolType;
|
---|
260 | delete _snxtroCampId;
|
---|
261 | for (int iRow = _staTable->rowCount()-1; iRow >=0; iRow--) {
|
---|
262 | _staTable->removeRow(iRow);
|
---|
263 | }
|
---|
264 | delete _staTable;
|
---|
265 | delete _lcGPS;
|
---|
266 | delete _lcGLONASS;
|
---|
267 | delete _lcGalileo;
|
---|
268 | delete _lcBDS;
|
---|
269 | delete _constraints;
|
---|
270 | delete _sigmaC1;
|
---|
271 | delete _sigmaL1;
|
---|
272 | delete _sigmaGIM;
|
---|
273 | delete _maxResC1;
|
---|
274 | delete _maxResL1;
|
---|
275 | delete _maxResGIM;
|
---|
276 | delete _minObs;
|
---|
277 | delete _minEle;
|
---|
278 | delete _eleWgtCode;
|
---|
279 | delete _eleWgtPhase;
|
---|
280 | delete _seedingTime;
|
---|
281 | delete _corrWaitTime;
|
---|
282 | delete _addStaButton;
|
---|
283 | delete _delStaButton;
|
---|
284 | delete _plotCoordinates;
|
---|
285 | delete _mapWinButton;
|
---|
286 | delete _audioResponse;
|
---|
287 | delete _mapWinDotSize;
|
---|
288 | delete _mapWinDotColor;
|
---|
289 | delete _mapSpeedSlider;
|
---|
290 | }
|
---|
291 |
|
---|
292 | //
|
---|
293 | ////////////////////////////////////////////////////////////////////////////
|
---|
294 | void t_pppWidgets::readOptions() {
|
---|
295 |
|
---|
296 | bncSettings settings;
|
---|
297 |
|
---|
298 | // ComboBoxes
|
---|
299 | // ----------
|
---|
300 | int ii = _dataSource->findText(settings.value(_dataSource->objectName()).toString());
|
---|
301 | if (ii != -1) {
|
---|
302 | _dataSource->setCurrentIndex(ii);
|
---|
303 | }
|
---|
304 | ii = _lcGPS->findText(settings.value(_lcGPS->objectName()).toString());
|
---|
305 | if (ii != -1) {
|
---|
306 | _lcGPS->setCurrentIndex(ii);
|
---|
307 | }
|
---|
308 | ii = _lcGLONASS->findText(settings.value(_lcGLONASS->objectName()).toString());
|
---|
309 | if (ii != -1) {
|
---|
310 | _lcGLONASS->setCurrentIndex(ii);
|
---|
311 | }
|
---|
312 | ii = _lcGalileo->findText(settings.value(_lcGalileo->objectName()).toString());
|
---|
313 | if (ii != -1) {
|
---|
314 | _lcGalileo->setCurrentIndex(ii);
|
---|
315 | }
|
---|
316 | ii = _lcBDS->findText(settings.value(_lcBDS->objectName()).toString());
|
---|
317 | if (ii != -1) {
|
---|
318 | _lcBDS->setCurrentIndex(ii);
|
---|
319 | }
|
---|
320 | ii = _constraints->findText(settings.value(_constraints->objectName()).toString());
|
---|
321 | if (ii != -1) {
|
---|
322 | _constraints->setCurrentIndex(ii);
|
---|
323 | }
|
---|
324 | ii = _snxtroIntr->findText(settings.value(_snxtroIntr->objectName()).toString());
|
---|
325 | if (ii != -1) {
|
---|
326 | _snxtroIntr->setCurrentIndex(ii);
|
---|
327 | }
|
---|
328 |
|
---|
329 | // FileChoosers
|
---|
330 | // ------------
|
---|
331 | _rinexObs ->setFileName(settings.value(_rinexObs ->objectName()).toString());
|
---|
332 | _rinexNav ->setFileName(settings.value(_rinexNav ->objectName()).toString());
|
---|
333 | _corrFile ->setFileName(settings.value(_corrFile ->objectName()).toString());
|
---|
334 | _ionoFile ->setFileName(settings.value(_ionoFile ->objectName()).toString());
|
---|
335 | _crdFile ->setFileName(settings.value(_crdFile ->objectName()).toString());
|
---|
336 | _antexFile->setFileName(settings.value(_antexFile->objectName()).toString());
|
---|
337 | _blqFile->setFileName(settings.value(_blqFile->objectName()).toString());
|
---|
338 |
|
---|
339 | // LineEdits
|
---|
340 | // ---------
|
---|
341 | _corrMount ->setText(settings.value(_corrMount ->objectName()).toString());
|
---|
342 | _ionoMount ->setText(settings.value(_ionoMount ->objectName()).toString());
|
---|
343 | _logPath ->setText(settings.value(_logPath ->objectName()).toString());
|
---|
344 | _nmeaPath ->setText(settings.value(_nmeaPath ->objectName()).toString());
|
---|
345 | _snxtroPath ->setText(settings.value(_snxtroPath ->objectName()).toString());
|
---|
346 | _snxtroAc ->setText(settings.value(_snxtroAc ->objectName()).toString());
|
---|
347 | _snxtroSolId ->setText(settings.value(_snxtroSolId ->objectName()).toString());
|
---|
348 | _snxtroSolType->setText(settings.value(_snxtroSolType ->objectName()).toString());
|
---|
349 | _snxtroCampId ->setText(settings.value(_snxtroCampId ->objectName()).toString());
|
---|
350 |
|
---|
351 | if (!settings.value(_sigmaC1->objectName()).toString().isEmpty()) {
|
---|
352 | _sigmaC1->setText(settings.value(_sigmaC1->objectName()).toString());
|
---|
353 | }
|
---|
354 | else {
|
---|
355 | _sigmaC1->setText("1.0");
|
---|
356 | }
|
---|
357 |
|
---|
358 | if (!settings.value(_sigmaL1->objectName()).toString().isEmpty()) {
|
---|
359 | _sigmaL1->setText(settings.value(_sigmaL1->objectName()).toString());
|
---|
360 | }
|
---|
361 | else {
|
---|
362 | _sigmaL1->setText("0.01");
|
---|
363 | }
|
---|
364 |
|
---|
365 | if (!settings.value(_sigmaGIM->objectName()).toString().isEmpty()) {
|
---|
366 | _sigmaGIM->setText(settings.value(_sigmaGIM->objectName()).toString());
|
---|
367 | }
|
---|
368 | else {
|
---|
369 | _sigmaGIM->setText("1.0");
|
---|
370 | }
|
---|
371 |
|
---|
372 | if (!settings.value(_maxResC1->objectName()).toString().isEmpty()) {
|
---|
373 | _maxResC1->setText(settings.value(_maxResC1->objectName()).toString());
|
---|
374 | }
|
---|
375 | else {
|
---|
376 | _maxResC1->setText("2.0");
|
---|
377 | }
|
---|
378 |
|
---|
379 | if (!settings.value(_maxResL1->objectName()).toString().isEmpty()) {
|
---|
380 | _maxResL1->setText(settings.value(_maxResL1->objectName()).toString());
|
---|
381 | }
|
---|
382 | else {
|
---|
383 | _maxResL1->setText("0.02");
|
---|
384 | }
|
---|
385 |
|
---|
386 | if (!settings.value(_maxResGIM->objectName()).toString().isEmpty()) {
|
---|
387 | _maxResGIM->setText(settings.value(_maxResGIM->objectName()).toString());
|
---|
388 | }
|
---|
389 | else {
|
---|
390 | _maxResGIM->setText("2.0");
|
---|
391 | }
|
---|
392 |
|
---|
393 |
|
---|
394 | if (!settings.value(_seedingTime->objectName()).toString().isEmpty()) {
|
---|
395 | _seedingTime->setText(settings.value(_seedingTime->objectName()).toString());
|
---|
396 | }
|
---|
397 | else {
|
---|
398 | _seedingTime->setText("0");
|
---|
399 | }
|
---|
400 |
|
---|
401 | // CheckBoxes
|
---|
402 | // ----------
|
---|
403 | _eleWgtCode ->setCheckState(Qt::CheckState(settings.value(_eleWgtCode ->objectName()).toInt()));
|
---|
404 | _eleWgtPhase->setCheckState(Qt::CheckState(settings.value(_eleWgtPhase->objectName()).toInt()));
|
---|
405 |
|
---|
406 | // SpinBoxex
|
---|
407 | // ---------
|
---|
408 | _minObs->setValue(settings.value(_minObs->objectName()).toInt());
|
---|
409 | _minEle->setValue(settings.value(_minEle->objectName()).toInt());
|
---|
410 | _corrWaitTime->setValue(settings.value(_corrWaitTime->objectName()).toInt());
|
---|
411 |
|
---|
412 |
|
---|
413 | ii = _snxtroSampl->findText(settings.value(_snxtroSampl->objectName()).toString());
|
---|
414 | if (ii != -1) {
|
---|
415 | _snxtroSampl->setCurrentIndex(ii);
|
---|
416 | }
|
---|
417 |
|
---|
418 | // Table with stations
|
---|
419 | // -------------------
|
---|
420 | for (int iRow = _staTable->rowCount()-1; iRow >=0; iRow--) {
|
---|
421 | _staTable->removeRow(iRow);
|
---|
422 | }
|
---|
423 | int iRow = -1;
|
---|
424 | QListIterator<QString> it(settings.value(_staTable->objectName()).toStringList());
|
---|
425 | while (it.hasNext()) {
|
---|
426 | QStringList hlp = it.next().split(",");
|
---|
427 | ++iRow;
|
---|
428 | _staTable->insertRow(iRow);
|
---|
429 | for (int iCol = 0; iCol < hlp.size(); iCol++) {
|
---|
430 | _staTable->setItem(iRow, iCol, new QTableWidgetItem(hlp[iCol]));
|
---|
431 | }
|
---|
432 | }
|
---|
433 |
|
---|
434 | // Plots and Maps
|
---|
435 | // --------------
|
---|
436 | _plotCoordinates ->setText(settings.value(_plotCoordinates->objectName()).toString());
|
---|
437 | _audioResponse ->setText(settings.value(_audioResponse->objectName()).toString());
|
---|
438 | _mapWinDotSize ->setText(settings.value(_mapWinDotSize->objectName()).toString());
|
---|
439 |
|
---|
440 | ii = _mapWinDotColor->findText(settings.value(_mapWinDotColor->objectName()).toString());
|
---|
441 | if (ii != -1) {
|
---|
442 | _mapWinDotColor->setCurrentIndex(ii);
|
---|
443 | }
|
---|
444 |
|
---|
445 | int speed = settings.value(_mapSpeedSlider->objectName()).toInt();
|
---|
446 | if (speed == 0) speed = _mapSpeedSlider->maximum();
|
---|
447 | _mapSpeedSlider->setSliderPosition(speed);
|
---|
448 | }
|
---|
449 |
|
---|
450 | //
|
---|
451 | ////////////////////////////////////////////////////////////////////////////
|
---|
452 | void t_pppWidgets::saveOptions() {
|
---|
453 |
|
---|
454 | bncSettings settings;
|
---|
455 |
|
---|
456 | settings.setValue(_dataSource ->objectName(), _dataSource ->currentText());
|
---|
457 | settings.setValue(_rinexObs ->objectName(), _rinexObs ->fileName());
|
---|
458 | settings.setValue(_rinexNav ->objectName(), _rinexNav ->fileName());
|
---|
459 | settings.setValue(_corrMount ->objectName(), _corrMount ->text());
|
---|
460 | settings.setValue(_ionoMount ->objectName(), _ionoMount ->text());
|
---|
461 | settings.setValue(_corrFile ->objectName(), _corrFile ->fileName());
|
---|
462 | settings.setValue(_ionoFile ->objectName(), _ionoFile ->fileName());
|
---|
463 | settings.setValue(_crdFile ->objectName(), _crdFile ->fileName());
|
---|
464 | settings.setValue(_antexFile ->objectName(), _antexFile ->fileName());
|
---|
465 | settings.setValue(_blqFile ->objectName(), _blqFile ->fileName());
|
---|
466 | settings.setValue(_logPath ->objectName(), _logPath ->text());
|
---|
467 | settings.setValue(_nmeaPath ->objectName(), _nmeaPath ->text());
|
---|
468 | settings.setValue(_snxtroPath ->objectName(), _snxtroPath ->text());
|
---|
469 | settings.setValue(_snxtroSampl ->objectName(), _snxtroSampl ->currentText());
|
---|
470 | settings.setValue(_snxtroIntr ->objectName(), _snxtroIntr ->currentText());
|
---|
471 | settings.setValue(_snxtroAc ->objectName(), _snxtroAc ->text());
|
---|
472 | settings.setValue(_snxtroSolId ->objectName(), _snxtroSolId ->text());
|
---|
473 | settings.setValue(_snxtroSolType->objectName(), _snxtroSolType ->text());
|
---|
474 | settings.setValue(_snxtroCampId ->objectName(), _snxtroCampId ->text());
|
---|
475 | settings.setValue(_lcGPS ->objectName(), _lcGPS ->currentText());
|
---|
476 | settings.setValue(_lcGLONASS ->objectName(), _lcGLONASS ->currentText());
|
---|
477 | settings.setValue(_lcGalileo ->objectName(), _lcGalileo ->currentText());
|
---|
478 | settings.setValue(_lcBDS ->objectName(), _lcBDS ->currentText());
|
---|
479 | settings.setValue(_constraints ->objectName(), _constraints ->currentText());
|
---|
480 | settings.setValue(_sigmaC1 ->objectName(), _sigmaC1 ->text());
|
---|
481 | settings.setValue(_sigmaL1 ->objectName(), _sigmaL1 ->text());
|
---|
482 | settings.setValue(_sigmaGIM ->objectName(), _sigmaGIM ->text());
|
---|
483 | settings.setValue(_corrWaitTime->objectName(), _corrWaitTime->value());
|
---|
484 | settings.setValue(_maxResC1 ->objectName(), _maxResC1 ->text());
|
---|
485 | settings.setValue(_maxResL1 ->objectName(), _maxResL1 ->text());
|
---|
486 | settings.setValue(_maxResGIM ->objectName(), _maxResGIM ->text());
|
---|
487 | settings.setValue(_seedingTime ->objectName(), _seedingTime ->text());
|
---|
488 | settings.setValue(_minObs ->objectName(), _minObs ->value());
|
---|
489 | settings.setValue(_minEle ->objectName(), _minEle ->value());
|
---|
490 | settings.setValue(_eleWgtCode ->objectName(), _eleWgtCode ->checkState());
|
---|
491 | settings.setValue(_eleWgtPhase ->objectName(), _eleWgtPhase ->checkState());
|
---|
492 |
|
---|
493 | QStringList staList;
|
---|
494 | for (int iRow = 0; iRow < _staTable->rowCount(); iRow++) {
|
---|
495 | QString hlp;
|
---|
496 | for (int iCol = 0; iCol < _staTable->columnCount(); iCol++) {
|
---|
497 | if (_staTable->item(iRow, iCol)) {
|
---|
498 | hlp += _staTable->item(iRow, iCol)->text() + ",";
|
---|
499 | }
|
---|
500 | }
|
---|
501 | if (!hlp.isEmpty()) {
|
---|
502 | staList << hlp;
|
---|
503 | }
|
---|
504 | }
|
---|
505 | settings.setValue(_staTable->objectName(), staList);
|
---|
506 |
|
---|
507 | settings.setValue(_plotCoordinates ->objectName(), _plotCoordinates ->text());
|
---|
508 | settings.setValue(_audioResponse ->objectName(), _audioResponse ->text());
|
---|
509 | settings.setValue(_mapWinDotSize ->objectName(), _mapWinDotSize ->text());
|
---|
510 | settings.setValue(_mapWinDotColor ->objectName(), _mapWinDotColor ->currentText());
|
---|
511 | settings.setValue(_mapSpeedSlider ->objectName(), _mapSpeedSlider ->value());
|
---|
512 | }
|
---|
513 |
|
---|
514 | //
|
---|
515 | ////////////////////////////////////////////////////////////////////////////
|
---|
516 | void t_pppWidgets::slotEnableWidgets() {
|
---|
517 |
|
---|
518 | const static QPalette paletteWhite(QColor(255, 255, 255));
|
---|
519 | const static QPalette paletteGray(QColor(230, 230, 230));
|
---|
520 |
|
---|
521 | bool allDisabled = _dataSource->currentText() == "";
|
---|
522 | bool realTime = _dataSource->currentText() == "Real-Time Streams";
|
---|
523 | bool rinexFiles = _dataSource->currentText() == "RINEX Files";
|
---|
524 | bool pseudoObsIono = _constraints->currentText() == "Ionosphere: pseudo-obs";
|
---|
525 |
|
---|
526 | QListIterator<QWidget*> it(_widgets);
|
---|
527 | while (it.hasNext()) {
|
---|
528 | QWidget* widget = it.next();
|
---|
529 | widget->setEnabled(!allDisabled);
|
---|
530 | }
|
---|
531 |
|
---|
532 | if (realTime) {
|
---|
533 | _rinexObs->setEnabled(false);
|
---|
534 | _rinexNav->setEnabled(false);
|
---|
535 | _corrFile->setEnabled(false);
|
---|
536 | _ionoFile->setEnabled(false);
|
---|
537 | }
|
---|
538 | else if (rinexFiles) {
|
---|
539 | _corrMount ->setEnabled(false);
|
---|
540 | _ionoMount ->setEnabled(false);
|
---|
541 | _audioResponse->setEnabled(false);
|
---|
542 | }
|
---|
543 |
|
---|
544 | if ( _snxtroPath->text() != "" && !allDisabled) {
|
---|
545 | _snxtroSampl->setEnabled(true);
|
---|
546 | _snxtroIntr ->setEnabled(true);
|
---|
547 | _snxtroAc ->setEnabled(true);
|
---|
548 | _snxtroSolId ->setEnabled(true);
|
---|
549 | _snxtroSolType ->setEnabled(true);
|
---|
550 | _snxtroCampId ->setEnabled(true);
|
---|
551 | }
|
---|
552 | else {
|
---|
553 | _snxtroSampl->setEnabled(false);
|
---|
554 | _snxtroIntr ->setEnabled(false);
|
---|
555 | _snxtroAc ->setEnabled(false);
|
---|
556 | _snxtroSolId ->setEnabled(false);
|
---|
557 | _snxtroSolType ->setEnabled(false);
|
---|
558 | _snxtroCampId ->setEnabled(false);
|
---|
559 | }
|
---|
560 |
|
---|
561 |
|
---|
562 | if (pseudoObsIono) {
|
---|
563 | _sigmaGIM->setEnabled(true);
|
---|
564 | _maxResGIM->setEnabled(true);
|
---|
565 | } else {
|
---|
566 | _sigmaGIM->setEnabled(false);
|
---|
567 | _maxResGIM->setEnabled(false);
|
---|
568 | }
|
---|
569 |
|
---|
570 | _dataSource->setEnabled(true);
|
---|
571 |
|
---|
572 | it.toFront();
|
---|
573 | while (it.hasNext()) {
|
---|
574 | QWidget* widget = it.next();
|
---|
575 | if (widget->isEnabled()) {
|
---|
576 | widget->setPalette(paletteWhite);
|
---|
577 | }
|
---|
578 | else {
|
---|
579 | widget->setPalette(paletteGray);
|
---|
580 | }
|
---|
581 | }
|
---|
582 | }
|
---|
583 |
|
---|
584 | //
|
---|
585 | ////////////////////////////////////////////////////////////////////////////
|
---|
586 | void t_pppWidgets::slotAddStation() {
|
---|
587 | int iRow = _staTable->rowCount();
|
---|
588 | _staTable->insertRow(iRow);
|
---|
589 | QString preferredAttributes = "G:12&CWPSLX R:12&CP E:1&CBX E:5&QIX C:26&IQX";
|
---|
590 |
|
---|
591 | for (int iCol = 0; iCol < _staTable->columnCount(); iCol++) {
|
---|
592 | if (iCol == 0) _staTable->setItem(iRow, iCol, new QTableWidgetItem(""));
|
---|
593 | if (iCol == 1) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
|
---|
594 | if (iCol == 2) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
|
---|
595 | if (iCol == 3) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
|
---|
596 | if (iCol == 4) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
|
---|
597 | if (iCol == 5) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
|
---|
598 | if (iCol == 6) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
|
---|
599 | if (iCol == 7) _staTable->setItem(iRow, iCol, new QTableWidgetItem("0.1"));
|
---|
600 | if (iCol == 8) _staTable->setItem(iRow, iCol, new QTableWidgetItem("3e-6"));
|
---|
601 | if (iCol == 9) _staTable->setItem(iRow, iCol, new QTableWidgetItem("0"));
|
---|
602 | if (iCol == 10) _staTable->setItem(iRow, iCol, new QTableWidgetItem(preferredAttributes));
|
---|
603 | }
|
---|
604 | }
|
---|
605 |
|
---|
606 | //
|
---|
607 | ////////////////////////////////////////////////////////////////////////////
|
---|
608 | void t_pppWidgets::slotDelStation() {
|
---|
609 | int nRows = _staTable->rowCount();
|
---|
610 | std::vector <bool> flg(nRows);
|
---|
611 | for (int iRow = 0; iRow < nRows; iRow++) {
|
---|
612 | if (_staTable->item(iRow,1)->isSelected()) {
|
---|
613 | flg[iRow] = true;
|
---|
614 | }
|
---|
615 | else {
|
---|
616 | flg[iRow] = false;
|
---|
617 | }
|
---|
618 | }
|
---|
619 | for (int iRow = nRows-1; iRow >= 0; iRow--) {
|
---|
620 | if (flg[iRow]) {
|
---|
621 | _staTable->removeRow(iRow);
|
---|
622 | }
|
---|
623 | }
|
---|
624 | }
|
---|
625 |
|
---|
626 | // PPP Text
|
---|
627 | ////////////////////////////////////////////////////////////////////////////
|
---|
628 | void t_pppWidgets::slotPPPTextChanged(){
|
---|
629 |
|
---|
630 | const static QPalette paletteWhite(QColor(255, 255, 255));
|
---|
631 | const static QPalette paletteGray(QColor(230, 230, 230));
|
---|
632 |
|
---|
633 | // SNX TRO file sampling
|
---|
634 | // ---------------------
|
---|
635 | if (sender() == 0 || sender() == _snxtroPath) {
|
---|
636 | if ( _snxtroPath->text() != "" ) {
|
---|
637 | _snxtroSampl->setEnabled(true);
|
---|
638 | _snxtroIntr ->setEnabled(true);
|
---|
639 | _snxtroAc ->setEnabled(true);
|
---|
640 | _snxtroSolId ->setEnabled(true);
|
---|
641 | _snxtroSolType ->setEnabled(true);
|
---|
642 | _snxtroCampId ->setEnabled(true);
|
---|
643 | _snxtroSampl->setPalette(paletteWhite);
|
---|
644 | _snxtroIntr ->setPalette(paletteWhite);
|
---|
645 | _snxtroAc ->setPalette(paletteWhite);
|
---|
646 | _snxtroSolId ->setPalette(paletteWhite);
|
---|
647 | _snxtroSolType ->setPalette(paletteWhite);
|
---|
648 | _snxtroCampId ->setPalette(paletteWhite);
|
---|
649 | }
|
---|
650 | else {
|
---|
651 | _snxtroSampl->setEnabled(false);
|
---|
652 | _snxtroIntr ->setEnabled(false);
|
---|
653 | _snxtroAc ->setEnabled(false);
|
---|
654 | _snxtroSolId ->setEnabled(false);
|
---|
655 | _snxtroSolType ->setEnabled(false);
|
---|
656 | _snxtroCampId ->setEnabled(false);
|
---|
657 | _snxtroSampl->setPalette(paletteGray);
|
---|
658 | _snxtroIntr ->setPalette(paletteGray);
|
---|
659 | _snxtroAc ->setPalette(paletteGray);
|
---|
660 | _snxtroSolId ->setPalette(paletteGray);
|
---|
661 | _snxtroSolType ->setPalette(paletteGray);
|
---|
662 | _snxtroCampId ->setPalette(paletteGray);
|
---|
663 | }
|
---|
664 | }
|
---|
665 |
|
---|
666 |
|
---|
667 | }
|
---|