| 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 "PPP/pppwidgets.h"
|
|---|
| 44 | #include "qtfilechooser.h"
|
|---|
| 45 | #include "bncsettings.h"
|
|---|
| 46 |
|
|---|
| 47 | using namespace std;
|
|---|
| 48 |
|
|---|
| 49 | // Constructor
|
|---|
| 50 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 51 | t_pppWidgets::t_pppWidgets() {
|
|---|
| 52 |
|
|---|
| 53 | _dataSource = new QComboBox(); _dataSource ->setObjectName("PPP/dataSource"); _widgets << _dataSource;
|
|---|
| 54 | _rinexObs = new qtFileChooser(); _rinexObs ->setObjectName("PPP/rinexObs"); _widgets << _rinexObs;
|
|---|
| 55 | _rinexNav = new qtFileChooser(); _rinexNav ->setObjectName("PPP/rinexNav"); _widgets << _rinexNav;
|
|---|
| 56 | _corrMount = new QLineEdit(); _corrMount ->setObjectName("PPP/corrMount"); _widgets << _corrMount;
|
|---|
| 57 | _corrFile = new qtFileChooser(); _corrFile ->setObjectName("PPP/corrFile"); _widgets << _corrFile;
|
|---|
| 58 | _crdFile = new qtFileChooser(); _crdFile ->setObjectName("PPP/crdFile"); _widgets << _crdFile;
|
|---|
| 59 | _antexFile = new qtFileChooser(); _antexFile ->setObjectName("PPP/antexFile"); _widgets << _antexFile;
|
|---|
| 60 | _logFile = new QLineEdit(); _logFile ->setObjectName("PPP/logFile"); _widgets << _logFile;
|
|---|
| 61 | _nmeaFile = new QLineEdit(); _nmeaFile ->setObjectName("PPP/nmeaFile"); _widgets << _nmeaFile;
|
|---|
| 62 | _nmeaPort = new QLineEdit(); _nmeaPort ->setObjectName("PPP/nmeaPort"); _widgets << _nmeaPort;
|
|---|
| 63 | _staTable = new QTableWidget(); _staTable ->setObjectName("PPP/staTable"); _widgets << _staTable;
|
|---|
| 64 | _lcGPS = new QComboBox(); _lcGPS ->setObjectName("PPP/lcGPS"); _widgets << _lcGPS;
|
|---|
| 65 | _lcGLONASS = new QComboBox(); _lcGLONASS ->setObjectName("PPP/lcGLONASS"); _widgets << _lcGLONASS;
|
|---|
| 66 | _lcGalileo = new QComboBox(); _lcGalileo ->setObjectName("PPP/lcGalileo"); _widgets << _lcGalileo;
|
|---|
| 67 | _sigmaC1 = new QLineEdit(); _sigmaC1 ->setObjectName("PPP/sigmaC1"); _widgets << _sigmaC1;
|
|---|
| 68 | _sigmaL1 = new QLineEdit(); _sigmaL1 ->setObjectName("PPP/sigmaL1"); _widgets << _sigmaL1;
|
|---|
| 69 | _corrWaitTime = new QSpinBox(); _corrWaitTime->setObjectName("PPP/corrWaitTime"); _widgets << _corrWaitTime;
|
|---|
| 70 |
|
|---|
| 71 | _dataSource->setEditable(false);
|
|---|
| 72 | _dataSource->addItems(QString("no,Real-Time Streams,RINEX Files").split(","));
|
|---|
| 73 | connect(_dataSource, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(slotEnableWidgets()));
|
|---|
| 74 |
|
|---|
| 75 | _lcGPS->setEditable(false);
|
|---|
| 76 | _lcGPS->addItems(QString("no,P3,L3,P3&L3").split(","));
|
|---|
| 77 |
|
|---|
| 78 | _lcGLONASS->setEditable(false);
|
|---|
| 79 | _lcGLONASS->addItems(QString("no,P3,L3,P3&L3").split(","));
|
|---|
| 80 |
|
|---|
| 81 | _lcGalileo->setEditable(false);
|
|---|
| 82 | _lcGalileo->addItems(QString("no,P3,L3,P3&L3").split(","));
|
|---|
| 83 |
|
|---|
| 84 | _corrWaitTime->setMinimum(0);
|
|---|
| 85 | _corrWaitTime->setMaximum(20);
|
|---|
| 86 | _corrWaitTime->setSingleStep(1);
|
|---|
| 87 | _corrWaitTime->setSuffix(" sec");
|
|---|
| 88 | _corrWaitTime->setSpecialValueText("no");
|
|---|
| 89 |
|
|---|
| 90 | _staTable->setColumnCount(9);
|
|---|
| 91 | _staTable->setRowCount(10);
|
|---|
| 92 | _staTable->setHorizontalHeaderLabels(
|
|---|
| 93 | QString("Station,Sigma N,Sigma E,Sigma H,Noise N,Noise E,Noise H,Tropo Sigma,Tropo Noise").split(","));
|
|---|
| 94 |
|
|---|
| 95 |
|
|---|
| 96 | readOptions();
|
|---|
| 97 | }
|
|---|
| 98 |
|
|---|
| 99 | //
|
|---|
| 100 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 101 | void t_pppWidgets::readOptions() {
|
|---|
| 102 |
|
|---|
| 103 | bncSettings settings;
|
|---|
| 104 |
|
|---|
| 105 | int ii = _dataSource->findText(settings.value(_dataSource->objectName()).toString());
|
|---|
| 106 | if (ii != -1) {
|
|---|
| 107 | _dataSource->setCurrentIndex(ii);
|
|---|
| 108 | }
|
|---|
| 109 | ii = _lcGPS->findText(settings.value(_lcGPS->objectName()).toString());
|
|---|
| 110 | if (ii != -1) {
|
|---|
| 111 | _lcGPS->setCurrentIndex(ii);
|
|---|
| 112 | }
|
|---|
| 113 | ii = _lcGLONASS->findText(settings.value(_lcGLONASS->objectName()).toString());
|
|---|
| 114 | if (ii != -1) {
|
|---|
| 115 | _lcGLONASS->setCurrentIndex(ii);
|
|---|
| 116 | }
|
|---|
| 117 | ii = _lcGalileo->findText(settings.value(_lcGalileo->objectName()).toString());
|
|---|
| 118 | if (ii != -1) {
|
|---|
| 119 | _lcGalileo->setCurrentIndex(ii);
|
|---|
| 120 | }
|
|---|
| 121 |
|
|---|
| 122 | _rinexObs ->setFileName(settings.value(_rinexObs ->objectName()).toString());
|
|---|
| 123 | _rinexNav ->setFileName(settings.value(_rinexNav ->objectName()).toString());
|
|---|
| 124 | _corrFile ->setFileName(settings.value(_corrFile ->objectName()).toString());
|
|---|
| 125 | _crdFile ->setFileName(settings.value(_crdFile ->objectName()).toString());
|
|---|
| 126 | _antexFile->setFileName(settings.value(_antexFile->objectName()).toString());
|
|---|
| 127 |
|
|---|
| 128 | _corrMount->setText(settings.value(_corrMount->objectName()).toString());
|
|---|
| 129 | _logFile ->setText(settings.value(_logFile ->objectName()).toString());
|
|---|
| 130 | _nmeaFile ->setText(settings.value(_nmeaFile ->objectName()).toString());
|
|---|
| 131 | _nmeaPort ->setText(settings.value(_nmeaPort ->objectName()).toString());
|
|---|
| 132 | _sigmaC1 ->setText(settings.value(_sigmaC1 ->objectName()).toString());
|
|---|
| 133 | _sigmaL1 ->setText(settings.value(_sigmaL1 ->objectName()).toString());
|
|---|
| 134 |
|
|---|
| 135 | _corrWaitTime->setValue(settings.value(_corrWaitTime->objectName()).toInt());
|
|---|
| 136 | }
|
|---|
| 137 |
|
|---|
| 138 | //
|
|---|
| 139 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 140 | void t_pppWidgets::saveOptions() {
|
|---|
| 141 |
|
|---|
| 142 | bncSettings settings;
|
|---|
| 143 |
|
|---|
| 144 | settings.setValue(_dataSource ->objectName(), _dataSource ->currentText());
|
|---|
| 145 | settings.setValue(_rinexObs ->objectName(), _rinexObs ->fileName());
|
|---|
| 146 | settings.setValue(_rinexNav ->objectName(), _rinexNav ->fileName());
|
|---|
| 147 | settings.setValue(_corrMount ->objectName(), _corrMount ->text());
|
|---|
| 148 | settings.setValue(_corrFile ->objectName(), _corrFile ->fileName());
|
|---|
| 149 | settings.setValue(_crdFile ->objectName(), _crdFile ->fileName());
|
|---|
| 150 | settings.setValue(_antexFile ->objectName(), _antexFile ->fileName());
|
|---|
| 151 | settings.setValue(_logFile ->objectName(), _logFile ->text());
|
|---|
| 152 | settings.setValue(_nmeaFile ->objectName(), _nmeaFile ->text());
|
|---|
| 153 | settings.setValue(_nmeaPort ->objectName(), _nmeaPort ->text());
|
|---|
| 154 | settings.setValue(_lcGPS ->objectName(), _lcGPS ->currentText());
|
|---|
| 155 | settings.setValue(_lcGLONASS ->objectName(), _lcGLONASS ->currentText());
|
|---|
| 156 | settings.setValue(_lcGalileo ->objectName(), _lcGalileo ->currentText());
|
|---|
| 157 | settings.setValue(_sigmaC1 ->objectName(), _sigmaC1 ->text());
|
|---|
| 158 | settings.setValue(_sigmaL1 ->objectName(), _sigmaL1 ->text());
|
|---|
| 159 | settings.setValue(_corrWaitTime->objectName(), _corrWaitTime->value());
|
|---|
| 160 |
|
|---|
| 161 | }
|
|---|
| 162 |
|
|---|
| 163 | //
|
|---|
| 164 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 165 | void t_pppWidgets::slotEnableWidgets() {
|
|---|
| 166 |
|
|---|
| 167 | const static QPalette paletteWhite(QColor(255, 255, 255));
|
|---|
| 168 | const static QPalette paletteGray(QColor(230, 230, 230));
|
|---|
| 169 |
|
|---|
| 170 | bool allDisabled = _dataSource->currentText() == "no";
|
|---|
| 171 | bool realTime = _dataSource->currentText() == "Real-Time Streams";
|
|---|
| 172 | bool rinexFiles = _dataSource->currentText() == "RINEX Files";
|
|---|
| 173 |
|
|---|
| 174 | QListIterator<QWidget*> it(_widgets);
|
|---|
| 175 | while (it.hasNext()) {
|
|---|
| 176 | QWidget* widget = it.next();
|
|---|
| 177 | widget->setEnabled(!allDisabled);
|
|---|
| 178 | }
|
|---|
| 179 |
|
|---|
| 180 | if (realTime) {
|
|---|
| 181 | _rinexObs->setEnabled(false);
|
|---|
| 182 | _rinexNav->setEnabled(false);
|
|---|
| 183 | _corrFile->setEnabled(false);
|
|---|
| 184 | }
|
|---|
| 185 | else if (rinexFiles) {
|
|---|
| 186 | _corrMount->setEnabled(false);
|
|---|
| 187 | }
|
|---|
| 188 |
|
|---|
| 189 | _dataSource->setEnabled(true);
|
|---|
| 190 |
|
|---|
| 191 | it.toFront();
|
|---|
| 192 | while (it.hasNext()) {
|
|---|
| 193 | QWidget* widget = it.next();
|
|---|
| 194 | if (widget->isEnabled()) {
|
|---|
| 195 | widget->setPalette(paletteWhite);
|
|---|
| 196 | }
|
|---|
| 197 | else {
|
|---|
| 198 | widget->setPalette(paletteGray);
|
|---|
| 199 | }
|
|---|
| 200 | }
|
|---|
| 201 | }
|
|---|