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

Last change on this file since 9580 was 9580, checked in by stuerze, 7 months ago

minor changes

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