source: ntrip/trunk/BNC/src/pppWidgets.cpp@ 9866

Last change on this file since 9866 was 9866, checked in by stuerze, 2 years ago

minor changes

File size: 31.5 KB
Line 
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
57using namespace std;
58
59// Constructor
60////////////////////////////////////////////////////////////////////////////
61t_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 _snxtroSol = new QLineEdit(); _snxtroSol ->setObjectName("PPP/snxtroSol"); _widgets << _snxtroSol;
80 _staTable = new QTableWidget(); _staTable ->setObjectName("PPP/staTable"); _widgets << _staTable;
81 _lcGPS = new QComboBox(); _lcGPS ->setObjectName("PPP/lcGPS"); _widgets << _lcGPS;
82 _lcGLONASS = new QComboBox(); _lcGLONASS ->setObjectName("PPP/lcGLONASS"); _widgets << _lcGLONASS;
83 _lcGalileo = new QComboBox(); _lcGalileo ->setObjectName("PPP/lcGalileo"); _widgets << _lcGalileo;
84 _lcBDS = new QComboBox(); _lcBDS ->setObjectName("PPP/lcBDS"); _widgets << _lcBDS;
85 _modelObs = new QComboBox(); _modelObs ->setObjectName("PPP/modelObs"); _widgets << _modelObs;
86 _pseudoObs = new QComboBox(); _pseudoObs ->setObjectName("PPP/pseudoObs"); _widgets << _pseudoObs;
87 _sigmaC1 = new QLineEdit(); _sigmaC1 ->setObjectName("PPP/sigmaC1"); _widgets << _sigmaC1;
88 _sigmaL1 = new QLineEdit(); _sigmaL1 ->setObjectName("PPP/sigmaL1"); _widgets << _sigmaL1;
89 _sigmaGIM = new QLineEdit(); _sigmaGIM ->setObjectName("PPP/sigmaGIM"); _widgets << _sigmaGIM;
90 _maxResC1 = new QLineEdit(); _maxResC1 ->setObjectName("PPP/maxResC1"); _widgets << _maxResC1;
91 _maxResL1 = new QLineEdit(); _maxResL1 ->setObjectName("PPP/maxResL1"); _widgets << _maxResL1;
92 _maxResGIM = new QLineEdit(); _maxResGIM ->setObjectName("PPP/maxResGIM"); _widgets << _maxResGIM;
93 _minObs = new QSpinBox(); _minObs ->setObjectName("PPP/minObs"); _widgets << _minObs;
94 _minEle = new QSpinBox(); _minEle ->setObjectName("PPP/minEle"); _widgets << _minEle;
95 _eleWgtCode = new QCheckBox(); _eleWgtCode ->setObjectName("PPP/eleWgtCode"); _widgets << _eleWgtCode;
96 _eleWgtPhase = new QCheckBox(); _eleWgtPhase ->setObjectName("PPP/eleWgtPhase"); _widgets << _eleWgtPhase;
97 _seedingTime = new QLineEdit(); _seedingTime ->setObjectName("PPP/seedingTime"); _widgets << _seedingTime;
98 _corrWaitTime = new QSpinBox(); _corrWaitTime->setObjectName("PPP/corrWaitTime"); _widgets << _corrWaitTime;
99
100 _addStaButton = new QPushButton("Add Station"); _widgets << _addStaButton;
101 _delStaButton = new QPushButton("Delete Station"); _widgets << _delStaButton;
102
103 _addStaButton->setWhatsThis(tr("<p>Hit the 'Add Station' button to add a new line to the Station table.</p>"));
104 _delStaButton->setWhatsThis(tr("<p>Hit the 'Delete Station' button to delete a highlighted row from the Station table.</p>"));
105
106 _plotCoordinates = new QLineEdit; _plotCoordinates ->setObjectName("PPP/plotCoordinates"); _widgets << _plotCoordinates;
107 _mapWinButton = new QPushButton; _mapWinButton ->setObjectName("PPP/mapWinButton"); _widgets << _mapWinButton;
108 _audioResponse = new QLineEdit; _audioResponse ->setObjectName("PPP/audioResponse"); _widgets << _audioResponse;
109 _mapWinDotSize = new QLineEdit; _mapWinDotSize ->setObjectName("PPP/mapWinDotSize"); _widgets << _mapWinDotSize;
110 _mapWinDotColor = new QComboBox; _mapWinDotColor ->setObjectName("PPP/mapWinDotColor"); _widgets << _mapWinDotColor;
111 _mapSpeedSlider = new QSlider; _mapSpeedSlider ->setObjectName("PPP/mapSpeedSlider"); _widgets << _mapSpeedSlider;
112
113 _dataSource->setEditable(false);
114 _dataSource->addItems(QString(",Real-Time Streams,RINEX Files").split(","));
115 connect(_dataSource, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(slotEnableWidgets()));
116 connect(_pseudoObs, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(slotEnableWidgets()));
117 connect(_modelObs, 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(_snxtroSol, SIGNAL(textChanged(const QString &)), this, SLOT(slotPPPTextChanged()));
121
122 slotEnableWidgets();
123
124 _lcGPS->setEditable(false);
125#ifdef USE_PPP_SSR_I
126 _lcGPS->addItems(QString("P3,P3&L3").split(","));
127#else
128 _lcGPS->addItems(QString("Pi&Li,Pi,Li,no").split(","));
129#endif
130
131 _lcGLONASS->setEditable(false);
132#ifdef USE_PPP_SSR_I
133 _lcGLONASS->addItems(QString("no,P3,L3,P3&L3").split(","));
134#else
135 _lcGLONASS->addItems(QString("Pi&Li,Pi,Li,no").split(","));
136#endif
137
138 _lcGalileo->setEditable(false);
139#ifdef USE_PPP_SSR_I
140 _lcGalileo->addItems(QString("no,P3,L3,P3&L3").split(","));
141#else
142 _lcGalileo->addItems(QString("Pi&Li,Pi,Li,no").split(","));
143#endif
144
145 _lcBDS->setEditable(false);
146#ifdef USE_PPP_SSR_I
147 _lcBDS->addItems(QString("no,P3,L3,P3&L3").split(","));
148#else
149 _lcBDS->addItems(QString("Pi&Li,Pi,Li,no").split(","));
150#endif
151
152 _modelObs->setEditable(false);
153 _pseudoObs->setEditable(false);
154#ifdef USE_PPP_SSR_I
155 _modelObs->addItems(QString("Ionosphere-free PPP").split(","));
156 _pseudoObs->addItems(QString("no").split(","));
157#else
158 _modelObs->addItems(QString("Uncombined PPP,Ionosphere-free PPP,DCM with Code Biases,DCM with Phase Biases").split(","));
159 _pseudoObs->addItems(QString("no,Ionosphere").split(","));
160#endif
161
162 _snxtroSampl->setEditable(false);
163 _snxtroSampl->addItems(QString("1 sec,5 sec,10 sec,30 sec,60 sec,300 sec").split(","));
164
165 _snxtroIntr->setEditable(false);
166 _snxtroIntr->addItems(QString("1 min,2 min,5 min,10 min,15 min,30 min,1 hour,1 day").split(","));
167 _snxtroIntr->setCurrentIndex(6);
168
169 _minObs->setMinimum(4);
170 _minObs->setMaximum(6);
171 _minObs->setSingleStep(1);
172
173 _minEle->setMinimum(0);
174 _minEle->setMaximum(20);
175 _minEle->setSingleStep(1);
176 _minEle->setSuffix(" deg");
177
178 _corrWaitTime->setMinimum(0);
179 _corrWaitTime->setMaximum(20);
180 _corrWaitTime->setSingleStep(1);
181 _corrWaitTime->setSuffix(" sec");
182
183 _staTable->setColumnCount(11);
184 _staTable->setRowCount(0);
185 _staTable->setHorizontalHeaderLabels(
186 QString("Station,Sigma N,Sigma E,Sigma H,Noise N,Noise E,Noise H,Tropo Sigma,Tropo Noise, NMEA Port,Signal Priorities").split(","));
187 _staTable->setSelectionMode(QAbstractItemView::ExtendedSelection);
188 _staTable->setSelectionBehavior(QAbstractItemView::SelectRows);
189 _staTable->setColumnWidth(0,120);
190 _staTable->setColumnWidth(10,220);
191#if QT_VERSION >= 0x050000
192 _staTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
193#endif
194 _staTable->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft);
195 connect(_addStaButton, SIGNAL(clicked()), this, SLOT(slotAddStation()));
196 connect(_delStaButton, SIGNAL(clicked()), this, SLOT(slotDelStation()));
197
198 _mapWinButton->setText("Open Map");
199
200 _mapWinDotColor->setEditable(false);
201 _mapWinDotColor->addItems(QString("red,yellow").split(","));
202
203 _mapSpeedSlider->setOrientation(Qt::Horizontal);
204 _mapSpeedSlider->setRange(1, 100);
205 _mapSpeedSlider->setTickPosition(QSlider::TicksBelow);
206 _mapSpeedSlider->setTickInterval(10);
207 connect(_mapSpeedSlider, SIGNAL(valueChanged(int)), BNC_CORE, SIGNAL(mapSpeedSliderChanged(int)));
208
209 // WhatsThis, PPP (2)
210 // ------------------
211 _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>"));
212 _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 'Sigma 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>"));
213
214 // WhatsThis, PPP (3)
215 // ------------------
216 _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><p>Specifying one record per Station is mandatory. BNC will only process data for stations which are listed here. To define a station, specify the 'Mountpoint' when in 'Real-Time Streams' mode or the 4-character station ID when in 'RINEX Files' mode.</p><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><p>'Signal Priorities' can be specified as equal for all systems, as system specific or as system and frequency specific. Please note, for 'DCM with Phase Biases' or 'DCM with Code Biases' at the moment only one code or phase bias per system (G,R,E,C)/modulation can be considered. Hence, for example the following list of 'Signal Priorities' would be valid: <ul><li>'G:12&CW R:12&CP E:1&CX E:5&QX C:26&I'</li></ul><p>For all other PPP models for example the following list of 'Signal Priorities' can be used:</p> <ul><li>'G:12&CWPSLX R:12&CP E:1&CBX E:5&QIX C:26&IQX'</li></ul> <p> <i>[key: PPP/staTable]</i></p>"));
217
218 // WhatsThis, PPP (4)
219 // ------------------
220 _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>"));
221 _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>"));
222 _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>"));
223 _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>"));
224 _mapWinDotColor->setWhatsThis(tr("<p>Specify the color of dots showing the rover track on the map. <i>[key: PPP/mapWinDotColor]</i></p>"));
225 _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>"));
226
227 readOptions();
228}
229
230//
231////////////////////////////////////////////////////////////////////////////
232t_pppWidgets::~t_pppWidgets() {
233 delete _dataSource;
234 delete _rinexObs;
235 delete _rinexNav;
236 delete _corrMount;
237 delete _ionoMount;
238 delete _corrFile;
239 delete _ionoFile;
240 delete _crdFile;
241 delete _antexFile;
242 delete _blqFile;
243 delete _logPath;
244 delete _nmeaPath;
245 delete _snxtroPath;
246 delete _snxtroSampl;
247 delete _snxtroIntr;
248 delete _snxtroAc;
249 delete _snxtroSol;
250 for (int iRow = _staTable->rowCount()-1; iRow >=0; iRow--) {
251 _staTable->removeRow(iRow);
252 }
253 delete _staTable;
254 delete _lcGPS;
255 delete _lcGLONASS;
256 delete _lcGalileo;
257 delete _lcBDS;
258 delete _modelObs;
259 delete _pseudoObs;
260 delete _sigmaC1;
261 delete _sigmaL1;
262 delete _sigmaGIM;
263 delete _maxResC1;
264 delete _maxResL1;
265 delete _maxResGIM;
266 delete _minObs;
267 delete _minEle;
268 delete _eleWgtCode;
269 delete _eleWgtPhase;
270 delete _seedingTime;
271 delete _corrWaitTime;
272 delete _addStaButton;
273 delete _delStaButton;
274 delete _plotCoordinates;
275 delete _mapWinButton;
276 delete _audioResponse;
277 delete _mapWinDotSize;
278 delete _mapWinDotColor;
279 delete _mapSpeedSlider;
280}
281
282//
283////////////////////////////////////////////////////////////////////////////
284void t_pppWidgets::readOptions() {
285
286 bncSettings settings;
287
288 // ComboBoxes
289 // ----------
290 int ii = _dataSource->findText(settings.value(_dataSource->objectName()).toString());
291 if (ii != -1) {
292 _dataSource->setCurrentIndex(ii);
293 }
294 ii = _lcGPS->findText(settings.value(_lcGPS->objectName()).toString());
295 if (ii != -1) {
296 _lcGPS->setCurrentIndex(ii);
297 }
298 ii = _lcGLONASS->findText(settings.value(_lcGLONASS->objectName()).toString());
299 if (ii != -1) {
300 _lcGLONASS->setCurrentIndex(ii);
301 }
302 ii = _lcGalileo->findText(settings.value(_lcGalileo->objectName()).toString());
303 if (ii != -1) {
304 _lcGalileo->setCurrentIndex(ii);
305 }
306 ii = _lcBDS->findText(settings.value(_lcBDS->objectName()).toString());
307 if (ii != -1) {
308 _lcBDS->setCurrentIndex(ii);
309 }
310 ii = _modelObs->findText(settings.value(_modelObs->objectName()).toString());
311 if (ii != -1) {
312 _modelObs->setCurrentIndex(ii);
313 }
314 ii = _pseudoObs->findText(settings.value(_pseudoObs->objectName()).toString());
315 if (ii != -1) {
316 _pseudoObs->setCurrentIndex(ii);
317 }
318 ii = _snxtroIntr->findText(settings.value(_snxtroIntr->objectName()).toString());
319 if (ii != -1) {
320 _snxtroIntr->setCurrentIndex(ii);
321 }
322
323 // FileChoosers
324 // ------------
325 _rinexObs ->setFileName(settings.value(_rinexObs ->objectName()).toString());
326 _rinexNav ->setFileName(settings.value(_rinexNav ->objectName()).toString());
327 _corrFile ->setFileName(settings.value(_corrFile ->objectName()).toString());
328 _crdFile ->setFileName(settings.value(_crdFile ->objectName()).toString());
329 _antexFile->setFileName(settings.value(_antexFile->objectName()).toString());
330 _blqFile->setFileName(settings.value(_blqFile->objectName()).toString());
331
332 // LineEdits
333 // ---------
334 _corrMount ->setText(settings.value(_corrMount ->objectName()).toString());
335 _ionoMount ->setText(settings.value(_ionoMount ->objectName()).toString());
336 _logPath ->setText(settings.value(_logPath ->objectName()).toString());
337 _nmeaPath ->setText(settings.value(_nmeaPath ->objectName()).toString());
338 _snxtroPath ->setText(settings.value(_snxtroPath ->objectName()).toString());
339 _snxtroAc ->setText(settings.value(_snxtroAc ->objectName()).toString());
340 _snxtroSol ->setText(settings.value(_snxtroSol ->objectName()).toString());
341
342 if (!settings.value(_sigmaC1->objectName()).toString().isEmpty()) {
343 _sigmaC1->setText(settings.value(_sigmaC1->objectName()).toString());
344 }
345 else {
346 _sigmaC1->setText("2.0");
347 }
348
349 if (!settings.value(_sigmaL1->objectName()).toString().isEmpty()) {
350 _sigmaL1->setText(settings.value(_sigmaL1->objectName()).toString());
351 }
352 else {
353 _sigmaL1->setText("0.02");
354 }
355
356 if (!settings.value(_sigmaGIM->objectName()).toString().isEmpty()) {
357 _sigmaGIM->setText(settings.value(_sigmaGIM->objectName()).toString());
358 }
359 else {
360 _sigmaGIM->setText("5.0");
361 }
362
363 if (!settings.value(_maxResC1->objectName()).toString().isEmpty()) {
364 _maxResC1->setText(settings.value(_maxResC1->objectName()).toString());
365 }
366 else {
367 _maxResC1->setText("3.0");
368 }
369
370 if (!settings.value(_maxResL1->objectName()).toString().isEmpty()) {
371 _maxResL1->setText(settings.value(_maxResL1->objectName()).toString());
372 }
373 else {
374 _maxResL1->setText("0.03");
375 }
376
377 if (!settings.value(_maxResGIM->objectName()).toString().isEmpty()) {
378 _maxResGIM->setText(settings.value(_maxResGIM->objectName()).toString());
379 }
380 else {
381 _maxResGIM->setText("3.0");
382 }
383
384
385 if (!settings.value(_seedingTime->objectName()).toString().isEmpty()) {
386 _seedingTime->setText(settings.value(_seedingTime->objectName()).toString());
387 }
388 else {
389 _seedingTime->setText("0");
390 }
391
392 // CheckBoxes
393 // ----------
394 _eleWgtCode ->setCheckState(Qt::CheckState(settings.value(_eleWgtCode ->objectName()).toInt()));
395 _eleWgtPhase->setCheckState(Qt::CheckState(settings.value(_eleWgtPhase->objectName()).toInt()));
396
397 // SpinBoxex
398 // ---------
399 _minObs->setValue(settings.value(_minObs->objectName()).toInt());
400 _minEle->setValue(settings.value(_minEle->objectName()).toInt());
401 _corrWaitTime->setValue(settings.value(_corrWaitTime->objectName()).toInt());
402
403
404 ii = _snxtroSampl->findText(settings.value(_snxtroSampl->objectName()).toString());
405 if (ii != -1) {
406 _snxtroSampl->setCurrentIndex(ii);
407 }
408
409 // Table with stations
410 // -------------------
411 for (int iRow = _staTable->rowCount()-1; iRow >=0; iRow--) {
412 _staTable->removeRow(iRow);
413 }
414 int iRow = -1;
415 QListIterator<QString> it(settings.value(_staTable->objectName()).toStringList());
416 while (it.hasNext()) {
417 QStringList hlp = it.next().split(",");
418 ++iRow;
419 _staTable->insertRow(iRow);
420 for (int iCol = 0; iCol < hlp.size(); iCol++) {
421 _staTable->setItem(iRow, iCol, new QTableWidgetItem(hlp[iCol]));
422 }
423 }
424
425 // Plots and Maps
426 // --------------
427 _plotCoordinates ->setText(settings.value(_plotCoordinates->objectName()).toString());
428 _audioResponse ->setText(settings.value(_audioResponse->objectName()).toString());
429 _mapWinDotSize ->setText(settings.value(_mapWinDotSize->objectName()).toString());
430
431 ii = _mapWinDotColor->findText(settings.value(_mapWinDotColor->objectName()).toString());
432 if (ii != -1) {
433 _mapWinDotColor->setCurrentIndex(ii);
434 }
435
436 int speed = settings.value(_mapSpeedSlider->objectName()).toInt();
437 if (speed == 0) speed = _mapSpeedSlider->maximum();
438 _mapSpeedSlider->setSliderPosition(speed);
439}
440
441//
442////////////////////////////////////////////////////////////////////////////
443void t_pppWidgets::saveOptions() {
444
445 bncSettings settings;
446
447 settings.setValue(_dataSource ->objectName(), _dataSource ->currentText());
448 settings.setValue(_rinexObs ->objectName(), _rinexObs ->fileName());
449 settings.setValue(_rinexNav ->objectName(), _rinexNav ->fileName());
450 settings.setValue(_corrMount ->objectName(), _corrMount ->text());
451 settings.setValue(_ionoMount ->objectName(), _ionoMount ->text());
452 settings.setValue(_corrFile ->objectName(), _corrFile ->fileName());
453 settings.setValue(_ionoFile ->objectName(), _ionoFile ->fileName());
454 settings.setValue(_crdFile ->objectName(), _crdFile ->fileName());
455 settings.setValue(_antexFile ->objectName(), _antexFile ->fileName());
456 settings.setValue(_blqFile ->objectName(), _blqFile ->fileName());
457 settings.setValue(_logPath ->objectName(), _logPath ->text());
458 settings.setValue(_nmeaPath ->objectName(), _nmeaPath ->text());
459 settings.setValue(_snxtroPath ->objectName(), _snxtroPath ->text());
460 settings.setValue(_snxtroSampl ->objectName(), _snxtroSampl ->currentText());
461 settings.setValue(_snxtroIntr ->objectName(), _snxtroIntr ->currentText());
462 settings.setValue(_snxtroAc ->objectName(), _snxtroAc ->text());
463 settings.setValue(_snxtroSol ->objectName(), _snxtroSol ->text());
464 settings.setValue(_lcGPS ->objectName(), _lcGPS ->currentText());
465 settings.setValue(_lcGLONASS ->objectName(), _lcGLONASS ->currentText());
466 settings.setValue(_lcGalileo ->objectName(), _lcGalileo ->currentText());
467 settings.setValue(_lcBDS ->objectName(), _lcBDS ->currentText());
468 settings.setValue(_modelObs ->objectName(), _modelObs ->currentText());
469 settings.setValue(_pseudoObs ->objectName(), _pseudoObs ->currentText());
470 settings.setValue(_sigmaC1 ->objectName(), _sigmaC1 ->text());
471 settings.setValue(_sigmaL1 ->objectName(), _sigmaL1 ->text());
472 settings.setValue(_sigmaGIM ->objectName(), _sigmaGIM ->text());
473 settings.setValue(_corrWaitTime->objectName(), _corrWaitTime->value());
474 settings.setValue(_maxResC1 ->objectName(), _maxResC1 ->text());
475 settings.setValue(_maxResL1 ->objectName(), _maxResL1 ->text());
476 settings.setValue(_maxResGIM ->objectName(), _maxResGIM ->text());
477 settings.setValue(_seedingTime ->objectName(), _seedingTime ->text());
478 settings.setValue(_minObs ->objectName(), _minObs ->value());
479 settings.setValue(_minEle ->objectName(), _minEle ->value());
480 settings.setValue(_eleWgtCode ->objectName(), _eleWgtCode ->checkState());
481 settings.setValue(_eleWgtPhase ->objectName(), _eleWgtPhase ->checkState());
482
483 QStringList staList;
484 for (int iRow = 0; iRow < _staTable->rowCount(); iRow++) {
485 QString hlp;
486 for (int iCol = 0; iCol < _staTable->columnCount(); iCol++) {
487 if (_staTable->item(iRow, iCol)) {
488 hlp += _staTable->item(iRow, iCol)->text() + ",";
489 }
490 }
491 if (!hlp.isEmpty()) {
492 staList << hlp;
493 }
494 }
495 settings.setValue(_staTable->objectName(), staList);
496
497 settings.setValue(_plotCoordinates ->objectName(), _plotCoordinates ->text());
498 settings.setValue(_audioResponse ->objectName(), _audioResponse ->text());
499 settings.setValue(_mapWinDotSize ->objectName(), _mapWinDotSize ->text());
500 settings.setValue(_mapWinDotColor ->objectName(), _mapWinDotColor ->currentText());
501 settings.setValue(_mapSpeedSlider ->objectName(), _mapSpeedSlider ->value());
502}
503
504//
505////////////////////////////////////////////////////////////////////////////
506void t_pppWidgets::slotEnableWidgets() {
507
508 const static QPalette paletteWhite(QColor(255, 255, 255));
509 const static QPalette paletteGray(QColor(230, 230, 230));
510
511 bool allDisabled = _dataSource->currentText() == "";
512 bool realTime = _dataSource->currentText() == "Real-Time Streams";
513 bool rinexFiles = _dataSource->currentText() == "RINEX Files";
514 bool enablePseudoObs;
515 if (_modelObs->currentText() == "PPP-RTK" ||
516 _modelObs->currentText() == "Ionosphere-free PPP") {
517 enablePseudoObs = false;
518 }
519 else {
520 enablePseudoObs = true;
521 }
522 bool pseudoObsUsed = _pseudoObs->currentText() == "Ionosphere";
523
524 QListIterator<QWidget*> it(_widgets);
525 while (it.hasNext()) {
526 QWidget* widget = it.next();
527 widget->setEnabled(!allDisabled);
528 }
529
530 if (realTime) {
531 _rinexObs->setEnabled(false);
532 _rinexNav->setEnabled(false);
533 _corrFile->setEnabled(false);
534 _ionoFile->setEnabled(false);
535 }
536 else if (rinexFiles) {
537 _corrMount ->setEnabled(false);
538 _ionoMount ->setEnabled(false);
539 _audioResponse->setEnabled(false);
540 }
541
542 if ( _snxtroPath->text() != "" && !allDisabled) {
543 _snxtroSampl->setEnabled(true);
544 _snxtroIntr ->setEnabled(true);
545 _snxtroAc ->setEnabled(true);
546 _snxtroSol ->setEnabled(true);
547 }
548 else {
549 _snxtroSampl->setEnabled(false);
550 _snxtroIntr ->setEnabled(false);
551 _snxtroAc ->setEnabled(false);
552 _snxtroSol ->setEnabled(false);
553 }
554
555 if (enablePseudoObs) {
556 _pseudoObs->setEnabled(true);
557 if (pseudoObsUsed) {
558 _sigmaGIM->setEnabled(true);
559 _maxResGIM->setEnabled(true);
560 } else {
561 _sigmaGIM->setEnabled(false);
562 _maxResGIM->setEnabled(false);
563 }
564 } else {
565 _pseudoObs->setEnabled(false);
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////////////////////////////////////////////////////////////////////////////
586void 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 if (_modelObs->currentText().contains("DCM")) {
591 preferredAttributes = "G:12&CW R:12&CP E:1&CX E:5&QX C:26&I";
592 }
593
594 for (int iCol = 0; iCol < _staTable->columnCount(); iCol++) {
595 if (iCol == 0) _staTable->setItem(iRow, iCol, new QTableWidgetItem(""));
596 if (iCol == 1) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
597 if (iCol == 2) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
598 if (iCol == 3) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
599 if (iCol == 4) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
600 if (iCol == 5) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
601 if (iCol == 6) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
602 if (iCol == 7) _staTable->setItem(iRow, iCol, new QTableWidgetItem("0.1"));
603 if (iCol == 8) _staTable->setItem(iRow, iCol, new QTableWidgetItem("3e-6"));
604 if (iCol == 9) _staTable->setItem(iRow, iCol, new QTableWidgetItem("0"));
605 if (iCol == 10) _staTable->setItem(iRow, iCol, new QTableWidgetItem(preferredAttributes));
606 }
607}
608
609//
610////////////////////////////////////////////////////////////////////////////
611void t_pppWidgets::slotDelStation() {
612 int nRows = _staTable->rowCount();
613 bool flg[nRows];
614 for (int iRow = 0; iRow < nRows; iRow++) {
615 if (_staTable->isItemSelected(_staTable->item(iRow,1))) {
616 flg[iRow] = true;
617 }
618 else {
619 flg[iRow] = false;
620 }
621 }
622 for (int iRow = nRows-1; iRow >= 0; iRow--) {
623 if (flg[iRow]) {
624 _staTable->removeRow(iRow);
625 }
626 }
627}
628
629// PPP Text
630////////////////////////////////////////////////////////////////////////////
631void t_pppWidgets::slotPPPTextChanged(){
632
633 const static QPalette paletteWhite(QColor(255, 255, 255));
634 const static QPalette paletteGray(QColor(230, 230, 230));
635
636 // SNX TRO file sampling
637 // ---------------------
638 if (sender() == 0 || sender() == _snxtroPath) {
639 if ( _snxtroPath->text() != "" ) {
640 _snxtroSampl->setEnabled(true);
641 _snxtroIntr ->setEnabled(true);
642 _snxtroAc ->setEnabled(true);
643 _snxtroSol ->setEnabled(true);
644 _snxtroSampl->setPalette(paletteWhite);
645 _snxtroIntr ->setPalette(paletteWhite);
646 _snxtroAc ->setPalette(paletteWhite);
647 _snxtroSol ->setPalette(paletteWhite);
648 }
649 else {
650 _snxtroSampl->setEnabled(false);
651 _snxtroIntr ->setEnabled(false);
652 _snxtroAc ->setEnabled(false);
653 _snxtroSol ->setEnabled(false);
654 _snxtroSampl->setPalette(paletteGray);
655 _snxtroIntr ->setPalette(paletteGray);
656 _snxtroAc ->setPalette(paletteGray);
657 _snxtroSol ->setPalette(paletteGray);
658 }
659 }
660
661
662}
Note: See TracBrowser for help on using the repository browser.