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

Last change on this file since 11187 was 11136, checked in by stuerze, 3 weeks ago

Added:
EPH RINEX files can be written now per station like observation files and in PPP mode the Broadcast stream can be specified

File size: 27.2 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://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 _ephMount = new QLineEdit(); _ephMount ->setObjectName("PPP/ephMount"); _widgets << _ephMount;
70 _corrFile = new qtFileChooser(); _corrFile ->setObjectName("PPP/corrFile"); _widgets << _corrFile;
71 _biasFile = new qtFileChooser(); _biasFile ->setObjectName("PPP/biasFile"); _widgets << _biasFile;
72 _ionoFile = new qtFileChooser(); _ionoFile ->setObjectName("PPP/ionoFile"); _widgets << _ionoFile;
73 _crdFile = new qtFileChooser(); _crdFile ->setObjectName("PPP/crdFile"); _widgets << _crdFile;
74 _antexFile = new qtFileChooser(); _antexFile ->setObjectName("PPP/antexFile"); _widgets << _antexFile;
75 _blqFile = new qtFileChooser(); _blqFile ->setObjectName("PPP/blqFile"); _widgets << _blqFile;
76 _logPath = new QLineEdit(); _logPath ->setObjectName("PPP/logPath"); _widgets << _logPath;
77 _logMode = new QComboBox(); _logMode ->setObjectName("PPP/logMode"); _widgets << _logMode;
78 _nmeaPath = new QLineEdit(); _nmeaPath ->setObjectName("PPP/nmeaPath"); _widgets << _nmeaPath;
79 _snxtroPath = new QLineEdit(); _snxtroPath ->setObjectName("PPP/snxtroPath"); _widgets << _snxtroPath;
80 _snxtroSampl = new QComboBox(); _snxtroSampl ->setObjectName("PPP/snxtroSampl"); _widgets << _snxtroSampl;
81 _snxtroIntr = new QComboBox(); _snxtroIntr ->setObjectName("PPP/snxtroIntr"); _widgets << _snxtroIntr;
82 _snxtroAc = new QLineEdit(); _snxtroAc ->setObjectName("PPP/snxtroAc"); _widgets << _snxtroAc;
83 _snxtroSolId = new QLineEdit(); _snxtroSolId ->setObjectName("PPP/snxtroSolId"); _widgets << _snxtroSolId;
84 _snxtroSolType= new QLineEdit(); _snxtroSolType->setObjectName("PPP/snxtroSolType");_widgets << _snxtroSolType;
85 _snxtroCampId = new QLineEdit(); _snxtroCampId ->setObjectName("PPP/snxtroCampId");_widgets << _snxtroCampId;
86 _staTable = new QTableWidget(); _staTable ->setObjectName("PPP/staTable"); _widgets << _staTable;
87 _lcGPS = new QComboBox(); _lcGPS ->setObjectName("PPP/lcGPS"); _widgets << _lcGPS;
88 _lcGLONASS = new QComboBox(); _lcGLONASS ->setObjectName("PPP/lcGLONASS"); _widgets << _lcGLONASS;
89 _lcGalileo = new QComboBox(); _lcGalileo ->setObjectName("PPP/lcGalileo"); _widgets << _lcGalileo;
90 _lcBDS = new QComboBox(); _lcBDS ->setObjectName("PPP/lcBDS"); _widgets << _lcBDS;
91 _constraints = new QComboBox(); _constraints ->setObjectName("PPP/constraints"); _widgets << _constraints;
92 _sigmaC1 = new QLineEdit(); _sigmaC1 ->setObjectName("PPP/sigmaC1"); _widgets << _sigmaC1;
93 _sigmaL1 = new QLineEdit(); _sigmaL1 ->setObjectName("PPP/sigmaL1"); _widgets << _sigmaL1;
94 _sigmaGIM = new QLineEdit(); _sigmaGIM ->setObjectName("PPP/sigmaGIM"); _widgets << _sigmaGIM;
95 _maxResC1 = new QLineEdit(); _maxResC1 ->setObjectName("PPP/maxResC1"); _widgets << _maxResC1;
96 _maxResL1 = new QLineEdit(); _maxResL1 ->setObjectName("PPP/maxResL1"); _widgets << _maxResL1;
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(_seedingTime, "0");
304
305 // Table with stations
306 // -------------------
307 for (int iRow = _staTable->rowCount()-1; iRow >=0; iRow--) {
308 _staTable->removeRow(iRow);
309 }
310 int iRow = -1;
311 QListIterator<QString> it(settings.value(_staTable->objectName()).toStringList());
312 while (it.hasNext()) {
313 QStringList hlp = it.next().split(",");
314 ++iRow;
315 _staTable->insertRow(iRow);
316 for (int iCol = 0; iCol < hlp.size(); iCol++) {
317 _staTable->setItem(iRow, iCol, new QTableWidgetItem(hlp[iCol]));
318 }
319 }
320}
321
322//
323////////////////////////////////////////////////////////////////////////////
324void t_pppWidgets::saveOptions() {
325
326 bncSettings settings;
327
328 auto storeWidgetValue = [&settings](QWidget* widget) {
329 if (auto* obj = qobject_cast<QLineEdit*>(widget)) {
330 settings.setValue(obj->objectName(), obj->text());
331 }
332 else if (auto* obj = qobject_cast<QComboBox*>(widget)) {
333 settings.setValue(obj->objectName(), obj->currentText());
334 }
335 else if (auto* obj = qobject_cast<qtFileChooser*>(widget)) {
336 settings.setValue(obj->objectName(), obj->fileName());
337 }
338 else if (auto* obj = qobject_cast<QCheckBox*>(widget)) {
339 settings.setValue(obj->objectName(), obj->checkState());
340 }
341 else if (auto* obj = qobject_cast<QSpinBox*>(widget)) {
342 settings.setValue(obj->objectName(), obj->value());
343 }
344 else if (auto* obj = qobject_cast<QSlider*>(widget)) {
345 settings.setValue(obj->objectName(), obj->value());
346 }
347 };
348
349 QListIterator<QWidget*> it(_widgets);
350 while (it.hasNext()) {
351 storeWidgetValue(it.next());
352 }
353
354 QStringList staList;
355 for (int iRow = 0; iRow < _staTable->rowCount(); iRow++) {
356 QString hlp;
357 for (int iCol = 0; iCol < _staTable->columnCount(); iCol++) {
358 if (_staTable->item(iRow, iCol)) {
359 hlp += _staTable->item(iRow, iCol)->text() + ",";
360 }
361 }
362 if (!hlp.isEmpty()) {
363 staList << hlp;
364 }
365 }
366 settings.setValue(_staTable->objectName(), staList);
367}
368
369//
370////////////////////////////////////////////////////////////////////////////
371void t_pppWidgets::slotEnableWidgets() {
372
373 const static QPalette paletteWhite(QColor(255, 255, 255));
374 const static QPalette paletteGray(QColor(230, 230, 230));
375
376 bool allDisabled = _dataSource->currentText() == "";
377 bool realTime = _dataSource->currentText() == "Real-Time Streams";
378 bool rinexFiles = _dataSource->currentText() == "RINEX Files";
379 bool pseudoObsIono = _constraints->currentText() == "Ionosphere: pseudo-obs";
380
381 QListIterator<QWidget*> it(_widgets);
382 while (it.hasNext()) {
383 QWidget* widget = it.next();
384 widget->setEnabled(!allDisabled);
385 }
386
387 if (realTime) {
388 _rinexObs->setEnabled(false);
389 _rinexNav->setEnabled(false);
390 _corrFile->setEnabled(false);
391 _biasFile->setEnabled(false);
392 _ionoFile->setEnabled(false);
393 }
394 else if (rinexFiles) {
395 _corrMount ->setEnabled(false);
396 _biasMount ->setEnabled(false);
397 _ionoMount ->setEnabled(false);
398 _ephMount ->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 } else {
423 _sigmaGIM->setEnabled(false);
424 }
425
426 bool ar = (_arGPS->checkState() == Qt::Checked ||
427 _arGalileo->checkState() == Qt::Checked ||
428 _arBDS->checkState() == Qt::Checked);
429 _arMinNumEpo->setEnabled(ar);
430 _arMinNumSat->setEnabled(ar);
431 _arUseYaw ->setEnabled(true);
432 _arMaxFrac ->setEnabled(ar);
433 _arMaxSig ->setEnabled(ar);
434
435 _dataSource->setEnabled(true);
436
437 it.toFront();
438 while (it.hasNext()) {
439 QWidget* widget = it.next();
440 if (widget->isEnabled()) {
441 widget->setPalette(paletteWhite);
442 }
443 else {
444 widget->setPalette(paletteGray);
445 }
446 }
447}
448
449//
450////////////////////////////////////////////////////////////////////////////
451void t_pppWidgets::slotAddStation() {
452 int iRow = _staTable->rowCount();
453 _staTable->insertRow(iRow);
454 QString preferredAttributes = "G:12&CWPSLX R:12&CP E:1&CBX E:5&QIX C:26&IQX";
455
456 for (int iCol = 0; iCol < _staTable->columnCount(); iCol++) {
457 if (iCol == 0) _staTable->setItem(iRow, iCol, new QTableWidgetItem(""));
458 if (iCol == 1) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
459 if (iCol == 2) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
460 if (iCol == 3) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
461 if (iCol == 4) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
462 if (iCol == 5) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
463 if (iCol == 6) _staTable->setItem(iRow, iCol, new QTableWidgetItem("100.0"));
464 if (iCol == 7) _staTable->setItem(iRow, iCol, new QTableWidgetItem("0.1"));
465 if (iCol == 8) _staTable->setItem(iRow, iCol, new QTableWidgetItem("3e-6"));
466 if (iCol == 9) _staTable->setItem(iRow, iCol, new QTableWidgetItem("0"));
467 if (iCol == 10) _staTable->setItem(iRow, iCol, new QTableWidgetItem(preferredAttributes));
468 }
469}
470
471//
472////////////////////////////////////////////////////////////////////////////
473void t_pppWidgets::slotDelStation() {
474 int nRows = _staTable->rowCount();
475 std::vector <bool> flg(nRows);
476 for (int iRow = 0; iRow < nRows; iRow++) {
477 if (_staTable->item(iRow,1)->isSelected()) {
478 flg[iRow] = true;
479 }
480 else {
481 flg[iRow] = false;
482 }
483 }
484 for (int iRow = nRows-1; iRow >= 0; iRow--) {
485 if (flg[iRow]) {
486 _staTable->removeRow(iRow);
487 }
488 }
489}
490
491// PPP Text
492////////////////////////////////////////////////////////////////////////////
493void t_pppWidgets::slotPPPTextChanged(){
494
495 const static QPalette paletteWhite(QColor(255, 255, 255));
496 const static QPalette paletteGray (QColor(230, 230, 230));
497
498 // SNX TRO file sampling
499 // ---------------------
500 if (sender() == 0 || sender() == _snxtroPath) {
501 if ( _snxtroPath->text() != "" ) {
502 _snxtroSampl ->setEnabled(true);
503 _snxtroIntr ->setEnabled(true);
504 _snxtroAc ->setEnabled(true);
505 _snxtroSolId ->setEnabled(true);
506 _snxtroSolType->setEnabled(true);
507 _snxtroCampId ->setEnabled(true);
508 _snxtroSampl ->setPalette(paletteWhite);
509 _snxtroIntr ->setPalette(paletteWhite);
510 _snxtroAc ->setPalette(paletteWhite);
511 _snxtroSolId ->setPalette(paletteWhite);
512 _snxtroSolType->setPalette(paletteWhite);
513 _snxtroCampId ->setPalette(paletteWhite);
514 }
515 else {
516 _snxtroSampl ->setEnabled(false);
517 _snxtroIntr ->setEnabled(false);
518 _snxtroAc ->setEnabled(false);
519 _snxtroSolId ->setEnabled(false);
520 _snxtroSolType->setEnabled(false);
521 _snxtroCampId ->setEnabled(false);
522 _snxtroSampl ->setPalette(paletteGray);
523 _snxtroIntr ->setPalette(paletteGray);
524 _snxtroAc ->setPalette(paletteGray);
525 _snxtroSolId ->setPalette(paletteGray);
526 _snxtroSolType->setPalette(paletteGray);
527 _snxtroCampId ->setPalette(paletteGray);
528 }
529 }
530
531
532}
Note: See TracBrowser for help on using the repository browser.