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

Last change on this file since 10942 was 10942, checked in by stuerze, 7 days ago

handling of ionospheric constraints descrived/updated

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