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

Last change on this file since 10793 was 10791, checked in by mervart, 2 weeks ago

BNC Multifrequency and PPPAR Client (initial version)

File size: 27.3 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 _biasMount = new QLineEdit(); _biasMount ->setObjectName("PPP/biasMount"); _widgets << _biasMount;
68 _ionoMount = new QLineEdit(); _ionoMount ->setObjectName("PPP/ionoMount"); _widgets << _ionoMount;
69 _corrFile = new qtFileChooser(); _corrFile ->setObjectName("PPP/corrFile"); _widgets << _corrFile;
70 _biasFile = new qtFileChooser(); _biasFile ->setObjectName("PPP/biasFile"); _widgets << _biasFile;
71 _ionoFile = new qtFileChooser(); _ionoFile ->setObjectName("PPP/ionoFile"); _widgets << _ionoFile;
72 _crdFile = new qtFileChooser(); _crdFile ->setObjectName("PPP/crdFile"); _widgets << _crdFile;
73 _antexFile = new qtFileChooser(); _antexFile ->setObjectName("PPP/antexFile"); _widgets << _antexFile;
74 _blqFile = new qtFileChooser(); _blqFile ->setObjectName("PPP/blqFile"); _widgets << _blqFile;
75 _logPath = new QLineEdit(); _logPath ->setObjectName("PPP/logPath"); _widgets << _logPath;
76 _logMode = new QComboBox(); _logMode ->setObjectName("PPP/logMode"); _widgets << _logMode;
77 _nmeaPath = new QLineEdit(); _nmeaPath ->setObjectName("PPP/nmeaPath"); _widgets << _nmeaPath;
78 _snxtroPath = new QLineEdit(); _snxtroPath ->setObjectName("PPP/snxtroPath"); _widgets << _snxtroPath;
79 _snxtroSampl = new QComboBox(); _snxtroSampl ->setObjectName("PPP/snxtroSampl"); _widgets << _snxtroSampl;
80 _snxtroIntr = new QComboBox(); _snxtroIntr ->setObjectName("PPP/snxtroIntr"); _widgets << _snxtroIntr;
81 _snxtroAc = new QLineEdit(); _snxtroAc ->setObjectName("PPP/snxtroAc"); _widgets << _snxtroAc;
82 _snxtroSolId = new QLineEdit(); _snxtroSolId ->setObjectName("PPP/snxtroSolId"); _widgets << _snxtroSolId;
83 _snxtroSolType= new QLineEdit(); _snxtroSolType->setObjectName("PPP/snxtroSolType");_widgets << _snxtroSolType;
84 _snxtroCampId = new QLineEdit(); _snxtroCampId ->setObjectName("PPP/snxtroCampId");_widgets << _snxtroCampId;
85 _staTable = new QTableWidget(); _staTable ->setObjectName("PPP/staTable"); _widgets << _staTable;
86 _lcGPS = new QComboBox(); _lcGPS ->setObjectName("PPP/lcGPS"); _widgets << _lcGPS;
87 _lcGLONASS = new QComboBox(); _lcGLONASS ->setObjectName("PPP/lcGLONASS"); _widgets << _lcGLONASS;
88 _lcGalileo = new QComboBox(); _lcGalileo ->setObjectName("PPP/lcGalileo"); _widgets << _lcGalileo;
89 _lcBDS = new QComboBox(); _lcBDS ->setObjectName("PPP/lcBDS"); _widgets << _lcBDS;
90 _constraints = new QComboBox(); _constraints ->setObjectName("PPP/constraints"); _widgets << _constraints;
91 _sigmaC1 = new QLineEdit(); _sigmaC1 ->setObjectName("PPP/sigmaC1"); _widgets << _sigmaC1;
92 _sigmaL1 = new QLineEdit(); _sigmaL1 ->setObjectName("PPP/sigmaL1"); _widgets << _sigmaL1;
93 _sigmaGIM = new QLineEdit(); _sigmaGIM ->setObjectName("PPP/sigmaGIM"); _widgets << _sigmaGIM;
94 _maxResC1 = new QLineEdit(); _maxResC1 ->setObjectName("PPP/maxResC1"); _widgets << _maxResC1;
95 _maxResL1 = new QLineEdit(); _maxResL1 ->setObjectName("PPP/maxResL1"); _widgets << _maxResL1;
96 _maxResGIM = new QLineEdit(); _maxResGIM ->setObjectName("PPP/maxResGIM"); _widgets << _maxResGIM;
97 _minObs = new QSpinBox(); _minObs ->setObjectName("PPP/minObs"); _widgets << _minObs;
98 _minEle = new QSpinBox(); _minEle ->setObjectName("PPP/minEle"); _widgets << _minEle;
99 _eleWgtCode = new QCheckBox(); _eleWgtCode ->setObjectName("PPP/eleWgtCode"); _widgets << _eleWgtCode;
100 _eleWgtPhase = new QCheckBox(); _eleWgtPhase ->setObjectName("PPP/eleWgtPhase"); _widgets << _eleWgtPhase;
101 _seedingTime = new QLineEdit(); _seedingTime ->setObjectName("PPP/seedingTime"); _widgets << _seedingTime;
102 _corrWaitTime = new QSpinBox(); _corrWaitTime->setObjectName("PPP/corrWaitTime"); _widgets << _corrWaitTime;
103
104 _arGPS = new QCheckBox(); _arGPS ->setObjectName("PPP/arGPS"); _widgets << _arGPS;
105 _arGalileo = new QCheckBox(); _arGalileo ->setObjectName("PPP/arGalileo"); _widgets << _arGalileo;
106 _arBDS = new QCheckBox(); _arBDS ->setObjectName("PPP/arBDS"); _widgets << _arBDS;
107 _arMinNumEpo = new QSpinBox(); _arMinNumEpo ->setObjectName("PPP/arMinNumEpo"); _widgets << _arMinNumEpo;
108 _arMinNumSat = new QSpinBox(); _arMinNumSat ->setObjectName("PPP/arMinNumSat"); _widgets << _arMinNumSat;
109 _arUseYaw = new QCheckBox(); _arUseYaw ->setObjectName("PPP/arUseYaw"); _widgets << _arUseYaw;
110 _arMaxFrac = new QLineEdit(); _arMaxFrac ->setObjectName("PPP/arMaxFrac"); _widgets << _arMaxFrac;
111 _arMaxSig = new QLineEdit(); _arMaxSig ->setObjectName("PPP/arMaxSig"); _widgets << _arMaxSig;
112
113 _addStaButton = new QPushButton("Add Station"); _widgets << _addStaButton;
114 _delStaButton = new QPushButton("Delete Station"); _widgets << _delStaButton;
115
116 _addStaButton->setWhatsThis(tr("<p>Hit the 'Add Station' button to add a new line to the Station table.</p>"));
117 _delStaButton->setWhatsThis(tr("<p>Hit the 'Delete Station' button to delete a highlighted row from the Station table.</p>"));
118
119 _plotCoordinates = new QLineEdit; _plotCoordinates ->setObjectName("PPP/plotCoordinates"); _widgets << _plotCoordinates;
120 _mapWinButton = new QPushButton; _mapWinButton ->setObjectName("PPP/mapWinButton"); _widgets << _mapWinButton;
121 _audioResponse = new QLineEdit; _audioResponse ->setObjectName("PPP/audioResponse"); _widgets << _audioResponse;
122 _mapWinDotSize = new QLineEdit; _mapWinDotSize ->setObjectName("PPP/mapWinDotSize"); _widgets << _mapWinDotSize;
123 _mapWinDotColor = new QComboBox; _mapWinDotColor ->setObjectName("PPP/mapWinDotColor"); _widgets << _mapWinDotColor;
124 _mapSpeedSlider = new QSlider; _mapSpeedSlider ->setObjectName("PPP/mapSpeedSlider"); _widgets << _mapSpeedSlider;
125
126 _dataSource->setEditable(false);
127 _dataSource->addItems(QString(",Real-Time Streams,RINEX Files").split(","));
128 connect(_dataSource, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(slotEnableWidgets()));
129 connect(_constraints, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(slotEnableWidgets()));
130 connect(_arGPS, SIGNAL(stateChanged(int)), this, SLOT(slotEnableWidgets()));
131 connect(_arGalileo, SIGNAL(stateChanged(int)), this, SLOT(slotEnableWidgets()));
132 connect(_arBDS, SIGNAL(stateChanged(int)), this, SLOT(slotEnableWidgets()));
133 connect(_snxtroPath, SIGNAL(textChanged(const QString &)), this, SLOT(slotPPPTextChanged()));
134 connect(_snxtroAc, SIGNAL(textChanged(const QString &)), this, SLOT(slotPPPTextChanged()));
135 connect(_snxtroSolId, SIGNAL(textChanged(const QString &)), this, SLOT(slotPPPTextChanged()));
136 connect(_snxtroSolType, SIGNAL(textChanged(const QString &)), this, SLOT(slotPPPTextChanged()));
137 connect(_snxtroCampId, SIGNAL(textChanged(const QString &)), this, SLOT(slotPPPTextChanged()));
138
139 _logMode->setEditable(false);
140 _logMode->addItems(QString("normal,debug,all").split(","));
141
142 slotEnableWidgets();
143
144 _lcGPS->setEditable(true);
145 _lcGPS->addItems(QString("Pi&Li,Pi,P1&L1,P1,P3&L3,P3,L3,no,P125&L125").split(","));
146
147 _lcGLONASS->setEditable(false);
148 _lcGLONASS->addItems(QString("Pi&Li,Pi,P1&L1,P1,P3&L3,P3,L3,no").split(","));
149
150 _lcGalileo->setEditable(true);
151 _lcGalileo->addItems(QString("Pi&Li,Pi,P1&L1,P1,P3&L3,P3,L3,no,P1576&L1576").split(","));
152
153 _lcBDS->setEditable(true);
154 _lcBDS->addItems(QString("Pi&Li,Pi,P1&L1,P1,P3&L3,P3,L3,no,P1576&L1576").split(","));
155
156 _constraints->setEditable(false);
157 _constraints->addItems(QString("no,Ionosphere: pseudo-obs").split(","));
158
159 _snxtroSampl->setEditable(false);
160 _snxtroSampl->addItems(QString("1 sec,5 sec,10 sec,30 sec,60 sec,300 sec").split(","));
161
162 _snxtroIntr->setEditable(false);
163 _snxtroIntr->addItems(QString("1 min,2 min,5 min,10 min,15 min,30 min,1 hour,1 day").split(","));
164 _snxtroIntr->setCurrentIndex(6);
165
166 _minObs->setMinimum(4);
167 _minObs->setMaximum(6);
168 _minObs->setSingleStep(1);
169
170 _minEle->setMinimum(0);
171 _minEle->setMaximum(20);
172 _minEle->setSingleStep(1);
173 _minEle->setSuffix(" deg");
174
175 _arMinNumEpo->setMinimum(5);
176 _arMinNumEpo->setMaximum(60);
177 _arMinNumEpo->setSingleStep(5);
178
179 _arMinNumSat->setMinimum(4);
180 _arMinNumSat->setMaximum(8);
181 _arMinNumSat->setSingleStep(1);
182
183 _corrWaitTime->setMinimum(0);
184 _corrWaitTime->setMaximum(20);
185 _corrWaitTime->setSingleStep(1);
186 _corrWaitTime->setSuffix(" sec");
187
188 _staTable->setColumnCount(11);
189 _staTable->setRowCount(0);
190 _staTable->setHorizontalHeaderLabels(
191 QString("Station,Sigma N,Sigma E,Sigma H,Noise N,Noise E,Noise H,Tropo Sigma,Tropo Noise, NMEA Port,Signal Priorities").split(","));
192 _staTable->setSelectionMode(QAbstractItemView::ExtendedSelection);
193 _staTable->setSelectionBehavior(QAbstractItemView::SelectRows);
194 _staTable->setColumnWidth(0,120);
195 _staTable->setColumnWidth(10,220);
196#if QT_VERSION >= 0x050000
197 _staTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
198#endif
199 _staTable->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft);
200 connect(_addStaButton, SIGNAL(clicked()), this, SLOT(slotAddStation()));
201 connect(_delStaButton, SIGNAL(clicked()), this, SLOT(slotDelStation()));
202
203 _mapWinButton->setText("Open Map");
204
205 _mapWinDotColor->setEditable(false);
206 _mapWinDotColor->addItems(QString("red,yellow").split(","));
207
208 _mapSpeedSlider->setOrientation(Qt::Horizontal);
209 _mapSpeedSlider->setRange(1, 100);
210 _mapSpeedSlider->setTickPosition(QSlider::TicksBelow);
211 _mapSpeedSlider->setTickInterval(10);
212 connect(_mapSpeedSlider, SIGNAL(valueChanged(int)), BNC_CORE, SIGNAL(mapSpeedSliderChanged(int)));
213
214 // WhatsThis, PPP (2)
215 // ------------------
216 _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>"));
217 _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>"));
218
219 // WhatsThis, PPP (3)
220 // ------------------
221 _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>"
222 "<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>"
223 "<p>'Signal Priorities' can be specified as system (G,R,E,C) and frequency specific. Two frequency bands per GNSS are allowed and will be considered. The following frequency bands are available for selection: <ul>"
224 "<li>G: 1, 2, 5</li>"
225 "<li>R: 1, 2</li>"
226 "<li>E: 1, 5, 6, 7, 8</li>"
227 "<li>C: 1, 2, 5, 6, 7, 8</li>"
228 "</ul>"
229 "<p>'Default 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>"
230 "<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> "
231 "<p> <i>[key: PPP/staTable]</i></p>"));
232
233 // WhatsThis, PPP (4)
234 // ------------------
235 _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>"));
236 _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>"));
237 _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>"));
238 _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>"));
239 _mapWinDotColor->setWhatsThis(tr("<p>Specify the color of dots showing the rover track on the map. <i>[key: PPP/mapWinDotColor]</i></p>"));
240 _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>"));
241
242 readOptions();
243}
244
245//
246////////////////////////////////////////////////////////////////////////////
247t_pppWidgets::~t_pppWidgets() {
248}
249
250//
251////////////////////////////////////////////////////////////////////////////
252void t_pppWidgets::readOptions() {
253
254 bncSettings settings;
255
256 auto setWidgetValue = [settings](QWidget* widget, QString defValue = QString()) {
257 if (auto* obj = qobject_cast<QLineEdit*>(widget)) {
258 QString text = settings.value(obj->objectName()).toString();
259 if (text.isEmpty() && !defValue.isEmpty()) {
260 text = defValue;
261 }
262 obj->setText(text);
263 }
264 else if (auto* obj = qobject_cast<QComboBox*>(widget)) {
265 QString text = settings.value(obj->objectName()).toString();
266 int ii = obj->findText(text);
267 if (ii != -1) {
268 obj->setCurrentIndex(ii);
269 }
270 else if (obj->isEditable()) {
271 obj->insertItem(0, text);
272 obj->setCurrentIndex(0);
273 }
274 }
275 else if (auto* obj = qobject_cast<qtFileChooser*>(widget)) {
276 obj->setFileName(settings.value(obj->objectName()).toString());
277 }
278 else if (auto* obj = qobject_cast<QCheckBox*>(widget)) {
279 obj->setCheckState(Qt::CheckState(settings.value(obj->objectName()).toInt()));
280 }
281 else if (auto* obj = qobject_cast<QSpinBox*>(widget)) {
282 obj->setValue(settings.value(obj->objectName()).toInt());
283 }
284 else if (auto* obj = qobject_cast<QSlider*>(widget)) {
285 int value = settings.value(obj->objectName()).toInt();
286 if (value == 0) value = obj->maximum();
287 obj->setSliderPosition(value);
288 }
289 };
290
291 QListIterator<QWidget*> iw(_widgets);
292 while (iw.hasNext()) {
293 setWidgetValue(iw.next());
294 }
295
296 // Set default values for some widgets
297 // -----------------------------------
298 setWidgetValue(_sigmaC1, "1.0");
299 setWidgetValue(_sigmaL1, "0.01");
300 setWidgetValue(_sigmaGIM, "1.0");
301 setWidgetValue(_maxResC1, "3.0");
302 setWidgetValue(_maxResL1, "0.03");
303 setWidgetValue(_maxResGIM, "3.0");
304 setWidgetValue(_seedingTime, "0");
305
306 // Table with stations
307 // -------------------
308 for (int iRow = _staTable->rowCount()-1; iRow >=0; iRow--) {
309 _staTable->removeRow(iRow);
310 }
311 int iRow = -1;
312 QListIterator<QString> it(settings.value(_staTable->objectName()).toStringList());
313 while (it.hasNext()) {
314 QStringList hlp = it.next().split(",");
315 ++iRow;
316 _staTable->insertRow(iRow);
317 for (int iCol = 0; iCol < hlp.size(); iCol++) {
318 _staTable->setItem(iRow, iCol, new QTableWidgetItem(hlp[iCol]));
319 }
320 }
321}
322
323//
324////////////////////////////////////////////////////////////////////////////
325void t_pppWidgets::saveOptions() {
326
327 bncSettings settings;
328
329 auto storeWidgetValue = [&settings](QWidget* widget) {
330 if (auto* obj = qobject_cast<QLineEdit*>(widget)) {
331 settings.setValue(obj->objectName(), obj->text());
332 }
333 else if (auto* obj = qobject_cast<QComboBox*>(widget)) {
334 settings.setValue(obj->objectName(), obj->currentText());
335 }
336 else if (auto* obj = qobject_cast<qtFileChooser*>(widget)) {
337 settings.setValue(obj->objectName(), obj->fileName());
338 }
339 else if (auto* obj = qobject_cast<QCheckBox*>(widget)) {
340 settings.setValue(obj->objectName(), obj->checkState());
341 }
342 else if (auto* obj = qobject_cast<QSpinBox*>(widget)) {
343 settings.setValue(obj->objectName(), obj->value());
344 }
345 else if (auto* obj = qobject_cast<QSlider*>(widget)) {
346 settings.setValue(obj->objectName(), obj->value());
347 }
348 };
349
350 QListIterator<QWidget*> it(_widgets);
351 while (it.hasNext()) {
352 storeWidgetValue(it.next());
353 }
354
355 QStringList staList;
356 for (int iRow = 0; iRow < _staTable->rowCount(); iRow++) {
357 QString hlp;
358 for (int iCol = 0; iCol < _staTable->columnCount(); iCol++) {
359 if (_staTable->item(iRow, iCol)) {
360 hlp += _staTable->item(iRow, iCol)->text() + ",";
361 }
362 }
363 if (!hlp.isEmpty()) {
364 staList << hlp;
365 }
366 }
367 settings.setValue(_staTable->objectName(), staList);
368}
369
370//
371////////////////////////////////////////////////////////////////////////////
372void t_pppWidgets::slotEnableWidgets() {
373
374 const static QPalette paletteWhite(QColor(255, 255, 255));
375 const static QPalette paletteGray(QColor(230, 230, 230));
376
377 bool allDisabled = _dataSource->currentText() == "";
378 bool realTime = _dataSource->currentText() == "Real-Time Streams";
379 bool rinexFiles = _dataSource->currentText() == "RINEX Files";
380 bool pseudoObsIono = _constraints->currentText() == "Ionosphere: pseudo-obs";
381
382 QListIterator<QWidget*> it(_widgets);
383 while (it.hasNext()) {
384 QWidget* widget = it.next();
385 widget->setEnabled(!allDisabled);
386 }
387
388 if (realTime) {
389 _rinexObs->setEnabled(false);
390 _rinexNav->setEnabled(false);
391 _corrFile->setEnabled(false);
392 _biasFile->setEnabled(false);
393 _ionoFile->setEnabled(false);
394 }
395 else if (rinexFiles) {
396 _corrMount ->setEnabled(false);
397 _biasMount ->setEnabled(false);
398 _ionoMount ->setEnabled(false);
399 _audioResponse->setEnabled(false);
400 }
401
402 if ( _snxtroPath->text() != "" && !allDisabled) {
403 _snxtroSampl ->setEnabled(true);
404 _snxtroIntr ->setEnabled(true);
405 _snxtroAc ->setEnabled(true);
406 _snxtroSolId ->setEnabled(true);
407 _snxtroSolType->setEnabled(true);
408 _snxtroCampId ->setEnabled(true);
409 }
410 else {
411 _snxtroSampl ->setEnabled(false);
412 _snxtroIntr ->setEnabled(false);
413 _snxtroAc ->setEnabled(false);
414 _snxtroSolId ->setEnabled(false);
415 _snxtroSolType->setEnabled(false);
416 _snxtroCampId ->setEnabled(false);
417 }
418
419
420 if (pseudoObsIono) {
421 _sigmaGIM->setEnabled(true);
422 _maxResGIM->setEnabled(true);
423 } else {
424 _sigmaGIM->setEnabled(false);
425 _maxResGIM->setEnabled(false);
426 }
427
428 bool ar = (_arGPS->checkState() == Qt::Checked ||
429 _arGalileo->checkState() == Qt::Checked ||
430 _arBDS->checkState() == Qt::Checked);
431 _arMinNumEpo->setEnabled(ar);
432 _arMinNumSat->setEnabled(ar);
433 _arUseYaw ->setEnabled(ar);
434 _arMaxFrac ->setEnabled(ar);
435 _arMaxSig ->setEnabled(ar);
436
437 _dataSource->setEnabled(true);
438
439 it.toFront();
440 while (it.hasNext()) {
441 QWidget* widget = it.next();
442 if (widget->isEnabled()) {
443 widget->setPalette(paletteWhite);
444 }
445 else {
446 widget->setPalette(paletteGray);
447 }
448 }
449}
450
451//
452////////////////////////////////////////////////////////////////////////////
453void t_pppWidgets::slotAddStation() {
454 int iRow = _staTable->rowCount();
455 _staTable->insertRow(iRow);
456 QString preferredAttributes = "G:12&CWPSLX R:12&CP E:1&CBX E:5&QIX C:26&IQX";
457
458 for (int iCol = 0; iCol < _staTable->columnCount(); iCol++) {
459 if (iCol == 0) _staTable->setItem(iRow, iCol, new QTableWidgetItem(""));
460 if (iCol == 1) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
461 if (iCol == 2) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
462 if (iCol == 3) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
463 if (iCol == 4) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
464 if (iCol == 5) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
465 if (iCol == 6) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
466 if (iCol == 7) _staTable->setItem(iRow, iCol, new QTableWidgetItem("0.1"));
467 if (iCol == 8) _staTable->setItem(iRow, iCol, new QTableWidgetItem("3e-6"));
468 if (iCol == 9) _staTable->setItem(iRow, iCol, new QTableWidgetItem("0"));
469 if (iCol == 10) _staTable->setItem(iRow, iCol, new QTableWidgetItem(preferredAttributes));
470 }
471}
472
473//
474////////////////////////////////////////////////////////////////////////////
475void t_pppWidgets::slotDelStation() {
476 int nRows = _staTable->rowCount();
477 std::vector <bool> flg(nRows);
478 for (int iRow = 0; iRow < nRows; iRow++) {
479 if (_staTable->item(iRow,1)->isSelected()) {
480 flg[iRow] = true;
481 }
482 else {
483 flg[iRow] = false;
484 }
485 }
486 for (int iRow = nRows-1; iRow >= 0; iRow--) {
487 if (flg[iRow]) {
488 _staTable->removeRow(iRow);
489 }
490 }
491}
492
493// PPP Text
494////////////////////////////////////////////////////////////////////////////
495void t_pppWidgets::slotPPPTextChanged(){
496
497 const static QPalette paletteWhite(QColor(255, 255, 255));
498 const static QPalette paletteGray (QColor(230, 230, 230));
499
500 // SNX TRO file sampling
501 // ---------------------
502 if (sender() == 0 || sender() == _snxtroPath) {
503 if ( _snxtroPath->text() != "" ) {
504 _snxtroSampl ->setEnabled(true);
505 _snxtroIntr ->setEnabled(true);
506 _snxtroAc ->setEnabled(true);
507 _snxtroSolId ->setEnabled(true);
508 _snxtroSolType->setEnabled(true);
509 _snxtroCampId ->setEnabled(true);
510 _snxtroSampl ->setPalette(paletteWhite);
511 _snxtroIntr ->setPalette(paletteWhite);
512 _snxtroAc ->setPalette(paletteWhite);
513 _snxtroSolId ->setPalette(paletteWhite);
514 _snxtroSolType->setPalette(paletteWhite);
515 _snxtroCampId ->setPalette(paletteWhite);
516 }
517 else {
518 _snxtroSampl ->setEnabled(false);
519 _snxtroIntr ->setEnabled(false);
520 _snxtroAc ->setEnabled(false);
521 _snxtroSolId ->setEnabled(false);
522 _snxtroSolType->setEnabled(false);
523 _snxtroCampId ->setEnabled(false);
524 _snxtroSampl ->setPalette(paletteGray);
525 _snxtroIntr ->setPalette(paletteGray);
526 _snxtroAc ->setPalette(paletteGray);
527 _snxtroSolId ->setPalette(paletteGray);
528 _snxtroSolType->setPalette(paletteGray);
529 _snxtroCampId ->setPalette(paletteGray);
530 }
531 }
532
533
534}
Note: See TracBrowser for help on using the repository browser.