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

Last change on this file since 7495 was 7495, checked in by weber, 9 years ago

Set default interval for SINEX Troposphere files to 1 hour

File size: 24.9 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 _logFile = new QLineEdit(); _logFile ->setObjectName("PPP/logFilePPP"); _widgets << _logFile;
62 _nmeaFile = new QLineEdit(); _nmeaFile ->setObjectName("PPP/nmeaFile"); _widgets << _nmeaFile;
63 _snxtroFile = new QLineEdit(); _snxtroFile ->setObjectName("PPP/snxtroFile"); _widgets << _snxtroFile;
64 _snxtroSampl = new QSpinBox(); _snxtroSampl ->setObjectName("PPP/snxtroSampl"); _widgets << _snxtroSampl;
65 _snxtroIntr = new QComboBox(); _snxtroIntr ->setObjectName("PPP/_snxtroIntr"); _widgets << _snxtroIntr;
66 _staTable = new QTableWidget(); _staTable ->setObjectName("PPP/staTable"); _widgets << _staTable;
67 _lcGPS = new QComboBox(); _lcGPS ->setObjectName("PPP/lcGPS"); _widgets << _lcGPS;
68 _lcGLONASS = new QComboBox(); _lcGLONASS ->setObjectName("PPP/lcGLONASS"); _widgets << _lcGLONASS;
69 _lcGalileo = new QComboBox(); _lcGalileo ->setObjectName("PPP/lcGalileo"); _widgets << _lcGalileo;
70 _lcBDS = new QComboBox(); _lcBDS ->setObjectName("PPP/lcBDS"); _widgets << _lcBDS;
71 _sigmaC1 = new QLineEdit(); _sigmaC1 ->setObjectName("PPP/sigmaC1"); _widgets << _sigmaC1;
72 _sigmaL1 = new QLineEdit(); _sigmaL1 ->setObjectName("PPP/sigmaL1"); _widgets << _sigmaL1;
73 _maxResC1 = new QLineEdit(); _maxResC1 ->setObjectName("PPP/maxResC1"); _widgets << _maxResC1;
74 _maxResL1 = new QLineEdit(); _maxResL1 ->setObjectName("PPP/maxResL1"); _widgets << _maxResL1;
75 _minObs = new QSpinBox(); _minObs ->setObjectName("PPP/minObs"); _widgets << _minObs;
76 _minEle = new QSpinBox(); _minEle ->setObjectName("PPP/minEle"); _widgets << _minEle;
77 _eleWgtCode = new QCheckBox(); _eleWgtCode ->setObjectName("PPP/eleWgtCode"); _widgets << _eleWgtCode;
78 _eleWgtPhase = new QCheckBox(); _eleWgtPhase ->setObjectName("PPP/eleWgtPhase"); _widgets << _eleWgtPhase;
79 _seedingTime = new QLineEdit(); _seedingTime ->setObjectName("PPP/seedingTime"); _widgets << _seedingTime;
80 _corrWaitTime = new QSpinBox(); _corrWaitTime->setObjectName("PPP/corrWaitTime"); _widgets << _corrWaitTime;
81
82 _addStaButton = new QPushButton("Add Station"); _widgets << _addStaButton;
83 _delStaButton = new QPushButton("Delete Station"); _widgets << _delStaButton;
84
85 _addStaButton->setWhatsThis(tr("<p>Hit the 'Add Station' button to add a new line to the Station table.</p>"));
86 _delStaButton->setWhatsThis(tr("<p>Hit the 'Delete Station' button to delete a highlighted row from the Station table.</p>"));
87
88 _plotCoordinates = new QLineEdit; _plotCoordinates ->setObjectName("PPP/plotCoordinates"); _widgets << _plotCoordinates;
89 _mapWinButton = new QPushButton; _mapWinButton ->setObjectName("PPP/mapWinButton"); _widgets << _mapWinButton;
90 _useGoogleMap = new QRadioButton; _useGoogleMap ->setObjectName("PPP/useGoogleMap"); _widgets << _useGoogleMap;
91 _useOpenStreetMap = new QRadioButton; _useOpenStreetMap->setObjectName("PPP/useOpenStreetMap"); _widgets << _useOpenStreetMap;
92 _audioResponse = new QLineEdit; _audioResponse ->setObjectName("PPP/audioResponse"); _widgets << _audioResponse;
93 _mapWinDotSize = new QLineEdit; _mapWinDotSize ->setObjectName("PPP/mapWinDotSize"); _widgets << _mapWinDotSize;
94 _mapWinDotColor = new QComboBox; _mapWinDotColor ->setObjectName("PPP/mapWinDotColor"); _widgets << _mapWinDotColor;
95 _mapSpeedSlider = new QSlider; _mapSpeedSlider ->setObjectName("PPP/mapSpeedSlider"); _widgets << _mapSpeedSlider;
96
97 _dataSource->setEditable(false);
98 _dataSource->addItems(QString(",Real-Time Streams,RINEX Files").split(","));
99 connect(_dataSource, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(slotEnableWidgets()));
100
101 connect(_snxtroFile, SIGNAL(textChanged(const QString &)),
102 this, SLOT(slotPPPTextChanged()));
103
104 slotEnableWidgets();
105
106 _lcGPS->setEditable(false);
107#ifdef USE_PPP_SSR_I
108 _lcGPS->addItems(QString("P3,P3&L3").split(","));
109#else
110 _lcGPS->addItems(QString("no,P1,L1,P1&L1,P2,L2,P2&L2,Pi,Li,Pi&Li,P3,L3,P3&L3").split(","));
111#endif
112
113 _lcGLONASS->setEditable(false);
114#ifdef USE_PPP_SSR_I
115 _lcGLONASS->addItems(QString("no,P3,L3,P3&L3").split(","));
116#else
117 _lcGLONASS->addItems(QString("no,P1,L1,P1&L1,P2,L2,P2&L2,Pi,Li,Pi&Li,P3,L3,P3&L3").split(","));
118#endif
119
120 _lcGalileo->setEditable(false);
121#ifdef USE_PPP_SSR_I
122 _lcGalileo->addItems(QString("no,P3,L3,P3&L3").split(","));
123#else
124 _lcGalileo->addItems(QString("no,P1,L1,P1&L1,P5,L5,P5&L5,Pi,Li,Pi&Li,P3,L3,P3&L3").split(","));
125#endif
126
127 _lcBDS->setEditable(false);
128#ifdef USE_PPP_SSR_I
129 _lcBDS->addItems(QString("no,P3,L3,P3&L3").split(","));
130#else
131 _lcBDS->addItems(QString("no,P2,L2,P2&L2,P7,L7,P7&L7,Pi,Li,Pi&Li,P3,L3,P3&L3").split(","));
132#endif
133
134 _snxtroSampl->setMinimum(0);
135 _snxtroSampl->setMaximum(300);
136 _snxtroSampl->setSingleStep(30);
137 _snxtroSampl->setSuffix(" sec");
138
139 _snxtroIntr->setEditable(false);
140 _snxtroIntr->addItems(QString("1 min,2 min,5 min,10 min,15 min,30 min,1 hour,1 day").split(","));
141 _snxtroIntr->setCurrentIndex(6);
142
143 _minObs->setMinimum(4);
144 _minObs->setMaximum(6);
145 _minObs->setSingleStep(1);
146
147 _minEle->setMinimum(0);
148 _minEle->setMaximum(20);
149 _minEle->setSingleStep(1);
150 _minEle->setSuffix(" deg");
151
152 _corrWaitTime->setMinimum(0);
153 _corrWaitTime->setMaximum(20);
154 _corrWaitTime->setSingleStep(1);
155 _corrWaitTime->setSuffix(" sec");
156 _corrWaitTime->setSpecialValueText("no");
157
158 _staTable->setColumnCount(10);
159 _staTable->setRowCount(0);
160 _staTable->setHorizontalHeaderLabels(
161 QString("Station,Sigma N,Sigma E,Sigma H,Noise N,Noise E,Noise H,Tropo Sigma,Tropo Noise, NMEA Port").split(","));
162 _staTable->setSelectionMode(QAbstractItemView::ExtendedSelection);
163 _staTable->setSelectionBehavior(QAbstractItemView::SelectRows);
164 _staTable->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
165 _staTable->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft);
166
167 connect(_addStaButton, SIGNAL(clicked()), this, SLOT(slotAddStation()));
168 connect(_delStaButton, SIGNAL(clicked()), this, SLOT(slotDelStation()));
169
170 _mapWinButton->setText("Open Map");
171
172 _mapWinDotColor->setEditable(false);
173 _mapWinDotColor->addItems(QString("red,yellow").split(","));
174
175 _mapSpeedSlider->setOrientation(Qt::Horizontal);
176 _mapSpeedSlider->setRange(1, 100);
177 _mapSpeedSlider->setTickPosition(QSlider::TicksBelow);
178 _mapSpeedSlider->setTickInterval(10);
179 connect(_mapSpeedSlider, SIGNAL(valueChanged(int)), BNC_CORE, SIGNAL(mapSpeedSliderChanged(int)));
180
181 _staTable->setWhatsThis(tr("<p>Specify values for Sigma and white Noise of the Station's North, East and Height coordinates in meters. Specify also a Sigma in meters for a-priory model based Tropospheric delays and for the delay's Noise in meters per second.</p><p>Specifying one record per station is mandatory. BNC will only process data for stations wich are listed here.</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-priory 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-priory 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 for 3600 * 3e-6 = 0.01 meters per hour.</li></ul></p>"));
182
183 _seedingTime->setWhatsThis(tr("<p>Enter the lenght of a startup period in seconds for which you want to fix the PPP solutions to known a-priory coordinates as introduced through option 'Coordinates'. Adjust 'Sigma N/E/H' in the PPP Stations table according to the coordinates precision. Fixing a-priory 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-priory 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 the PPP solutions during startup to known a-priory coordinates.</p>"));
184
185 _corrWaitTime->setWhatsThis(tr("<p>Specifying 'no' means that BNC will not wait for clock corrections and process each epoch of observation data immediately after arrival using the satellite clock corrections available at that time.</p><p>Specifying a non-zero value (i.e. 5 sec) means that data will be buffered and the processing of each buffered epoch is postponed till satellite clock corrections not older than '5 sec' (example) become available.</p>"));
186
187 _plotCoordinates->setWhatsThis(tr("<p>BNC allows to produce a time series plot of coordinate displacements for one of your PPP stations 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'.</p><p>Default is an empty option field, meaning that BNC shall not produce a time series plot of PPP coordinate displacements.</p>"));
188
189 _mapWinButton->setWhatsThis(tr("<p>You make like to track your rover position using Google Maps or Open Street Map as a background map. Track maps can be produced with BNC in 'Realtime-PPP', 'Realtime-SPP' and 'Post-Processing' mode.</p><p>The 'Open Map' button opens a windows showing a map according to specified options.</p><p>Even in '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 programm needs to download the map data."));
190
191 _useGoogleMap->setWhatsThis(tr("<p>Specify Google Maps as the background for your rover positions."));
192
193 _useOpenStreetMap->setWhatsThis(tr("<p>Specify Open Street Map as the background for your rover positions."));
194
195 _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-priory marker coordinate.</p><p>Default is an empty option field, meaning that you don't want BNC to produce alarm signals.</p>"));
196
197 _mapWinDotSize->setWhatsThis(tr("<p>Specify the size of dots showing the 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.</p>"));
198
199 _mapWinDotColor->setWhatsThis(tr("<p>Specify the color of dots showing the rover track on the map.</p>"));
200
201 _mapSpeedSlider->setWhatsThis(tr("<p>With BNC in PPP post-processing mode you can specify the speed of computations as appropriate for 'Track map' visualization. Note that you can adjust 'speed' on-the-fly while BNC is already processing your observations."));
202
203 readOptions();
204}
205
206//
207////////////////////////////////////////////////////////////////////////////
208void t_pppWidgets::readOptions() {
209
210 bncSettings settings;
211
212 // ComboBoxes
213 // ----------
214 int ii = _dataSource->findText(settings.value(_dataSource->objectName()).toString());
215 if (ii != -1) {
216 _dataSource->setCurrentIndex(ii);
217 }
218 ii = _lcGPS->findText(settings.value(_lcGPS->objectName()).toString());
219 if (ii != -1) {
220 _lcGPS->setCurrentIndex(ii);
221 }
222 ii = _lcGLONASS->findText(settings.value(_lcGLONASS->objectName()).toString());
223 if (ii != -1) {
224 _lcGLONASS->setCurrentIndex(ii);
225 }
226 ii = _lcGalileo->findText(settings.value(_lcGalileo->objectName()).toString());
227 if (ii != -1) {
228 _lcGalileo->setCurrentIndex(ii);
229 }
230 ii = _lcBDS->findText(settings.value(_lcBDS->objectName()).toString());
231 if (ii != -1) {
232 _lcBDS->setCurrentIndex(ii);
233 }
234 ii = _snxtroIntr->findText(settings.value(_snxtroIntr->objectName()).toString());
235 if (ii != -1) {
236 _snxtroIntr->setCurrentIndex(ii);
237 }
238
239 // FileChoosers
240 // ------------
241 _rinexObs ->setFileName(settings.value(_rinexObs ->objectName()).toString());
242 _rinexNav ->setFileName(settings.value(_rinexNav ->objectName()).toString());
243 _corrFile ->setFileName(settings.value(_corrFile ->objectName()).toString());
244 _crdFile ->setFileName(settings.value(_crdFile ->objectName()).toString());
245 _antexFile->setFileName(settings.value(_antexFile->objectName()).toString());
246
247 // LineEdits
248 // ---------
249 _corrMount ->setText(settings.value(_corrMount ->objectName()).toString());
250 _logFile ->setText(settings.value(_logFile ->objectName()).toString());
251 _nmeaFile ->setText(settings.value(_nmeaFile ->objectName()).toString());
252 _snxtroFile ->setText(settings.value(_snxtroFile ->objectName()).toString());
253
254 if (!settings.value(_sigmaC1->objectName()).toString().isEmpty()) {
255 _sigmaC1->setText(settings.value(_sigmaC1->objectName()).toString());
256 }
257 else {
258 _sigmaC1->setText("2.0");
259 }
260
261 if (!settings.value(_sigmaL1->objectName()).toString().isEmpty()) {
262 _sigmaL1->setText(settings.value(_sigmaL1->objectName()).toString());
263 }
264 else {
265 _sigmaL1->setText("0.01");
266 }
267
268 if (!settings.value(_maxResC1->objectName()).toString().isEmpty()) {
269 _maxResC1->setText(settings.value(_maxResC1->objectName()).toString());
270 }
271 else {
272 _maxResC1->setText("4.0");
273 }
274
275 if (!settings.value(_maxResL1->objectName()).toString().isEmpty()) {
276 _maxResL1->setText(settings.value(_maxResL1->objectName()).toString());
277 }
278 else {
279 _maxResL1->setText("0.03");
280 }
281
282 if (!settings.value(_seedingTime->objectName()).toString().isEmpty()) {
283 _seedingTime->setText(settings.value(_seedingTime->objectName()).toString());
284 }
285 else {
286 _seedingTime->setText("0");
287 }
288
289 // CheckBoxes
290 // ----------
291 _eleWgtCode ->setCheckState(Qt::CheckState(settings.value(_eleWgtCode ->objectName()).toInt()));
292 _eleWgtPhase->setCheckState(Qt::CheckState(settings.value(_eleWgtPhase->objectName()).toInt()));
293
294 // SpinBoxex
295 // ---------
296 _minObs->setValue(settings.value(_minObs->objectName()).toInt());
297 _minEle->setValue(settings.value(_minEle->objectName()).toInt());
298 _corrWaitTime->setValue(settings.value(_corrWaitTime->objectName()).toInt());
299 _snxtroSampl->setValue(settings.value(_snxtroSampl->objectName()).toInt());
300
301 // Table with stations
302 // -------------------
303 for (int iRow = _staTable->rowCount()-1; iRow >=0; iRow--) {
304 _staTable->removeRow(iRow);
305 }
306 int iRow = -1;
307 QListIterator<QString> it(settings.value(_staTable->objectName()).toStringList());
308 while (it.hasNext()) {
309 QStringList hlp = it.next().split(",");
310 ++iRow;
311 _staTable->insertRow(iRow);
312 for (int iCol = 0; iCol < hlp.size(); iCol++) {
313 _staTable->setItem(iRow, iCol, new QTableWidgetItem(hlp[iCol]));
314 }
315 }
316
317 // Plots and Maps
318 // --------------
319 _plotCoordinates ->setText(settings.value(_plotCoordinates->objectName()).toString());
320 _audioResponse ->setText(settings.value(_audioResponse->objectName()).toString());
321 _useGoogleMap ->setChecked(settings.value(_useGoogleMap->objectName()).toBool());
322 _useOpenStreetMap->setChecked(settings.value(_useOpenStreetMap->objectName()).toBool());
323 _mapWinDotSize ->setText(settings.value(_mapWinDotSize->objectName()).toString());
324
325 ii = _mapWinDotColor->findText(settings.value(_mapWinDotColor->objectName()).toString());
326 if (ii != -1) {
327 _mapWinDotColor->setCurrentIndex(ii);
328 }
329
330 int speed = settings.value(_mapSpeedSlider->objectName()).toInt();
331 if (speed == 0) speed = _mapSpeedSlider->maximum();
332 _mapSpeedSlider->setSliderPosition(speed);
333}
334
335//
336////////////////////////////////////////////////////////////////////////////
337void t_pppWidgets::saveOptions() {
338
339 bncSettings settings;
340
341 settings.setValue(_dataSource ->objectName(), _dataSource ->currentText());
342 settings.setValue(_rinexObs ->objectName(), _rinexObs ->fileName());
343 settings.setValue(_rinexNav ->objectName(), _rinexNav ->fileName());
344 settings.setValue(_corrMount ->objectName(), _corrMount ->text());
345 settings.setValue(_corrFile ->objectName(), _corrFile ->fileName());
346 settings.setValue(_crdFile ->objectName(), _crdFile ->fileName());
347 settings.setValue(_antexFile ->objectName(), _antexFile ->fileName());
348 settings.setValue(_logFile ->objectName(), _logFile ->text());
349 settings.setValue(_nmeaFile ->objectName(), _nmeaFile ->text());
350 settings.setValue(_snxtroFile ->objectName(), _snxtroFile ->text());
351 settings.setValue(_snxtroSampl ->objectName(), _snxtroSampl ->value());
352 settings.setValue(_snxtroIntr ->objectName(), _snxtroIntr ->currentText());
353 settings.setValue(_lcGPS ->objectName(), _lcGPS ->currentText());
354 settings.setValue(_lcGLONASS ->objectName(), _lcGLONASS ->currentText());
355 settings.setValue(_lcGalileo ->objectName(), _lcGalileo ->currentText());
356 settings.setValue(_lcBDS ->objectName(), _lcBDS ->currentText());
357 settings.setValue(_sigmaC1 ->objectName(), _sigmaC1 ->text());
358 settings.setValue(_sigmaL1 ->objectName(), _sigmaL1 ->text());
359 settings.setValue(_corrWaitTime->objectName(), _corrWaitTime->value());
360 settings.setValue(_maxResC1 ->objectName(), _maxResC1 ->text());
361 settings.setValue(_maxResL1 ->objectName(), _maxResL1 ->text());
362 settings.setValue(_seedingTime ->objectName(), _seedingTime ->text());
363 settings.setValue(_minObs ->objectName(), _minObs ->value());
364 settings.setValue(_minEle ->objectName(), _minEle ->value());
365 settings.setValue(_eleWgtCode ->objectName(), _eleWgtCode ->checkState());
366 settings.setValue(_eleWgtPhase ->objectName(), _eleWgtPhase ->checkState());
367
368 QStringList staList;
369 for (int iRow = 0; iRow < _staTable->rowCount(); iRow++) {
370 QString hlp;
371 for (int iCol = 0; iCol < _staTable->columnCount(); iCol++) {
372 if (_staTable->item(iRow, iCol)) {
373 hlp += _staTable->item(iRow, iCol)->text() + ",";
374 }
375 }
376 if (!hlp.isEmpty()) {
377 staList << hlp;
378 }
379 }
380 settings.setValue(_staTable->objectName(), staList);
381
382 settings.setValue(_plotCoordinates ->objectName(), _plotCoordinates ->text());
383 settings.setValue(_audioResponse ->objectName(), _audioResponse ->text());
384 settings.setValue(_useGoogleMap ->objectName(), _useGoogleMap ->isChecked());
385 settings.setValue(_useOpenStreetMap->objectName(), _useOpenStreetMap->isChecked());
386 settings.setValue(_mapWinDotSize ->objectName(), _mapWinDotSize ->text());
387 settings.setValue(_mapWinDotColor ->objectName(), _mapWinDotColor ->currentText());
388 settings.setValue(_mapSpeedSlider ->objectName(), _mapSpeedSlider ->value());
389}
390
391//
392////////////////////////////////////////////////////////////////////////////
393void t_pppWidgets::slotEnableWidgets() {
394
395 const static QPalette paletteWhite(QColor(255, 255, 255));
396 const static QPalette paletteGray(QColor(230, 230, 230));
397
398 bool allDisabled = _dataSource->currentText() == "";
399 bool realTime = _dataSource->currentText() == "Real-Time Streams";
400 bool rinexFiles = _dataSource->currentText() == "RINEX Files";
401
402 QListIterator<QWidget*> it(_widgets);
403 while (it.hasNext()) {
404 QWidget* widget = it.next();
405 widget->setEnabled(!allDisabled);
406 }
407
408 if (realTime) {
409 _rinexObs->setEnabled(false);
410 _rinexNav->setEnabled(false);
411 _corrFile->setEnabled(false);
412 }
413 else if (rinexFiles) {
414 _corrMount->setEnabled(false);
415// _plotCoordinates->setEnabled(false);
416// _audioResponse->setEnabled(false);
417 }
418
419 if ( _snxtroFile->text() != "" && !allDisabled) {
420 _snxtroSampl->setEnabled(true);
421 _snxtroIntr ->setEnabled(true);
422 }
423 else {
424 _snxtroSampl->setEnabled(false);
425 _snxtroIntr ->setEnabled(false);
426 }
427
428 _dataSource->setEnabled(true);
429
430 it.toFront();
431 while (it.hasNext()) {
432 QWidget* widget = it.next();
433 if (widget->isEnabled()) {
434 widget->setPalette(paletteWhite);
435 }
436 else {
437 widget->setPalette(paletteGray);
438 }
439 }
440}
441
442//
443////////////////////////////////////////////////////////////////////////////
444void t_pppWidgets::slotAddStation() {
445 int iRow = _staTable->rowCount();
446 _staTable->insertRow(iRow);
447 for (int iCol = 0; iCol < _staTable->columnCount(); iCol++) {
448 if (iCol == 0) _staTable->setItem(iRow, iCol, new QTableWidgetItem(""));
449 if (iCol == 1) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
450 if (iCol == 2) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
451 if (iCol == 3) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
452 if (iCol == 4) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
453 if (iCol == 5) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
454 if (iCol == 6) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
455 if (iCol == 7) _staTable->setItem(iRow, iCol, new QTableWidgetItem("0.1"));
456 if (iCol == 8) _staTable->setItem(iRow, iCol, new QTableWidgetItem("3e-6"));
457 if (iCol == 9) _staTable->setItem(iRow, iCol, new QTableWidgetItem("0"));
458 }
459}
460
461//
462////////////////////////////////////////////////////////////////////////////
463void t_pppWidgets::slotDelStation() {
464 int nRows = _staTable->rowCount();
465 bool flg[nRows];
466 for (int iRow = 0; iRow < nRows; iRow++) {
467 if (_staTable->isItemSelected(_staTable->item(iRow,1))) {
468 flg[iRow] = true;
469 }
470 else {
471 flg[iRow] = false;
472 }
473 }
474 for (int iRow = nRows-1; iRow >= 0; iRow--) {
475 if (flg[iRow]) {
476 _staTable->removeRow(iRow);
477 }
478 }
479}
480
481// PPP Text
482////////////////////////////////////////////////////////////////////////////
483void t_pppWidgets::slotPPPTextChanged(){
484
485 const static QPalette paletteWhite(QColor(255, 255, 255));
486 const static QPalette paletteGray(QColor(230, 230, 230));
487
488 // SNX TRO file sampling
489 // ---------------------
490 if (sender() == 0 || sender() == _snxtroFile) {
491 if ( _snxtroFile->text() != "" ) {
492 _snxtroSampl->setEnabled(true);
493 _snxtroIntr->setEnabled(true);
494 _snxtroSampl->setPalette(paletteWhite);
495 _snxtroIntr->setPalette(paletteWhite);
496 }
497 else {
498 _snxtroSampl->setEnabled(false);
499 _snxtroIntr->setEnabled(false);
500 _snxtroSampl->setPalette(paletteGray);
501 _snxtroIntr->setPalette(paletteGray);
502 }
503 }
504}
Note: See TracBrowser for help on using the repository browser.