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

Last change on this file since 8242 was 8231, checked in by wiese, 6 years ago

CHANGE: #105 QT5

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