source: ntrip/trunk/BNC/src/PPP/pppwidgets.cpp@ 5703

Last change on this file since 5703 was 5703, checked in by mervart, 10 years ago
File size: 9.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 "PPP/pppwidgets.h"
44#include "qtfilechooser.h"
45#include "bncsettings.h"
46
47using namespace std;
48
49// Constructor
50////////////////////////////////////////////////////////////////////////////
51t_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 _addStaButton = new QPushButton("Add Station"); _widgets << _addStaButton;
71 _delStaButton = new QPushButton("Delete Station"); _widgets << _delStaButton;
72
73 _dataSource->setEditable(false);
74 _dataSource->addItems(QString("no,Real-Time Streams,RINEX Files").split(","));
75 connect(_dataSource, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(slotEnableWidgets()));
76
77 _lcGPS->setEditable(false);
78 _lcGPS->addItems(QString("no,P3,L3,P3&L3").split(","));
79
80 _lcGLONASS->setEditable(false);
81 _lcGLONASS->addItems(QString("no,P3,L3,P3&L3").split(","));
82
83 _lcGalileo->setEditable(false);
84 _lcGalileo->addItems(QString("no,P3,L3,P3&L3").split(","));
85
86 _corrWaitTime->setMinimum(0);
87 _corrWaitTime->setMaximum(20);
88 _corrWaitTime->setSingleStep(1);
89 _corrWaitTime->setSuffix(" sec");
90 _corrWaitTime->setSpecialValueText("no");
91
92 _staTable->setColumnCount(9);
93 _staTable->setRowCount(0);
94 _staTable->setHorizontalHeaderLabels(
95 QString("Station,Sigma N,Sigma E,Sigma H,Noise N,Noise E,Noise H,Tropo Sigma,Tropo Noise").split(","));
96 _staTable->setSelectionMode(QAbstractItemView::ExtendedSelection);
97 _staTable->setSelectionBehavior(QAbstractItemView::SelectRows);
98 _staTable->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
99 /// _staTable->horizontalHeader()->setStretchLastSection(true);
100 _staTable->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft);
101
102 connect(_addStaButton, SIGNAL(clicked()), this, SLOT(slotAddStation()));
103 connect(_delStaButton, SIGNAL(clicked()), this, SLOT(slotDelStation()));
104
105 readOptions();
106}
107
108//
109////////////////////////////////////////////////////////////////////////////
110void t_pppWidgets::readOptions() {
111
112 bncSettings settings;
113
114 int ii = _dataSource->findText(settings.value(_dataSource->objectName()).toString());
115 if (ii != -1) {
116 _dataSource->setCurrentIndex(ii);
117 }
118 ii = _lcGPS->findText(settings.value(_lcGPS->objectName()).toString());
119 if (ii != -1) {
120 _lcGPS->setCurrentIndex(ii);
121 }
122 ii = _lcGLONASS->findText(settings.value(_lcGLONASS->objectName()).toString());
123 if (ii != -1) {
124 _lcGLONASS->setCurrentIndex(ii);
125 }
126 ii = _lcGalileo->findText(settings.value(_lcGalileo->objectName()).toString());
127 if (ii != -1) {
128 _lcGalileo->setCurrentIndex(ii);
129 }
130
131 _rinexObs ->setFileName(settings.value(_rinexObs ->objectName()).toString());
132 _rinexNav ->setFileName(settings.value(_rinexNav ->objectName()).toString());
133 _corrFile ->setFileName(settings.value(_corrFile ->objectName()).toString());
134 _crdFile ->setFileName(settings.value(_crdFile ->objectName()).toString());
135 _antexFile->setFileName(settings.value(_antexFile->objectName()).toString());
136
137 _corrMount->setText(settings.value(_corrMount->objectName()).toString());
138 _logFile ->setText(settings.value(_logFile ->objectName()).toString());
139 _nmeaFile ->setText(settings.value(_nmeaFile ->objectName()).toString());
140 _nmeaPort ->setText(settings.value(_nmeaPort ->objectName()).toString());
141 _sigmaC1 ->setText(settings.value(_sigmaC1 ->objectName()).toString());
142 _sigmaL1 ->setText(settings.value(_sigmaL1 ->objectName()).toString());
143
144 _corrWaitTime->setValue(settings.value(_corrWaitTime->objectName()).toInt());
145}
146
147//
148////////////////////////////////////////////////////////////////////////////
149void t_pppWidgets::saveOptions() {
150
151 bncSettings settings;
152
153 settings.setValue(_dataSource ->objectName(), _dataSource ->currentText());
154 settings.setValue(_rinexObs ->objectName(), _rinexObs ->fileName());
155 settings.setValue(_rinexNav ->objectName(), _rinexNav ->fileName());
156 settings.setValue(_corrMount ->objectName(), _corrMount ->text());
157 settings.setValue(_corrFile ->objectName(), _corrFile ->fileName());
158 settings.setValue(_crdFile ->objectName(), _crdFile ->fileName());
159 settings.setValue(_antexFile ->objectName(), _antexFile ->fileName());
160 settings.setValue(_logFile ->objectName(), _logFile ->text());
161 settings.setValue(_nmeaFile ->objectName(), _nmeaFile ->text());
162 settings.setValue(_nmeaPort ->objectName(), _nmeaPort ->text());
163 settings.setValue(_lcGPS ->objectName(), _lcGPS ->currentText());
164 settings.setValue(_lcGLONASS ->objectName(), _lcGLONASS ->currentText());
165 settings.setValue(_lcGalileo ->objectName(), _lcGalileo ->currentText());
166 settings.setValue(_sigmaC1 ->objectName(), _sigmaC1 ->text());
167 settings.setValue(_sigmaL1 ->objectName(), _sigmaL1 ->text());
168 settings.setValue(_corrWaitTime->objectName(), _corrWaitTime->value());
169
170}
171
172//
173////////////////////////////////////////////////////////////////////////////
174void t_pppWidgets::slotEnableWidgets() {
175
176 const static QPalette paletteWhite(QColor(255, 255, 255));
177 const static QPalette paletteGray(QColor(230, 230, 230));
178
179 bool allDisabled = _dataSource->currentText() == "no";
180 bool realTime = _dataSource->currentText() == "Real-Time Streams";
181 bool rinexFiles = _dataSource->currentText() == "RINEX Files";
182
183 QListIterator<QWidget*> it(_widgets);
184 while (it.hasNext()) {
185 QWidget* widget = it.next();
186 widget->setEnabled(!allDisabled);
187 }
188
189 if (realTime) {
190 _rinexObs->setEnabled(false);
191 _rinexNav->setEnabled(false);
192 _corrFile->setEnabled(false);
193 }
194 else if (rinexFiles) {
195 _corrMount->setEnabled(false);
196 }
197
198 _dataSource->setEnabled(true);
199
200 it.toFront();
201 while (it.hasNext()) {
202 QWidget* widget = it.next();
203 if (widget->isEnabled()) {
204 widget->setPalette(paletteWhite);
205 }
206 else {
207 widget->setPalette(paletteGray);
208 }
209 }
210}
211
212//
213////////////////////////////////////////////////////////////////////////////
214void t_pppWidgets::slotAddStation() {
215
216}
217
218//
219////////////////////////////////////////////////////////////////////////////
220void t_pppWidgets::slotDelStation() {
221
222}
Note: See TracBrowser for help on using the repository browser.