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

Last change on this file since 7640 was 7640, checked in by stuerze, 8 years ago

some code cleanup

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