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

Last change on this file since 10244 was 10127, checked in by stuerze, 10 months ago
File size: 32.6 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 _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 _modelObs = new QComboBox(); _modelObs ->setObjectName("PPP/modelObs"); _widgets << _modelObs;
88 _pseudoObs = new QComboBox(); _pseudoObs ->setObjectName("PPP/pseudoObs"); _widgets << _pseudoObs;
89 _sigmaC1 = new QLineEdit(); _sigmaC1 ->setObjectName("PPP/sigmaC1"); _widgets << _sigmaC1;
90 _sigmaL1 = new QLineEdit(); _sigmaL1 ->setObjectName("PPP/sigmaL1"); _widgets << _sigmaL1;
91 _sigmaGIM = new QLineEdit(); _sigmaGIM ->setObjectName("PPP/sigmaGIM"); _widgets << _sigmaGIM;
92 _maxResC1 = new QLineEdit(); _maxResC1 ->setObjectName("PPP/maxResC1"); _widgets << _maxResC1;
93 _maxResL1 = new QLineEdit(); _maxResL1 ->setObjectName("PPP/maxResL1"); _widgets << _maxResL1;
94 _maxResGIM = new QLineEdit(); _maxResGIM ->setObjectName("PPP/maxResGIM"); _widgets << _maxResGIM;
95 _minObs = new QSpinBox(); _minObs ->setObjectName("PPP/minObs"); _widgets << _minObs;
96 _minEle = new QSpinBox(); _minEle ->setObjectName("PPP/minEle"); _widgets << _minEle;
97 _eleWgtCode = new QCheckBox(); _eleWgtCode ->setObjectName("PPP/eleWgtCode"); _widgets << _eleWgtCode;
98 _eleWgtPhase = new QCheckBox(); _eleWgtPhase ->setObjectName("PPP/eleWgtPhase"); _widgets << _eleWgtPhase;
99 _seedingTime = new QLineEdit(); _seedingTime ->setObjectName("PPP/seedingTime"); _widgets << _seedingTime;
100 _corrWaitTime = new QSpinBox(); _corrWaitTime->setObjectName("PPP/corrWaitTime"); _widgets << _corrWaitTime;
101
102 _addStaButton = new QPushButton("Add Station"); _widgets << _addStaButton;
103 _delStaButton = new QPushButton("Delete Station"); _widgets << _delStaButton;
104
105 _addStaButton->setWhatsThis(tr("<p>Hit the 'Add Station' button to add a new line to the Station table.</p>"));
106 _delStaButton->setWhatsThis(tr("<p>Hit the 'Delete Station' button to delete a highlighted row from the Station table.</p>"));
107
108 _plotCoordinates = new QLineEdit; _plotCoordinates ->setObjectName("PPP/plotCoordinates"); _widgets << _plotCoordinates;
109 _mapWinButton = new QPushButton; _mapWinButton ->setObjectName("PPP/mapWinButton"); _widgets << _mapWinButton;
110 _audioResponse = new QLineEdit; _audioResponse ->setObjectName("PPP/audioResponse"); _widgets << _audioResponse;
111 _mapWinDotSize = new QLineEdit; _mapWinDotSize ->setObjectName("PPP/mapWinDotSize"); _widgets << _mapWinDotSize;
112 _mapWinDotColor = new QComboBox; _mapWinDotColor ->setObjectName("PPP/mapWinDotColor"); _widgets << _mapWinDotColor;
113 _mapSpeedSlider = new QSlider; _mapSpeedSlider ->setObjectName("PPP/mapSpeedSlider"); _widgets << _mapSpeedSlider;
114
115 _dataSource->setEditable(false);
116 _dataSource->addItems(QString(",Real-Time Streams,RINEX Files").split(","));
117 connect(_dataSource, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(slotEnableWidgets()));
118 connect(_pseudoObs, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(slotEnableWidgets()));
119 connect(_modelObs, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(slotEnableWidgets()));
120 connect(_snxtroPath, SIGNAL(textChanged(const QString &)), this, SLOT(slotPPPTextChanged()));
121 connect(_snxtroAc, SIGNAL(textChanged(const QString &)), this, SLOT(slotPPPTextChanged()));
122 connect(_snxtroSolId, SIGNAL(textChanged(const QString &)), this, SLOT(slotPPPTextChanged()));
123 connect(_snxtroSolType, SIGNAL(textChanged(const QString &)), this, SLOT(slotPPPTextChanged()));
124 connect(_snxtroCampId, SIGNAL(textChanged(const QString &)), this, SLOT(slotPPPTextChanged()));
125
126 slotEnableWidgets();
127
128 _lcGPS->setEditable(false);
129#ifdef USE_PPP_SSR_I
130 _lcGPS->addItems(QString("P3,P3&L3").split(","));
131#else
132 _lcGPS->addItems(QString("Pi&Li,Pi,Li,no").split(","));
133#endif
134
135 _lcGLONASS->setEditable(false);
136#ifdef USE_PPP_SSR_I
137 _lcGLONASS->addItems(QString("no,P3,L3,P3&L3").split(","));
138#else
139 _lcGLONASS->addItems(QString("Pi&Li,Pi,Li,no").split(","));
140#endif
141
142 _lcGalileo->setEditable(false);
143#ifdef USE_PPP_SSR_I
144 _lcGalileo->addItems(QString("no,P3,L3,P3&L3").split(","));
145#else
146 _lcGalileo->addItems(QString("Pi&Li,Pi,Li,no").split(","));
147#endif
148
149 _lcBDS->setEditable(false);
150#ifdef USE_PPP_SSR_I
151 _lcBDS->addItems(QString("no,P3,L3,P3&L3").split(","));
152#else
153 _lcBDS->addItems(QString("Pi&Li,Pi,Li,no").split(","));
154#endif
155
156 _modelObs->setEditable(false);
157 _pseudoObs->setEditable(false);
158#ifdef USE_PPP_SSR_I
159 _modelObs->addItems(QString("Ionosphere-free PPP").split(","));
160 _pseudoObs->addItems(QString("no").split(","));
161#else
162 _modelObs->addItems(QString("Uncombined PPP,Ionosphere-free PPP").split(","));
163 _pseudoObs->addItems(QString("no,Ionosphere").split(","));
164#endif
165
166 _snxtroSampl->setEditable(false);
167 _snxtroSampl->addItems(QString("1 sec,5 sec,10 sec,30 sec,60 sec,300 sec").split(","));
168
169 _snxtroIntr->setEditable(false);
170 _snxtroIntr->addItems(QString("1 min,2 min,5 min,10 min,15 min,30 min,1 hour,1 day").split(","));
171 _snxtroIntr->setCurrentIndex(6);
172
173 _minObs->setMinimum(4);
174 _minObs->setMaximum(6);
175 _minObs->setSingleStep(1);
176
177 _minEle->setMinimum(0);
178 _minEle->setMaximum(20);
179 _minEle->setSingleStep(1);
180 _minEle->setSuffix(" deg");
181
182 _corrWaitTime->setMinimum(0);
183 _corrWaitTime->setMaximum(20);
184 _corrWaitTime->setSingleStep(1);
185 _corrWaitTime->setSuffix(" sec");
186
187 _staTable->setColumnCount(11);
188 _staTable->setRowCount(0);
189 _staTable->setHorizontalHeaderLabels(
190 QString("Station,Sigma N,Sigma E,Sigma H,Noise N,Noise E,Noise H,Tropo Sigma,Tropo Noise, NMEA Port,Signal Priorities").split(","));
191 _staTable->setSelectionMode(QAbstractItemView::ExtendedSelection);
192 _staTable->setSelectionBehavior(QAbstractItemView::SelectRows);
193 _staTable->setColumnWidth(0,120);
194 _staTable->setColumnWidth(10,220);
195#if QT_VERSION >= 0x050000
196 _staTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
197#endif
198 _staTable->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft);
199 connect(_addStaButton, SIGNAL(clicked()), this, SLOT(slotAddStation()));
200 connect(_delStaButton, SIGNAL(clicked()), this, SLOT(slotDelStation()));
201
202 _mapWinButton->setText("Open Map");
203
204 _mapWinDotColor->setEditable(false);
205 _mapWinDotColor->addItems(QString("red,yellow").split(","));
206
207 _mapSpeedSlider->setOrientation(Qt::Horizontal);
208 _mapSpeedSlider->setRange(1, 100);
209 _mapSpeedSlider->setTickPosition(QSlider::TicksBelow);
210 _mapSpeedSlider->setTickInterval(10);
211 connect(_mapSpeedSlider, SIGNAL(valueChanged(int)), BNC_CORE, SIGNAL(mapSpeedSliderChanged(int)));
212
213 // WhatsThis, PPP (2)
214 // ------------------
215 _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>"));
216 _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>"));
217
218 // WhatsThis, PPP (3)
219 // ------------------
220 _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 9-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. Default for all PPP models 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><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> <p> <i>[key: PPP/staTable]</i></p>"));
221
222 // WhatsThis, PPP (4)
223 // ------------------
224 _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>"));
225 _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>"));
226 _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>"));
227 _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>"));
228 _mapWinDotColor->setWhatsThis(tr("<p>Specify the color of dots showing the rover track on the map. <i>[key: PPP/mapWinDotColor]</i></p>"));
229 _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>"));
230
231 readOptions();
232}
233
234//
235////////////////////////////////////////////////////////////////////////////
236t_pppWidgets::~t_pppWidgets() {
237 delete _dataSource;
238 delete _rinexObs;
239 delete _rinexNav;
240 delete _corrMount;
241 delete _ionoMount;
242 delete _corrFile;
243 delete _ionoFile;
244 delete _crdFile;
245 delete _antexFile;
246 delete _blqFile;
247 delete _logPath;
248 delete _nmeaPath;
249 delete _snxtroPath;
250 delete _snxtroSampl;
251 delete _snxtroIntr;
252 delete _snxtroAc;
253 delete _snxtroSolId;
254 delete _snxtroSolType;
255 delete _snxtroCampId;
256 for (int iRow = _staTable->rowCount()-1; iRow >=0; iRow--) {
257 _staTable->removeRow(iRow);
258 }
259 delete _staTable;
260 delete _lcGPS;
261 delete _lcGLONASS;
262 delete _lcGalileo;
263 delete _lcBDS;
264 delete _modelObs;
265 delete _pseudoObs;
266 delete _sigmaC1;
267 delete _sigmaL1;
268 delete _sigmaGIM;
269 delete _maxResC1;
270 delete _maxResL1;
271 delete _maxResGIM;
272 delete _minObs;
273 delete _minEle;
274 delete _eleWgtCode;
275 delete _eleWgtPhase;
276 delete _seedingTime;
277 delete _corrWaitTime;
278 delete _addStaButton;
279 delete _delStaButton;
280 delete _plotCoordinates;
281 delete _mapWinButton;
282 delete _audioResponse;
283 delete _mapWinDotSize;
284 delete _mapWinDotColor;
285 delete _mapSpeedSlider;
286}
287
288//
289////////////////////////////////////////////////////////////////////////////
290void t_pppWidgets::readOptions() {
291
292 bncSettings settings;
293
294 // ComboBoxes
295 // ----------
296 int ii = _dataSource->findText(settings.value(_dataSource->objectName()).toString());
297 if (ii != -1) {
298 _dataSource->setCurrentIndex(ii);
299 }
300 ii = _lcGPS->findText(settings.value(_lcGPS->objectName()).toString());
301 if (ii != -1) {
302 _lcGPS->setCurrentIndex(ii);
303 }
304 ii = _lcGLONASS->findText(settings.value(_lcGLONASS->objectName()).toString());
305 if (ii != -1) {
306 _lcGLONASS->setCurrentIndex(ii);
307 }
308 ii = _lcGalileo->findText(settings.value(_lcGalileo->objectName()).toString());
309 if (ii != -1) {
310 _lcGalileo->setCurrentIndex(ii);
311 }
312 ii = _lcBDS->findText(settings.value(_lcBDS->objectName()).toString());
313 if (ii != -1) {
314 _lcBDS->setCurrentIndex(ii);
315 }
316 ii = _modelObs->findText(settings.value(_modelObs->objectName()).toString());
317 if (ii != -1) {
318 _modelObs->setCurrentIndex(ii);
319 }
320 ii = _pseudoObs->findText(settings.value(_pseudoObs->objectName()).toString());
321 if (ii != -1) {
322 _pseudoObs->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("2.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.02");
363 }
364
365 if (!settings.value(_sigmaGIM->objectName()).toString().isEmpty()) {
366 _sigmaGIM->setText(settings.value(_sigmaGIM->objectName()).toString());
367 }
368 else {
369 _sigmaGIM->setText("5.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("3.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.03");
384 }
385
386 if (!settings.value(_maxResGIM->objectName()).toString().isEmpty()) {
387 _maxResGIM->setText(settings.value(_maxResGIM->objectName()).toString());
388 }
389 else {
390 _maxResGIM->setText("3.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////////////////////////////////////////////////////////////////////////////
452void 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(_modelObs ->objectName(), _modelObs ->currentText());
480 settings.setValue(_pseudoObs ->objectName(), _pseudoObs ->currentText());
481 settings.setValue(_sigmaC1 ->objectName(), _sigmaC1 ->text());
482 settings.setValue(_sigmaL1 ->objectName(), _sigmaL1 ->text());
483 settings.setValue(_sigmaGIM ->objectName(), _sigmaGIM ->text());
484 settings.setValue(_corrWaitTime->objectName(), _corrWaitTime->value());
485 settings.setValue(_maxResC1 ->objectName(), _maxResC1 ->text());
486 settings.setValue(_maxResL1 ->objectName(), _maxResL1 ->text());
487 settings.setValue(_maxResGIM ->objectName(), _maxResGIM ->text());
488 settings.setValue(_seedingTime ->objectName(), _seedingTime ->text());
489 settings.setValue(_minObs ->objectName(), _minObs ->value());
490 settings.setValue(_minEle ->objectName(), _minEle ->value());
491 settings.setValue(_eleWgtCode ->objectName(), _eleWgtCode ->checkState());
492 settings.setValue(_eleWgtPhase ->objectName(), _eleWgtPhase ->checkState());
493
494 QStringList staList;
495 for (int iRow = 0; iRow < _staTable->rowCount(); iRow++) {
496 QString hlp;
497 for (int iCol = 0; iCol < _staTable->columnCount(); iCol++) {
498 if (_staTable->item(iRow, iCol)) {
499 hlp += _staTable->item(iRow, iCol)->text() + ",";
500 }
501 }
502 if (!hlp.isEmpty()) {
503 staList << hlp;
504 }
505 }
506 settings.setValue(_staTable->objectName(), staList);
507
508 settings.setValue(_plotCoordinates ->objectName(), _plotCoordinates ->text());
509 settings.setValue(_audioResponse ->objectName(), _audioResponse ->text());
510 settings.setValue(_mapWinDotSize ->objectName(), _mapWinDotSize ->text());
511 settings.setValue(_mapWinDotColor ->objectName(), _mapWinDotColor ->currentText());
512 settings.setValue(_mapSpeedSlider ->objectName(), _mapSpeedSlider ->value());
513}
514
515//
516////////////////////////////////////////////////////////////////////////////
517void t_pppWidgets::slotEnableWidgets() {
518
519 const static QPalette paletteWhite(QColor(255, 255, 255));
520 const static QPalette paletteGray(QColor(230, 230, 230));
521
522 bool allDisabled = _dataSource->currentText() == "";
523 bool realTime = _dataSource->currentText() == "Real-Time Streams";
524 bool rinexFiles = _dataSource->currentText() == "RINEX Files";
525 bool enablePseudoObs;
526 if (_modelObs->currentText() == "PPP-RTK" ||
527 _modelObs->currentText() == "Ionosphere-free PPP") {
528 enablePseudoObs = false;
529 }
530 else {
531 enablePseudoObs = true;
532 }
533 bool pseudoObsUsed = _pseudoObs->currentText() == "Ionosphere";
534
535 QListIterator<QWidget*> it(_widgets);
536 while (it.hasNext()) {
537 QWidget* widget = it.next();
538 widget->setEnabled(!allDisabled);
539 }
540
541 if (realTime) {
542 _rinexObs->setEnabled(false);
543 _rinexNav->setEnabled(false);
544 _corrFile->setEnabled(false);
545 _ionoFile->setEnabled(false);
546 }
547 else if (rinexFiles) {
548 _corrMount ->setEnabled(false);
549 _ionoMount ->setEnabled(false);
550 _audioResponse->setEnabled(false);
551 }
552
553 if ( _snxtroPath->text() != "" && !allDisabled) {
554 _snxtroSampl->setEnabled(true);
555 _snxtroIntr ->setEnabled(true);
556 _snxtroAc ->setEnabled(true);
557 _snxtroSolId ->setEnabled(true);
558 _snxtroSolType ->setEnabled(true);
559 _snxtroCampId ->setEnabled(true);
560 }
561 else {
562 _snxtroSampl->setEnabled(false);
563 _snxtroIntr ->setEnabled(false);
564 _snxtroAc ->setEnabled(false);
565 _snxtroSolId ->setEnabled(false);
566 _snxtroSolType ->setEnabled(false);
567 _snxtroCampId ->setEnabled(false);
568 }
569
570 if (enablePseudoObs) {
571 _pseudoObs->setEnabled(true);
572 if (pseudoObsUsed) {
573 _sigmaGIM->setEnabled(true);
574 _maxResGIM->setEnabled(true);
575 } else {
576 _sigmaGIM->setEnabled(false);
577 _maxResGIM->setEnabled(false);
578 }
579 } else {
580 _pseudoObs->setEnabled(false);
581 _sigmaGIM->setEnabled(false);
582 _maxResGIM->setEnabled(false);
583 }
584
585 _dataSource->setEnabled(true);
586
587 it.toFront();
588 while (it.hasNext()) {
589 QWidget* widget = it.next();
590 if (widget->isEnabled()) {
591 widget->setPalette(paletteWhite);
592 }
593 else {
594 widget->setPalette(paletteGray);
595 }
596 }
597}
598
599//
600////////////////////////////////////////////////////////////////////////////
601void t_pppWidgets::slotAddStation() {
602 int iRow = _staTable->rowCount();
603 _staTable->insertRow(iRow);
604 QString preferredAttributes = "G:12&CWPSLX R:12&CP E:1&CBX E:5&QIX C:26&IQX";
605
606 for (int iCol = 0; iCol < _staTable->columnCount(); iCol++) {
607 if (iCol == 0) _staTable->setItem(iRow, iCol, new QTableWidgetItem(""));
608 if (iCol == 1) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
609 if (iCol == 2) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
610 if (iCol == 3) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
611 if (iCol == 4) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
612 if (iCol == 5) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
613 if (iCol == 6) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
614 if (iCol == 7) _staTable->setItem(iRow, iCol, new QTableWidgetItem("0.1"));
615 if (iCol == 8) _staTable->setItem(iRow, iCol, new QTableWidgetItem("3e-6"));
616 if (iCol == 9) _staTable->setItem(iRow, iCol, new QTableWidgetItem("0"));
617 if (iCol == 10) _staTable->setItem(iRow, iCol, new QTableWidgetItem(preferredAttributes));
618 }
619}
620
621//
622////////////////////////////////////////////////////////////////////////////
623void t_pppWidgets::slotDelStation() {
624 int nRows = _staTable->rowCount();
625 std::vector <bool> flg(nRows);
626 for (int iRow = 0; iRow < nRows; iRow++) {
627 if (_staTable->item(iRow,1)->isSelected()) {
628 flg[iRow] = true;
629 }
630 else {
631 flg[iRow] = false;
632 }
633 }
634 for (int iRow = nRows-1; iRow >= 0; iRow--) {
635 if (flg[iRow]) {
636 _staTable->removeRow(iRow);
637 }
638 }
639}
640
641// PPP Text
642////////////////////////////////////////////////////////////////////////////
643void t_pppWidgets::slotPPPTextChanged(){
644
645 const static QPalette paletteWhite(QColor(255, 255, 255));
646 const static QPalette paletteGray(QColor(230, 230, 230));
647
648 // SNX TRO file sampling
649 // ---------------------
650 if (sender() == 0 || sender() == _snxtroPath) {
651 if ( _snxtroPath->text() != "" ) {
652 _snxtroSampl->setEnabled(true);
653 _snxtroIntr ->setEnabled(true);
654 _snxtroAc ->setEnabled(true);
655 _snxtroSolId ->setEnabled(true);
656 _snxtroSolType ->setEnabled(true);
657 _snxtroCampId ->setEnabled(true);
658 _snxtroSampl->setPalette(paletteWhite);
659 _snxtroIntr ->setPalette(paletteWhite);
660 _snxtroAc ->setPalette(paletteWhite);
661 _snxtroSolId ->setPalette(paletteWhite);
662 _snxtroSolType ->setPalette(paletteWhite);
663 _snxtroCampId ->setPalette(paletteWhite);
664 }
665 else {
666 _snxtroSampl->setEnabled(false);
667 _snxtroIntr ->setEnabled(false);
668 _snxtroAc ->setEnabled(false);
669 _snxtroSolId ->setEnabled(false);
670 _snxtroSolType ->setEnabled(false);
671 _snxtroCampId ->setEnabled(false);
672 _snxtroSampl->setPalette(paletteGray);
673 _snxtroIntr ->setPalette(paletteGray);
674 _snxtroAc ->setPalette(paletteGray);
675 _snxtroSolId ->setPalette(paletteGray);
676 _snxtroSolType ->setPalette(paletteGray);
677 _snxtroCampId ->setPalette(paletteGray);
678 }
679 }
680
681
682}
Note: See TracBrowser for help on using the repository browser.