source: ntrip/trunk/BNC/bncwindow.cpp@ 1439

Last change on this file since 1439 was 1439, checked in by weber, 15 years ago

* empty log message *

File size: 71.5 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: bncWindow
30 *
31 * Purpose: This class implements the main application window.
32 *
33 * Author: L. Mervart
34 *
35 * Created: 24-Dec-2005
36 *
37 * Changes:
38 *
39 * -----------------------------------------------------------------------*/
40
41#include <iostream>
42
43#include <unistd.h>
44#include "bncwindow.h"
45#include "bncapp.h"
46#include "bncgetthread.h"
47#include "bnctabledlg.h"
48#include "bnchlpdlg.h"
49#include "bnchtml.h"
50#include "bnctableitem.h"
51
52using namespace std;
53
54// Constructor
55////////////////////////////////////////////////////////////////////////////
56bncWindow::bncWindow() {
57
58 _caster = 0;
59
60 int ww = QFontMetrics(this->font()).width('w');
61
62 static const QStringList labels = QString("account, Streams: broadcaster:port/mountpoint,decoder,lat,long,nmea,ntrip,bytes").split(",");
63
64 setMinimumSize(85*ww, 65*ww);
65
66 setWindowTitle(tr("BKG Ntrip Client (BNC) Version 1.7"));
67
68 connect((bncApp*)qApp, SIGNAL(newMessage(QByteArray,bool)),
69 this, SLOT(slotWindowMessage(QByteArray,bool)));
70
71 QPalette palette;
72
73 // Create Actions
74 // --------------
75 _actHelp = new QAction(tr("&Help Contents"),this);
76 connect(_actHelp, SIGNAL(triggered()), SLOT(slotHelp()));
77
78 _actAbout = new QAction(tr("&About BNC"),this);
79 connect(_actAbout, SIGNAL(triggered()), SLOT(slotAbout()));
80
81 _actFlowchart = new QAction(tr("&Flow Chart"),this);
82 connect(_actFlowchart, SIGNAL(triggered()), SLOT(slotFlowchart()));
83
84 _actFontSel = new QAction(tr("Select &Font"),this);
85 connect(_actFontSel, SIGNAL(triggered()), SLOT(slotFontSel()));
86
87 _actSaveOpt = new QAction(tr("&Save && Activate Options"),this);
88 connect(_actSaveOpt, SIGNAL(triggered()), SLOT(slotSaveOptions()));
89
90 _actQuit = new QAction(tr("&Quit"),this);
91 connect(_actQuit, SIGNAL(triggered()), SLOT(close()));
92
93 _actAddMountPoints = new QAction(tr("Add &Streams"),this);
94 connect(_actAddMountPoints, SIGNAL(triggered()), SLOT(slotAddMountPoints()));
95
96 _actDeleteMountPoints = new QAction(tr("&Delete Streams"),this);
97 connect(_actDeleteMountPoints, SIGNAL(triggered()), SLOT(slotDeleteMountPoints()));
98 _actDeleteMountPoints->setEnabled(false);
99
100 _actGetData = new QAction(tr("Sta&rt"),this);
101 connect(_actGetData, SIGNAL(triggered()), SLOT(slotGetData()));
102
103 _actStop = new QAction(tr("Sto&p"),this);
104 connect(_actStop, SIGNAL(triggered()), SLOT(slotStop()));
105 _actStop->setEnabled(false);
106
107 _actwhatsthis= new QAction(tr("Help=Shift+F1"),this);
108 connect(_actwhatsthis, SIGNAL(triggered()), SLOT(slotWhatsThis()));
109
110 CreateMenu();
111 AddToolbar();
112
113 QSettings settings;
114 _proxyHostLineEdit = new QLineEdit(settings.value("proxyHost").toString());
115 _proxyPortLineEdit = new QLineEdit(settings.value("proxyPort").toString());
116 _proxyPortLineEdit->setMaximumWidth(9*ww);
117 _miscMountLineEdit = new QLineEdit(settings.value("miscMount").toString());
118 _scanRTCMCheckBox = new QCheckBox();
119 _scanRTCMCheckBox->setCheckState(Qt::CheckState(
120 settings.value("scanRTCM").toInt()));
121 _waitTimeSpinBox = new QSpinBox();
122 _waitTimeSpinBox->setMinimum(1);
123 _waitTimeSpinBox->setMaximum(30);
124 _waitTimeSpinBox->setSingleStep(1);
125 _waitTimeSpinBox->setSuffix(" sec");
126 _waitTimeSpinBox->setMaximumWidth(9*ww);
127 _waitTimeSpinBox->setValue(settings.value("waitTime").toInt());
128 _outFileLineEdit = new QLineEdit(settings.value("outFile").toString());
129 _outPortLineEdit = new QLineEdit(settings.value("outPort").toString());
130 _outPortLineEdit->setMaximumWidth(9*ww);
131 _outUPortLineEdit = new QLineEdit(settings.value("outUPort").toString());
132 _outUPortLineEdit->setMaximumWidth(9*ww);
133 _outEphPortLineEdit = new QLineEdit(settings.value("outEphPort").toString());
134 _outEphPortLineEdit->setMaximumWidth(9*ww);
135 _corrPortLineEdit = new QLineEdit(settings.value("corrPort").toString());
136 _corrPortLineEdit->setMaximumWidth(9*ww);
137 _rnxPathLineEdit = new QLineEdit(settings.value("rnxPath").toString());
138 _ephPathLineEdit = new QLineEdit(settings.value("ephPath").toString());
139 _corrPathLineEdit = new QLineEdit(settings.value("corrPath").toString());
140
141 _rnxV3CheckBox = new QCheckBox();
142 _rnxV3CheckBox->setCheckState(Qt::CheckState(settings.value("rnxV3").toInt()));
143 _ephV3CheckBox = new QCheckBox();
144 _ephV3CheckBox->setCheckState(Qt::CheckState(settings.value("ephV3").toInt()));
145 _rnxScrpLineEdit = new QLineEdit(settings.value("rnxScript").toString());
146 _rnxSkelLineEdit = new QLineEdit(settings.value("rnxSkel").toString());
147 _rnxSkelLineEdit->setMaximumWidth(5*ww);
148 _rnxAppendCheckBox = new QCheckBox();
149 _rnxAppendCheckBox->setCheckState(Qt::CheckState(
150 settings.value("rnxAppend").toInt()));
151 _autoStartCheckBox = new QCheckBox();
152 _autoStartCheckBox->setCheckState(Qt::CheckState(
153 settings.value("autoStart").toInt()));
154 _rnxIntrComboBox = new QComboBox();
155 _rnxIntrComboBox->setMaximumWidth(9*ww);
156 _rnxIntrComboBox->setEditable(false);
157 _rnxIntrComboBox->addItems(QString("1 min,2 min,5 min,10 min,15 min,30 min,1 hour,1 day").split(","));
158 int ii = _rnxIntrComboBox->findText(settings.value("rnxIntr").toString());
159 if (ii != -1) {
160 _rnxIntrComboBox->setCurrentIndex(ii);
161 }
162 _onTheFlyComboBox = new QComboBox();
163 _onTheFlyComboBox->setMaximumWidth(9*ww);
164 _onTheFlyComboBox->setEditable(false);
165 _onTheFlyComboBox->addItems(QString("1 day,1 hour,1 min").split(","));
166 ii = _onTheFlyComboBox->findText(settings.value("onTheFlyInterval").toString());
167 if (ii != -1) {
168 _onTheFlyComboBox->setCurrentIndex(ii);
169 }
170 _ephIntrComboBox = new QComboBox();
171 _ephIntrComboBox->setMaximumWidth(9*ww);
172 _ephIntrComboBox->setEditable(false);
173 _ephIntrComboBox->addItems(QString("1 min,2 min,5 min,10 min,15 min,30 min,1 hour,1 day").split(","));
174 int jj = _ephIntrComboBox->findText(settings.value("ephIntr").toString());
175 if (jj != -1) {
176 _ephIntrComboBox->setCurrentIndex(jj);
177 }
178 _corrIntrComboBox = new QComboBox();
179 _corrIntrComboBox->setMaximumWidth(9*ww);
180 _corrIntrComboBox->setEditable(false);
181 _corrIntrComboBox->addItems(QString("1 min,2 min,5 min,10 min,15 min,30 min,1 hour,1 day").split(","));
182 int mm = _corrIntrComboBox->findText(settings.value("corrIntr").toString());
183 if (mm != -1) {
184 _corrIntrComboBox->setCurrentIndex(mm);
185 }
186 _corrTimeSpinBox = new QSpinBox();
187 _corrTimeSpinBox->setMinimum(1);
188 _corrTimeSpinBox->setMaximum(30);
189 _corrTimeSpinBox->setSingleStep(1);
190 _corrTimeSpinBox->setSuffix(" sec");
191 _corrTimeSpinBox->setMaximumWidth(9*ww);
192 _corrTimeSpinBox->setValue(settings.value("corrTime").toInt());
193 _rnxSamplSpinBox = new QSpinBox();
194 _rnxSamplSpinBox->setMinimum(0);
195 _rnxSamplSpinBox->setMaximum(60);
196 _rnxSamplSpinBox->setSingleStep(5);
197 _rnxSamplSpinBox->setMaximumWidth(9*ww);
198 _rnxSamplSpinBox->setValue(settings.value("rnxSampl").toInt());
199 _rnxSamplSpinBox->setSuffix(" sec");
200
201 _binSamplSpinBox = new QSpinBox();
202 _binSamplSpinBox->setMinimum(0);
203 _binSamplSpinBox->setMaximum(60);
204 _binSamplSpinBox->setSingleStep(5);
205 _binSamplSpinBox->setMaximumWidth(9*ww);
206 _binSamplSpinBox->setValue(settings.value("binSampl").toInt());
207 _binSamplSpinBox->setSuffix(" sec");
208
209 _obsRateComboBox = new QComboBox();
210 _obsRateComboBox->setMaximumWidth(9*ww);
211 _obsRateComboBox->setEditable(false);
212 _obsRateComboBox->addItems(QString(",0.1 Hz,0.2 Hz,0.5 Hz,1 Hz,5 Hz").split(","));
213 int kk = _obsRateComboBox->findText(settings.value("obsRate").toString());
214 if (kk != -1) {
215 _obsRateComboBox->setCurrentIndex(kk);
216 }
217 _makePauseCheckBox = new QCheckBox();
218 _makePauseCheckBox->setCheckState(Qt::CheckState(
219 settings.value("makePause").toInt()));
220 _adviseRecoSpinBox = new QSpinBox();
221 _adviseRecoSpinBox->setMinimum(0);
222 _adviseRecoSpinBox->setMaximum(60);
223 _adviseRecoSpinBox->setSingleStep(1);
224 _adviseRecoSpinBox->setSuffix(" min");
225 _adviseRecoSpinBox->setMaximumWidth(9*ww);
226 _adviseRecoSpinBox->setValue(settings.value("adviseReco").toInt());
227 _adviseFailSpinBox = new QSpinBox();
228 _adviseFailSpinBox->setMinimum(0);
229 _adviseFailSpinBox->setMaximum(60);
230 _adviseFailSpinBox->setSingleStep(1);
231 _adviseFailSpinBox->setSuffix(" min");
232 _adviseFailSpinBox->setMaximumWidth(9*ww);
233 _adviseFailSpinBox->setValue(settings.value("adviseFail").toInt());
234 _logFileLineEdit = new QLineEdit(settings.value("logFile").toString());
235 _adviseScriptLineEdit = new QLineEdit(settings.value("adviseScript").toString());
236
237 _serialPortNameLineEdit = new QLineEdit(settings.value("serialPortName").toString());
238 _serialMountPointLineEdit = new QLineEdit(settings.value("serialMountPoint").toString());
239
240
241 _serialBaudRateComboBox = new QComboBox();
242 _serialBaudRateComboBox->setMaximumWidth(9*ww);
243 _serialBaudRateComboBox->addItems(QString("110,300,600,"
244 "1200,2400,4800,9600,19200,38400,57600,115200").split(","));
245 kk = _serialBaudRateComboBox->findText(settings.value("serialBaudRate").toString());
246 if (kk != -1) {
247 _serialBaudRateComboBox->setCurrentIndex(kk);
248 }
249 _serialParityComboBox = new QComboBox();
250 _serialParityComboBox->setMaximumWidth(9*ww);
251 _serialParityComboBox->addItems(QString("NONE,ODD,EVEN,SPACE").split(","));
252 kk = _serialParityComboBox->findText(settings.value("serialParity").toString());
253 if (kk != -1) {
254 _serialParityComboBox->setCurrentIndex(kk);
255 }
256 _serialDataBitsComboBox = new QComboBox();
257 _serialDataBitsComboBox->setMaximumWidth(5*ww);
258 _serialDataBitsComboBox->addItems(QString("5,6,7,8").split(","));
259 kk = _serialDataBitsComboBox->findText(settings.value("serialDataBits").toString());
260 if (kk != -1) {
261 _serialDataBitsComboBox->setCurrentIndex(kk);
262 }
263 _serialStopBitsComboBox = new QComboBox();
264 _serialStopBitsComboBox->setMaximumWidth(5*ww);
265 _serialStopBitsComboBox->addItems(QString("1,2").split(","));
266 kk = _serialStopBitsComboBox->findText(settings.value("serialStopBits").toString());
267 if (kk != -1) {
268 _serialStopBitsComboBox->setCurrentIndex(kk);
269 }
270 _serialAutoNMEACheckBox = new QCheckBox();
271 _serialAutoNMEACheckBox->setCheckState(Qt::CheckState(
272 settings.value("serialAutoNMEA").toInt()));
273
274 _perfIntrComboBox = new QComboBox();
275 _perfIntrComboBox->setMaximumWidth(9*ww);
276 _perfIntrComboBox->setEditable(false);
277 _perfIntrComboBox->addItems(QString(",1 min,5 min,15 min,1 hour,6 hours,1 day").split(","));
278 int ll = _perfIntrComboBox->findText(settings.value("perfIntr").toString());
279 if (ll != -1) {
280 _perfIntrComboBox->setCurrentIndex(ll);
281 }
282
283 _mountPointsTable = new QTableWidget(0,8);
284
285 _mountPointsTable->horizontalHeader()->resizeSection(1,34*ww);
286 _mountPointsTable->horizontalHeader()->resizeSection(2,9*ww);
287 _mountPointsTable->horizontalHeader()->resizeSection(3,7*ww);
288 _mountPointsTable->horizontalHeader()->resizeSection(4,7*ww);
289 _mountPointsTable->horizontalHeader()->resizeSection(5,5*ww);
290 _mountPointsTable->horizontalHeader()->resizeSection(6,4*ww);
291 _mountPointsTable->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
292 _mountPointsTable->horizontalHeader()->setStretchLastSection(true);
293 _mountPointsTable->setHorizontalHeaderLabels(labels);
294 _mountPointsTable->setGridStyle(Qt::NoPen);
295 _mountPointsTable->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
296 _mountPointsTable->setSelectionMode(QAbstractItemView::ExtendedSelection);
297 _mountPointsTable->setSelectionBehavior(QAbstractItemView::SelectRows);
298 _mountPointsTable->hideColumn(0);
299 connect(_mountPointsTable, SIGNAL(itemSelectionChanged()),
300 SLOT(slotSelectionChanged()));
301 populateMountPointsTable();
302
303 _log = new QTextBrowser();
304 _log->setReadOnly(true);
305
306 // WhatsThis
307 // ---------
308 _proxyHostLineEdit->setWhatsThis(tr("<p>If you are running BNC within a protected Local Area Network (LAN), you might need to use a proxy server to access the Internet. Enter your proxy server IP and port number in case one is operated in front of BNC. If you do not know the IP and port of your proxy server, check the proxy server settings in your Internet browser or ask your network administrator.</p><p>Note that IP streaming is sometimes not allowed in a LAN. In this case you need to ask your network administrator for an appropriate modification of the local security policy or for the installation of a TCP relay to the NTRIP broadcasters. If these are not possible, you might need to run BNC outside your LAN on a network that has unobstructed connection to the Internet.</p>"));
309 _proxyPortLineEdit->setWhatsThis(tr("<p>If you are running BNC within a protected Local Area Network (LAN), you might need to use a proxy server to access the Internet. Enter your proxy server IP and port number in case one is operated in front of BNC. If you do not know the IP and port of your proxy server, check the proxy server settings in your Internet browser or ask your network administrator.</p><p>Note that IP streaming is sometimes not allowed in a LAN. In this case you need to ask your network administrator for an appropriate modification of the local security policy or for the installation of a TCP relay to the NTRIP broadcasters. If these are not possible, you might need to run BNC outside your LAN on a network that has unobstructed connection to the Internet.</p>"));
310 _waitTimeSpinBox->setWhatsThis(tr("<p>When feeding a real-time GNSS engine waiting for synchronized input epoch by epoch, BNC drops whatever is received later than 'Wait for full epoch' seconds. A value of 3 to 5 seconds is recommended, depending on the latency of the incoming streams and the delay acceptable to your real-time GNSS engine or products.</p><p>Note that 'Wait for full epoch' does not effect the RINEX Observation file content. Observations received later than 'Wait for full epoch' seconds will still be included in the RINEX Observation files.</p>"));
311 _outFileLineEdit->setWhatsThis(tr("Specify the full path to a file where synchronized observations are saved in plain ASCII format. Beware that the size of this file can rapidly increase depending on the number of incoming streams."));
312 _outPortLineEdit->setWhatsThis(tr("BNC can produce synchronized observations in binary format on your local host through an IP port. Specify a port number here to activate this function."));
313 _outUPortLineEdit->setWhatsThis(tr("BNC can produce unsynchronized observations in binary format on your local host through an IP port. Specify a port number here to activate this function."));
314 _outEphPortLineEdit->setWhatsThis(tr("BNC can produce ephemeris data in RINEX ASCII format on your local host through an IP port. Specify a port number here to activate this function."));
315 _corrPortLineEdit->setWhatsThis(tr("BNC can produce Broadcast Ephemeris Corrections on your local host through an IP port. Specify a port number here to activate this function."));
316 _corrTimeSpinBox->setWhatsThis(tr("Concerning output through IP port, BNC drops Broadcast Ephemeris Corrections received later than 'Wait for full epoch' seconds. A value of 2 to 5 seconds is recommended, depending on the latency of the incoming correction stream(s) and the delay acceptable to your real-time application."));
317 _rnxPathLineEdit->setWhatsThis(tr("Here you specify the path to where the RINEX Observation files will be stored. If the specified directory does not exist, BNC will not create RINEX Observation files."));
318 _ephPathLineEdit->setWhatsThis(tr("Specify the path for saving Broadcast Ephemeris data as RINEX Navigation files. If the specified directory does not exist, BNC will not create RINEX Navigation files."));
319 _corrPathLineEdit->setWhatsThis(tr("Specify a directory for saving Broadcast Ephemeris Correction files. If the specified directory does not exist, BNC will not create the files."));
320 _rnxScrpLineEdit->setWhatsThis(tr("<p>Whenever a RINEX Observation file is saved, you might want to compress, copy or upload it immediately via FTP. BNC allows you to execute a script/batch file to carry out these operations. To do that specify the full path of the script/batch file here. BNC will pass the full RINEX Observation file path to the script as a command line parameter (%1 on Windows systems, $1 onUnix/Linux systems).</p><p>The triggering event for calling the script or batch file is the end of a RINEX Observation file 'Interval'. If that is overridden by a stream outage, the triggering event is the stream reconnection.</p>"));
321 _rnxSkelLineEdit->setWhatsThis(tr("<p>Whenever BNC starts generating RINEX Observation files (and then once every day at midnight), it first tries to retrieve information needed for RINEX headers from so-called public RINEX header skeleton files which are derived from sitelogs. However, sometimes public RINEX header skeleton files are not available, its contents is not up to date, or you need to put additional/optional records in the RINEX header.</p><p>For that BNC allows using personal skeleton files that contain the header records you would like to include. You can derive a personal RINEX header skeleton file from the information given in an up to date sitelog. A file in the RINEX 'Directory' with the RINEX 'Skeleton extension' is interpreted by BNC as a personal RINEX header skeleton file for the corresponding stream.</p>"));
322 _rnxAppendCheckBox->setWhatsThis(tr("<p>When BNC is started, new files are created by default and any existing files with the same name will be overwritten. However, users might want to append already existing files following a restart of BNC, a system crash or when BNC crashed. Tick 'Append files' to continue with existing files and keep what has been recorded so far.</p>"));
323 _autoStartCheckBox->setWhatsThis(tr("<p>Tick 'Auto start' for auto-start of BNC at startup time in window mode with preassigned processing options.</p>"));
324 _onTheFlyComboBox->setWhatsThis(tr("<p>When operating BNC online in 'no window' mode, some configuration parameters can be changed on-the-fly without interrupting the running process. For that BNC rereads parts of its configuration in pre-defined intervals.<p></p>Select '1 min', '1 hour', or '1 day' to force BNC to reread its configuration every full minute, hour, or day and let in between edited configuration options become effective on-the-fly without terminating uninvolved threads.</p><p>Note that when operating BNC in window mode, on-the-fly changeable configuration options become effective immediately through 'Save & Activate Options'.</p>"));
325 _rnxIntrComboBox->setWhatsThis(tr("<p>Select the length of the RINEX Observation file.</p>"));
326 _ephIntrComboBox->setWhatsThis(tr("<p>Select the length of the RINEX Navigation file.</p>"));
327 _corrIntrComboBox->setWhatsThis(tr("<p>Select the length of the Broadcast Ephemeris Correction files.</p>"));
328 _rnxSamplSpinBox->setWhatsThis(tr("<p>Select the RINEX Observation sampling interval in seconds. A value of zero '0' tells BNC to store all received epochs into RINEX.</p>"));
329 _binSamplSpinBox->setWhatsThis(tr("<p>Select the Observation sampling interval in seconds. A value of zero '0' tells BNC to send/store all received epochs.</p>"));
330 _obsRateComboBox->setWhatsThis(tr("<p>BNC can collect all returns (success or failure) coming from a decoder within a certain short time span to then decide whether a stream has an outage or its content is corrupted. The procedure needs a rough estimate of the expected 'Observation rate' of the incoming streams. When a continuous problem is detected, BNC can inform its operator about this event through an advisory note.</p><p>An empty option field (default) means that you don't want an explicit information from BNC about stream outages and incoming streams that can not be decoded and that the special procedure for handling of corrupted streams is bypassed.</p>"));
331 _adviseRecoSpinBox->setWhatsThis(tr("<p>Following a stream outage or a longer series of bad observations, an advisory note is generated when valid observations are received again throughout the 'Recovery threshold' time span. A value of about 5min (default) is recommended.</p><p>A value of zero '0' means that for any stream recovery, however short, BNC immediately generates an advisory note.</p><p>Note that for using this function you need to specify the 'Observation rate'.</p>"));
332 _adviseFailSpinBox->setWhatsThis(tr("<p>An advisory note is generated when no (or only corrupted) observations are seen throughout the 'Failure threshold' time span. A value of 15 min (default) is recommended.</p><p>A value of zero '0' means that for any stream failure, however short, BNC immediately generates an advisory note.</p><p>Note that for using this function you need to specify the 'Observation rate'.</p>"));
333 _makePauseCheckBox->setWhatsThis(tr("<p>In case of a continuously corrupted stream, the decoding process can be paused and decodings are then attempted again at decreasing rate till the stream hopefully recovers. Tick 'Pause' to activate this function.</p><p>Do not tick 'Pause' (default) in order to prevent BNC from making any decoding pause. Be aware that this may incur an unnecessary workload.</p><p>Note that this function is only effective if an 'Observation rate' is specified.</p>"));
334 _logFileLineEdit->setWhatsThis(tr("Records of BNC's activities are shown in the 'Logs' section on the bottom of this window. They can be saved into a file when a valid path is specified in the 'Logfile (full path)' field."));
335 _adviseScriptLineEdit->setWhatsThis(tr("<p>Specify the full path to a script or batch file to handle advisory notes generated in the event of corrupted streams or stream outages. The affected mountpoint and one of the comments 'Begin_Outage', 'End_Outage', 'Begin_Corrupted', or 'End_Corrupted' are passed on to the script as command line parameters.</p><p>The script can be configured to send an email to BNC's operator and/or to the affected stream provider. An empty option field (default) or invalid path means that you don't want to use this option.</p><p> Note that for using this function you need to specify the 'Observation rate'.</p>"));
336 _perfIntrComboBox->setWhatsThis(tr("<p>BNC can average latencies per stream over a certain period of GPS time. The resulting mean latencies are recorded in the 'Logs' section at the end of each 'Log latency' interval together with results of a statistical evaluation (approximate number of covered epochs, data gaps).</p><p>Select a 'Log latency' interval or select the empty option field if you do not want BNC to log latencies and statistical information.</p>"));
337 _mountPointsTable->setWhatsThis(tr("<p>Streams selected for retrieval are listed in the 'Streams' section. Clicking on 'Add Streams' button will open a window that allows the user to select data streams from an NTRIP broadcaster according to their mountpoints. To remove a stream from the 'Streams' list, highlight it by clicking on it and hit the 'Delete Streams' button. You can also remove multiple streams by highlighting them using +Shift and +Ctrl.</p><p>BNC automatically allocates one of its internal decoders to a stream based on the stream's 'format' as given in the sourcetable. BNC allows users to change this selection by editing the decoder string. Double click on the 'decoder' field, enter your preferred decoder and then hit Enter. The accepted decoder strings are 'RTCM_2.x', 'RTCM_3.x', and 'RTIGS'.</p><p>In case you need to log the raw data as is, BNC allows users to by-pass its decoders and and directly save the input in daily log files. To do this specify the decoder string as 'ZERO'.</p><p>BNC can also retrieve streams from virtual reference stations (VRS). VRS streams are indicated by a 'yes' in the 'nmea' column. To initiate these streams, the approximate latitude/longitude rover position is sent to the NTRIP broadcaster. The default values can be change according to your requirement. Double click on 'lat' and 'long' fields, enter the values you wish to send and then hit Enter.</p>"));
338 _log->setWhatsThis(tr("Records of BNC's activities are shown in the 'Logs' section. The message log covers the communication status between BNC and the NTRIP broadcaster as well as any problems that occur in the communication link, stream availability, stream delay, stream conversion etc."));
339 _ephV3CheckBox->setWhatsThis(tr("The default format for RINEX Navigation files containing Broadcast Ephemeris is RINEX Version 2.11. Select 'Version 3' if you want to save the ephemeris in RINEX Version 3 format."));
340 _rnxV3CheckBox->setWhatsThis(tr("The default format for RINEX Observation files is RINEX Version 2.11. Select 'Version 3' if you want to save the observations in RINEX Version 3 format."));
341 _miscMountLineEdit->setWhatsThis(tr("<p>Specify a mountpoint to apply any of the options shown below. Enter 'ALL' if you want to apply these options to all configured streams.</p><p>An empty option field (default) means that you don't want BNC to apply any of these options.</p>"));
342 _scanRTCMCheckBox->setWhatsThis(tr("<p>Tick 'Scan RTCM' to log the numbers of incomming message types as well as contained antenna coordinates, antenna heigt, and antenna descriptor.</p><p>An empty option field (default) means that you don't want BNC to log such information.</p>"));
343 _serialMountPointLineEdit->setWhatsThis(tr("<p>Enter a 'Mountpoint' to forward the corresponding stream to a serial connected device.</p>"));
344 _serialPortNameLineEdit->setWhatsThis(tr("<p>Enter the serial 'Port name' selected for communication with your serial connected device. Valid port names are</p><pre>Windows: COM1, COM2<br>Linux: /dev/ttyS0, /dev/ttyS1<br>FreeBSD: /dev/ttyd0, /dev/ttyd1<br>Digital Unix: /dev/tty01, /dev/tty02<br>HP-UX: /dev/tty1p0, /dev/tty2p0<br>SGI/IRIX: /dev/ttyf1, /dev/ttyf2<br>SunOS/Solaris: /dev/ttya, /dev/ttyb</pre><p>Note that you must plug a serial cable in the port defined here before you start BNC.</p>"));
345 _serialBaudRateComboBox->setWhatsThis(tr("<p>Select a 'Baud rate' for the serial link.</p><p>Note that your selection must equal the baud rate configured to the serial connected device. Note further that using a high baud rate is recommended.</p>"));
346 _serialParityComboBox->setWhatsThis(tr("<p>Select the 'Parity' for the serial link.</p><p>Note that your selection must equal the parity selection configured to the serial connected device. Note further that parity is often set to 'NONE'.</p>"));
347 _serialDataBitsComboBox->setWhatsThis(tr("<p>Select the number of 'Data bits' for the serial link.</p><p>Note that your selection must equal the number of data bits configured to the serial connected device. Note further that often 8 data bits are used.</p>"));
348 _serialStopBitsComboBox->setWhatsThis(tr("<p>Select the number of 'Stop bits' for the serial link.</p><p>Note that your selection must equal the number of stop bits configured to the serial connected device. Note further that often 1 stop bit is used.</p>"));
349 _serialAutoNMEACheckBox->setWhatsThis(tr("<p>Tick 'Auto NMEA' to forward NMEA GGA messages coming from your serial connected device to the NTRIP brodacaster.</p><p>Note that this replaces the simulation of an initial NMEA GGA message based on latitude/longitude from the broadcaster's sourcetable.</p>"));
350
351 // Canvas with Editable Fields
352 // ---------------------------
353 _canvas = new QWidget;
354 setCentralWidget(_canvas);
355
356//QTabWidget* aogroup = new QTabWidget();
357 aogroup = new QTabWidget();
358 QWidget* pgroup = new QWidget();
359 QWidget* ggroup = new QWidget();
360 QWidget* sgroup = new QWidget();
361 QWidget* egroup = new QWidget();
362 QWidget* agroup = new QWidget();
363 QWidget* cgroup = new QWidget();
364 QWidget* ogroup = new QWidget();
365 QWidget* rgroup = new QWidget();
366 QWidget* sergroup = new QWidget();
367 aogroup->addTab(pgroup,tr("Proxy"));
368 aogroup->addTab(ggroup,tr("General"));
369 aogroup->addTab(ogroup,tr("RINEX Observations"));
370 aogroup->addTab(egroup,tr("RINEX Ephemeris"));
371 aogroup->addTab(cgroup,tr("Ephemeris Corrections"));
372 aogroup->addTab(sgroup,tr("Feed Engine"));
373 aogroup->addTab(sergroup,tr("Serial Link"));
374 aogroup->addTab(agroup,tr("Outages"));
375 aogroup->addTab(rgroup,tr("Miscellaneous"));
376
377 // Proxy
378 // ----
379 QGridLayout* pLayout = new QGridLayout;
380 pLayout->setColumnMinimumWidth(0,13*ww);
381 pLayout->addWidget(new QLabel("Proxy host"), 0, 0);
382 pLayout->addWidget(_proxyHostLineEdit, 0, 1, 1,10);
383 pLayout->addWidget(new QLabel("Proxy port"), 1, 0);
384 pLayout->addWidget(_proxyPortLineEdit, 1, 1);
385 pLayout->addWidget(new QLabel("Settings for the proxy in protected networks, leave boxes blank if none."),2, 0, 1, 50, Qt::AlignLeft);
386 pLayout->addWidget(new QLabel(" "),3,0);
387 pLayout->addWidget(new QLabel(" "),4,0);
388 pLayout->addWidget(new QLabel(" "),5,0);
389 pgroup->setLayout(pLayout);
390
391
392 connect(_proxyHostLineEdit, SIGNAL(textChanged(const QString &)),
393 this, SLOT(bncText(const QString &)));
394 if (_proxyHostLineEdit->text().isEmpty()) {
395 palette.setColor(_proxyPortLineEdit->backgroundRole(), Qt::lightGray);
396 _proxyPortLineEdit->setPalette(palette);
397 _proxyPortLineEdit->setEnabled(false);
398 }
399
400 // General
401 // -------
402 QGridLayout* gLayout = new QGridLayout;
403 gLayout->setColumnMinimumWidth(0,14*ww);
404 gLayout->addWidget(new QLabel("Logfile (full path)"), 0, 0);
405 gLayout->addWidget(_logFileLineEdit, 0, 1);
406 gLayout->addWidget(new QLabel("Append files"), 1, 0);
407 gLayout->addWidget(_rnxAppendCheckBox, 1, 1);
408 gLayout->addWidget(new QLabel("Reread configuration"), 2, 0);
409 gLayout->addWidget(_onTheFlyComboBox, 2, 1);
410 gLayout->addWidget(new QLabel("Auto start"), 3, 0);
411 gLayout->addWidget(_autoStartCheckBox, 3, 1);
412 gLayout->addWidget(new QLabel("General settings for logfile, file handling, configuration on-the-fly, and auto-start."),4, 0, 1, 2, Qt::AlignLeft);
413 gLayout->addWidget(new QLabel(" "),5,0);
414 ggroup->setLayout(gLayout);
415
416 // Feed Engine
417 // -----------
418 QGridLayout* sLayout = new QGridLayout;
419 sLayout->setColumnMinimumWidth(0,14*ww);
420 sLayout->addWidget(new QLabel("Port (synchronized)"), 0, 0);
421 sLayout->addWidget(_outPortLineEdit, 0, 1);
422 sLayout->addWidget(new QLabel("Wait for full epoch"), 0, 2, Qt::AlignRight);
423 sLayout->addWidget(_waitTimeSpinBox, 0, 3, Qt::AlignLeft);
424 sLayout->addWidget(new QLabel("Port (unsynchronized)"), 1, 0);
425 sLayout->addWidget(_outUPortLineEdit, 1, 1);
426 sLayout->addWidget(new QLabel("File (full path)"), 2, 0);
427 sLayout->addWidget(_outFileLineEdit, 2, 1, 1, 30);
428 sLayout->addWidget(new QLabel("Sampling"), 3, 0);
429 sLayout->addWidget(_binSamplSpinBox, 3, 1, Qt::AlignLeft);
430 sLayout->addWidget(new QLabel("Output decoded observations in a binary format to feed a real-time GNSS engine."),4,0,1,30);
431 sLayout->addWidget(new QLabel(" "),5,0);
432 sgroup->setLayout(sLayout);
433
434 connect(_outPortLineEdit, SIGNAL(textChanged(const QString &)),
435 this, SLOT(bncText(const QString &)));
436 if (_outPortLineEdit->text().isEmpty()) {
437 palette.setColor(_waitTimeSpinBox->backgroundRole(), Qt::lightGray);
438 _waitTimeSpinBox->setPalette(palette);
439 palette.setColor(_outUPortLineEdit->backgroundRole(), Qt::lightGray);
440 _outUPortLineEdit->setPalette(palette);
441 palette.setColor(_outFileLineEdit->backgroundRole(), Qt::lightGray);
442 _outFileLineEdit->setPalette(palette);
443 palette.setColor(_binSamplSpinBox->backgroundRole(), Qt::lightGray);
444 _binSamplSpinBox->setPalette(palette);
445 _waitTimeSpinBox->setEnabled(false);
446 _outUPortLineEdit->setEnabled(false);
447 _outFileLineEdit->setEnabled(false);
448 _binSamplSpinBox->setEnabled(false);
449 }
450
451 // RINEX Ephemeris
452 // ---------------
453 QGridLayout* eLayout = new QGridLayout;
454 eLayout->setColumnMinimumWidth(0,14*ww);
455 eLayout->addWidget(new QLabel("Directory"), 0, 0);
456 eLayout->addWidget(_ephPathLineEdit, 0, 1);
457 eLayout->addWidget(new QLabel("Interval"), 1, 0);
458 eLayout->addWidget(_ephIntrComboBox, 1, 1);
459 eLayout->addWidget(new QLabel("Port"), 2, 0);
460 eLayout->addWidget(_outEphPortLineEdit, 2, 1);
461 eLayout->addWidget(new QLabel("Version 3"), 3, 0);
462 eLayout->addWidget(_ephV3CheckBox, 3, 1);
463 eLayout->addWidget(new QLabel("Saving RINEX ephemeris files and ephemeris output through IP port."),4,0,1,2,Qt::AlignLeft);
464 eLayout->addWidget(new QLabel(" "),5,0);
465 egroup->setLayout(eLayout);
466
467 connect(_ephPathLineEdit, SIGNAL(textChanged(const QString &)),
468 this, SLOT(bncText(const QString &)));
469 if (_ephPathLineEdit->text().isEmpty()) {
470 palette.setColor(_ephIntrComboBox->backgroundRole(), Qt::lightGray);
471 _ephIntrComboBox->setPalette(palette);
472 palette.setColor(_outEphPortLineEdit->backgroundRole(), Qt::lightGray);
473 _outEphPortLineEdit->setPalette(palette);
474 palette.setColor(_ephV3CheckBox->backgroundRole(), Qt::lightGray);
475 _ephV3CheckBox->setPalette(palette);
476 _ephIntrComboBox->setEnabled(false);
477 _outEphPortLineEdit->setEnabled(false);
478 _ephV3CheckBox->setEnabled(false);
479 }
480
481 // Outages
482 // -------
483 QGridLayout* aLayout = new QGridLayout;
484 aLayout->setColumnMinimumWidth(0,14*ww);
485 aLayout->addWidget(new QLabel("Observation rate"), 0, 0);
486 aLayout->addWidget(_obsRateComboBox, 0, 1);
487 aLayout->addWidget(new QLabel("Failure threshold"), 1, 0);
488 aLayout->addWidget(_adviseFailSpinBox, 1, 1);
489 aLayout->addWidget(new QLabel("Recovery threshold"), 2, 0);
490 aLayout->addWidget(_adviseRecoSpinBox, 2, 1);
491 aLayout->addWidget(new QLabel("Pause"), 2, 2, Qt::AlignRight);
492 aLayout->addWidget(_makePauseCheckBox, 2, 3, Qt::AlignLeft);
493 aLayout->addWidget(new QLabel("Script (full path)"), 3, 0);
494 aLayout->addWidget(_adviseScriptLineEdit, 3, 1,1,10);
495 aLayout->addWidget(new QLabel("Outage report, handling of corrupted streams."),5,0,1,10,Qt::AlignLeft);
496 agroup->setLayout(aLayout);
497
498 connect(_obsRateComboBox, SIGNAL(currentIndexChanged(const QString &)),
499 this, SLOT(bncText(const QString)));
500 if (_obsRateComboBox->currentText().isEmpty()) {
501 palette.setColor(_adviseFailSpinBox->backgroundRole(), Qt::lightGray);
502 _adviseFailSpinBox->setPalette(palette);
503 palette.setColor(_adviseRecoSpinBox->backgroundRole(), Qt::lightGray);
504 _adviseRecoSpinBox->setPalette(palette);
505 palette.setColor(_makePauseCheckBox->backgroundRole(), Qt::lightGray);
506 _makePauseCheckBox->setPalette(palette);
507 palette.setColor(_adviseScriptLineEdit->backgroundRole(), Qt::lightGray);
508 _adviseScriptLineEdit->setPalette(palette);
509 _adviseFailSpinBox->setEnabled(false);
510 _adviseRecoSpinBox->setEnabled(false);
511 _makePauseCheckBox->setEnabled(false);
512 _adviseScriptLineEdit->setEnabled(false);
513 }
514
515 // Miscellaneous
516 // -------------
517 QGridLayout* rLayout = new QGridLayout;
518 rLayout->setColumnMinimumWidth(0,14*ww);
519 rLayout->addWidget(new QLabel("Mountpoint"), 0, 0);
520 rLayout->addWidget(_miscMountLineEdit, 0, 1, 1,7);
521 rLayout->addWidget(new QLabel("Log latency"), 1, 0);
522 rLayout->addWidget(_perfIntrComboBox, 1, 1);
523 rLayout->addWidget(new QLabel("Scan RTCM"), 2, 0);
524 rLayout->addWidget(_scanRTCMCheckBox, 2, 1);
525 rLayout->addWidget(new QLabel("Log latencies or scan RTCM streams for numbers of message types and antenna information."),3, 0,1,30);
526 rLayout->addWidget(new QLabel(" "), 4, 0);
527 rLayout->addWidget(new QLabel(" "), 5, 0);
528 rgroup->setLayout(rLayout);
529
530 connect(_miscMountLineEdit, SIGNAL(textChanged(const QString &)),
531 this, SLOT(bncText(const QString &)));
532 if (_miscMountLineEdit->text().isEmpty()) {
533 palette.setColor(_perfIntrComboBox->backgroundRole(), Qt::lightGray);
534 _perfIntrComboBox->setPalette(palette);
535 palette.setColor(_scanRTCMCheckBox->backgroundRole(), Qt::lightGray);
536 _scanRTCMCheckBox->setPalette(palette);
537 _perfIntrComboBox->setEnabled(false);
538 _scanRTCMCheckBox->setEnabled(false);
539 }
540
541 // RINEX Observations
542 // ------------------
543 QGridLayout* oLayout = new QGridLayout;
544 oLayout->setColumnMinimumWidth(0,14*ww);
545 oLayout->addWidget(new QLabel("Directory"), 0, 0);
546 oLayout->addWidget(_rnxPathLineEdit, 0, 1,1,12);
547 oLayout->addWidget(new QLabel("Interval"), 1, 0);
548 oLayout->addWidget(_rnxIntrComboBox, 1, 1);
549 oLayout->addWidget(new QLabel("Sampling"), 1, 2, Qt::AlignRight);
550 oLayout->addWidget(_rnxSamplSpinBox, 1, 3, Qt::AlignLeft);
551 oLayout->addWidget(new QLabel("Skeleton extension"), 2, 0);
552 oLayout->addWidget(_rnxSkelLineEdit, 2, 1,1,1, Qt::AlignLeft);
553 oLayout->addWidget(new QLabel("Script (full path)"), 3, 0);
554 oLayout->addWidget(_rnxScrpLineEdit, 3, 1,1,12);
555 oLayout->addWidget(new QLabel("Version 3"), 4, 0);
556 oLayout->addWidget(_rnxV3CheckBox, 4, 1);
557 oLayout->addWidget(new QLabel("Saving RINEX observation files."),5,0,1,12, Qt::AlignLeft);
558 ogroup->setLayout(oLayout);
559
560 connect(_rnxPathLineEdit, SIGNAL(textChanged(const QString &)),
561 this, SLOT(bncText(const QString &)));
562 if (_rnxPathLineEdit->text().isEmpty()) {
563 palette.setColor(_rnxIntrComboBox->backgroundRole(), Qt::lightGray);
564 _rnxIntrComboBox->setPalette(palette);
565 palette.setColor(_rnxSamplSpinBox->backgroundRole(), Qt::lightGray);
566 _rnxSamplSpinBox->setPalette(palette);
567 palette.setColor(_rnxSkelLineEdit->backgroundRole(), Qt::lightGray);
568 _rnxSkelLineEdit->setPalette(palette);
569 palette.setColor(_rnxScrpLineEdit->backgroundRole(), Qt::lightGray);
570 _rnxScrpLineEdit->setPalette(palette);
571 palette.setColor(_rnxV3CheckBox->backgroundRole(), Qt::lightGray);
572 _rnxV3CheckBox->setPalette(palette);
573 _rnxIntrComboBox->setEnabled(false);
574 _rnxSamplSpinBox->setEnabled(false);
575 _rnxSkelLineEdit->setEnabled(false);
576 _rnxScrpLineEdit->setEnabled(false);
577 _rnxV3CheckBox->setEnabled(false);
578 }
579
580 // Ephemeris Corrections
581 // ---------------------
582 QGridLayout* cLayout = new QGridLayout;
583 cLayout->setColumnMinimumWidth(0,14*ww);
584 cLayout->addWidget(new QLabel("Directory"), 0, 0);
585 cLayout->addWidget(_corrPathLineEdit, 0, 1,1,30);
586 cLayout->addWidget(new QLabel("Interval"), 1, 0);
587 cLayout->addWidget(_corrIntrComboBox, 1, 1);
588 cLayout->addWidget(new QLabel("Port"), 2, 0);
589 cLayout->addWidget(_corrPortLineEdit, 2, 1);
590 cLayout->addWidget(new QLabel("Wait for full epoch"), 2, 2, Qt::AlignRight);
591 cLayout->addWidget(_corrTimeSpinBox, 2, 3, Qt::AlignLeft);
592 cLayout->addWidget(new QLabel("Saving Broadcast Ephemeris correction files and correction output through IP port."),3,0,1,30);
593 cLayout->addWidget(new QLabel(" "),4,0);
594 cLayout->addWidget(new QLabel(" "),5,0);
595 cgroup->setLayout(cLayout);
596
597 connect(_corrPathLineEdit, SIGNAL(textChanged(const QString &)),
598 this, SLOT(bncText(const QString &)));
599 if (_corrPathLineEdit->text().isEmpty()) {
600 palette.setColor(_corrIntrComboBox->backgroundRole(), Qt::lightGray);
601 _corrIntrComboBox->setPalette(palette);
602 palette.setColor(_corrPortLineEdit->backgroundRole(), Qt::lightGray);
603 _corrPortLineEdit->setPalette(palette);
604 palette.setColor(_corrTimeSpinBox->backgroundRole(), Qt::lightGray);
605 _corrTimeSpinBox->setPalette(palette);
606 _corrIntrComboBox->setEnabled(false);
607 _corrPortLineEdit->setEnabled(false);
608 _corrTimeSpinBox->setEnabled(false);
609 }
610
611 // Serial Link
612 // -----------
613 QGridLayout* serLayout = new QGridLayout;
614 serLayout->setColumnMinimumWidth(0,14*ww);
615 serLayout->addWidget(new QLabel("Mountpoint"), 0,0, Qt::AlignLeft);
616 serLayout->addWidget(_serialMountPointLineEdit, 0,1,1,2);
617 serLayout->addWidget(new QLabel("Port name"), 1,0, Qt::AlignLeft);
618 serLayout->addWidget(_serialPortNameLineEdit, 1,1,1,2);
619 serLayout->addWidget(new QLabel("Baud rate"), 2,0, Qt::AlignLeft);
620 serLayout->addWidget(_serialBaudRateComboBox, 2,1);
621 serLayout->addWidget(new QLabel(" Parity "), 2,2, Qt::AlignRight);
622 serLayout->addWidget(_serialParityComboBox, 2,3);
623 serLayout->addWidget(new QLabel("Data bits"), 3,0, Qt::AlignLeft);
624 serLayout->addWidget(_serialDataBitsComboBox, 3,1);
625 serLayout->addWidget(new QLabel(" Stop bits "), 3,2, Qt::AlignRight);
626 serLayout->addWidget(_serialStopBitsComboBox, 3,3);
627 serLayout->addWidget(new QLabel("Auto NMEA"), 4, 0);
628 serLayout->addWidget(_serialAutoNMEACheckBox, 4, 1);
629 serLayout->addWidget(new QLabel("Serial port settings to feed a serial connected device."),5,0,1,30);
630
631 connect(_serialMountPointLineEdit, SIGNAL(textChanged(const QString &)),
632 this, SLOT(bncText(const QString &)));
633 if (_serialMountPointLineEdit->text().isEmpty()) {
634 palette.setColor(_serialPortNameLineEdit->backgroundRole(), Qt::lightGray);
635 _serialPortNameLineEdit->setPalette(palette);
636 palette.setColor(_serialBaudRateComboBox->backgroundRole(), Qt::lightGray);
637 _serialBaudRateComboBox->setPalette(palette);
638 palette.setColor(_serialParityComboBox->backgroundRole(), Qt::lightGray);
639 _serialParityComboBox->setPalette(palette);
640 palette.setColor(_serialDataBitsComboBox->backgroundRole(), Qt::lightGray);
641 _serialDataBitsComboBox->setPalette(palette);
642 palette.setColor(_serialStopBitsComboBox->backgroundRole(), Qt::lightGray);
643 _serialStopBitsComboBox->setPalette(palette);
644 palette.setColor(_serialAutoNMEACheckBox->backgroundRole(), Qt::lightGray);
645 _serialAutoNMEACheckBox->setPalette(palette);
646 _serialPortNameLineEdit->setEnabled(false);
647 _serialBaudRateComboBox->setEnabled(false);
648 _serialParityComboBox->setEnabled(false);
649 _serialDataBitsComboBox->setEnabled(false);
650 _serialStopBitsComboBox->setEnabled(false);
651 _serialAutoNMEACheckBox->setEnabled(false);
652 }
653
654 sergroup->setLayout(serLayout);
655
656 QGridLayout* mLayout = new QGridLayout;
657 aogroup->setCurrentIndex(settings.value("startTab").toInt());
658 mLayout->addWidget(aogroup, 0,0);
659 mLayout->addWidget(_mountPointsTable, 1,0);
660 mLayout->addWidget(new QLabel(" Logs:"),2,0);
661 mLayout->addWidget(_log, 3,0);
662
663 _canvas->setLayout(mLayout);
664
665 // Auto start
666 // ----------
667 if ( Qt::CheckState(settings.value("autoStart").toInt()) == Qt::Checked) {
668 slotGetData();
669 }
670}
671
672// Destructor
673////////////////////////////////////////////////////////////////////////////
674bncWindow::~bncWindow() {
675 delete _caster;
676}
677
678//
679////////////////////////////////////////////////////////////////////////////
680void bncWindow::populateMountPointsTable() {
681
682 for (int iRow = _mountPointsTable->rowCount()-1; iRow >=0; iRow--) {
683 _mountPointsTable->removeRow(iRow);
684 }
685
686 QSettings settings;
687
688 QListIterator<QString> it(settings.value("mountPoints").toStringList());
689 if (!it.hasNext()) {
690 _actGetData->setEnabled(false);
691 }
692 int iRow = 0;
693 while (it.hasNext()) {
694 QStringList hlp = it.next().split(" ");
695 if (hlp.size() < 5) continue;
696 _mountPointsTable->insertRow(iRow);
697
698 QUrl url(hlp[0]);
699
700 QString fullPath = url.host() + QString(":%1").arg(url.port()) + url.path();
701 QString format(hlp[1]); QString latitude(hlp[2]); QString longitude(hlp[3]);
702 QString nmea(hlp[4]);
703 QString ntripVersion = "1";
704 if (hlp.size() >= 6) {
705 ntripVersion = (hlp[5]);
706 }
707
708 QTableWidgetItem* it;
709 it = new QTableWidgetItem(url.userInfo());
710 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
711 _mountPointsTable->setItem(iRow, 0, it);
712
713 it = new QTableWidgetItem(fullPath);
714 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
715 _mountPointsTable->setItem(iRow, 1, it);
716
717 it = new QTableWidgetItem(format);
718 _mountPointsTable->setItem(iRow, 2, it);
719
720 if (nmea == "yes") {
721 it = new QTableWidgetItem(latitude);
722 _mountPointsTable->setItem(iRow, 3, it);
723 it = new QTableWidgetItem(longitude);
724 _mountPointsTable->setItem(iRow, 4, it);
725 } else {
726 it = new QTableWidgetItem(latitude);
727 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
728 _mountPointsTable->setItem(iRow, 3, it);
729 it = new QTableWidgetItem(longitude);
730 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
731 _mountPointsTable->setItem(iRow, 4, it);
732 }
733
734 it = new QTableWidgetItem(nmea);
735 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
736 _mountPointsTable->setItem(iRow, 5, it);
737
738 it = new QTableWidgetItem(ntripVersion);
739 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
740 _mountPointsTable->setItem(iRow, 6, it);
741
742 bncTableItem* bncIt = new bncTableItem();
743 bncIt->setFlags(bncIt->flags() & ~Qt::ItemIsEditable);
744 _mountPointsTable->setItem(iRow, 7, bncIt);
745
746 iRow++;
747 }
748
749 _mountPointsTable->sortItems(1);
750}
751
752// Retrieve Table
753////////////////////////////////////////////////////////////////////////////
754void bncWindow::slotAddMountPoints() {
755
756 QSettings settings;
757 QString proxyHost = settings.value("proxyHost").toString();
758 int proxyPort = settings.value("proxyPort").toInt();
759 if (proxyHost != _proxyHostLineEdit->text() ||
760 proxyPort != _proxyPortLineEdit->text().toInt()) {
761 int iRet = QMessageBox::question(this, "Question", "Proxy options "
762 "changed. Use the new ones?",
763 QMessageBox::Yes, QMessageBox::No,
764 QMessageBox::NoButton);
765 if (iRet == QMessageBox::Yes) {
766 settings.setValue("proxyHost", _proxyHostLineEdit->text());
767 settings.setValue("proxyPort", _proxyPortLineEdit->text());
768 settings.sync();
769 }
770 }
771
772 bncTableDlg* dlg = new bncTableDlg(this);
773 dlg->move(this->pos().x()+50, this->pos().y()+50);
774 connect(dlg, SIGNAL(newMountPoints(QStringList*)),
775 this, SLOT(slotNewMountPoints(QStringList*)));
776 dlg->exec();
777 delete dlg;
778
779}
780
781// Delete Selected Mount Points
782////////////////////////////////////////////////////////////////////////////
783void bncWindow::slotDeleteMountPoints() {
784
785 int nRows = _mountPointsTable->rowCount();
786 bool flg[nRows];
787 for (int iRow = 0; iRow < nRows; iRow++) {
788 if (_mountPointsTable->isItemSelected(_mountPointsTable->item(iRow,1))) {
789 flg[iRow] = true;
790 }
791 else {
792 flg[iRow] = false;
793 }
794 }
795 for (int iRow = nRows-1; iRow >= 0; iRow--) {
796 if (flg[iRow]) {
797 _mountPointsTable->removeRow(iRow);
798 }
799 }
800 _actDeleteMountPoints->setEnabled(false);
801
802 if (_mountPointsTable->rowCount() == 0) {
803 _actGetData->setEnabled(false);
804 }
805}
806
807// New Mount Points Selected
808////////////////////////////////////////////////////////////////////////////
809void bncWindow::slotNewMountPoints(QStringList* mountPoints) {
810 int iRow = 0;
811 QListIterator<QString> it(*mountPoints);
812 while (it.hasNext()) {
813 QStringList hlp = it.next().split(" ");
814 QUrl url(hlp[0]);
815 QString fullPath = url.host() + QString(":%1").arg(url.port()) + url.path();
816 QString format(hlp[1]); QString latitude(hlp[2]); QString longitude(hlp[3]);
817 QString nmea(hlp[4]);
818 QString ntripVersion = "1";
819 if (hlp.size() >= 6) {
820 ntripVersion = (hlp[5]);
821 }
822
823 _mountPointsTable->insertRow(iRow);
824
825 QTableWidgetItem* it;
826 it = new QTableWidgetItem(url.userInfo());
827 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
828 _mountPointsTable->setItem(iRow, 0, it);
829
830 it = new QTableWidgetItem(fullPath);
831 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
832 _mountPointsTable->setItem(iRow, 1, it);
833
834 it = new QTableWidgetItem(format);
835 _mountPointsTable->setItem(iRow, 2, it);
836
837 if (nmea == "yes") {
838 it = new QTableWidgetItem(latitude);
839 _mountPointsTable->setItem(iRow, 3, it);
840 it = new QTableWidgetItem(longitude);
841 _mountPointsTable->setItem(iRow, 4, it);
842 } else {
843 it = new QTableWidgetItem(latitude);
844 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
845 _mountPointsTable->setItem(iRow, 3, it);
846 it = new QTableWidgetItem(longitude);
847 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
848 _mountPointsTable->setItem(iRow, 4, it);
849 }
850
851 it = new QTableWidgetItem(nmea);
852 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
853 _mountPointsTable->setItem(iRow, 5, it);
854
855 it = new QTableWidgetItem(ntripVersion);
856 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
857 _mountPointsTable->setItem(iRow, 6, it);
858
859 bncTableItem* bncIt = new bncTableItem();
860 _mountPointsTable->setItem(iRow, 7, bncIt);
861
862 iRow++;
863 }
864 _mountPointsTable->hideColumn(0);
865 _mountPointsTable->sortItems(1);
866 if (mountPoints->count() > 0 && !_actStop->isEnabled()) {
867 _actGetData->setEnabled(true);
868 }
869 delete mountPoints;
870}
871
872// Save Options
873////////////////////////////////////////////////////////////////////////////
874void bncWindow::slotSaveOptions() {
875 QSettings settings;
876 settings.setValue("proxyHost", _proxyHostLineEdit->text());
877 settings.setValue("proxyPort", _proxyPortLineEdit->text());
878 settings.setValue("waitTime", _waitTimeSpinBox->value());
879 settings.setValue("obsRate", _obsRateComboBox->currentText());
880 settings.setValue("adviseFail", _adviseFailSpinBox->value());
881 settings.setValue("adviseReco", _adviseRecoSpinBox->value());
882 settings.setValue("makePause", _makePauseCheckBox->checkState());
883 settings.setValue("outFile", _outFileLineEdit->text());
884 settings.setValue("perfIntr", _perfIntrComboBox->currentText());
885 settings.setValue("outPort", _outPortLineEdit->text());
886 settings.setValue("outUPort", _outUPortLineEdit->text());
887 settings.setValue("outEphPort", _outEphPortLineEdit->text());
888 settings.setValue("corrPort", _corrPortLineEdit->text());
889 settings.setValue("corrTime", _corrTimeSpinBox->value());
890 settings.setValue("rnxPath", _rnxPathLineEdit->text());
891 settings.setValue("ephPath", _ephPathLineEdit->text());
892 settings.setValue("corrPath", _corrPathLineEdit->text());
893 settings.setValue("rnxScript", _rnxScrpLineEdit->text());
894 settings.setValue("rnxIntr", _rnxIntrComboBox->currentText());
895 settings.setValue("onTheFlyInterval", _onTheFlyComboBox->currentText());
896 settings.setValue("ephIntr", _ephIntrComboBox->currentText());
897 settings.setValue("corrIntr", _corrIntrComboBox->currentText());
898 settings.setValue("rnxSampl", _rnxSamplSpinBox->value());
899 settings.setValue("binSampl", _binSamplSpinBox->value());
900 settings.setValue("rnxSkel", _rnxSkelLineEdit->text());
901 settings.setValue("rnxAppend", _rnxAppendCheckBox->checkState());
902 settings.setValue("autoStart", _autoStartCheckBox->checkState());
903 settings.setValue("rnxV3", _rnxV3CheckBox->checkState());
904 settings.setValue("ephV3", _ephV3CheckBox->checkState());
905 settings.setValue("logFile", _logFileLineEdit->text());
906 settings.setValue("adviseScript",_adviseScriptLineEdit->text());
907 settings.setValue("miscMount", _miscMountLineEdit->text());
908 settings.setValue("scanRTCM", _scanRTCMCheckBox->checkState());
909 settings.setValue("serialPortName", _serialPortNameLineEdit->text());
910 settings.setValue("serialMountPoint",_serialMountPointLineEdit->text());
911 settings.setValue("serialBaudRate", _serialBaudRateComboBox->currentText());
912 settings.setValue("serialParity", _serialParityComboBox->currentText());
913 settings.setValue("serialDataBits", _serialDataBitsComboBox->currentText());
914 settings.setValue("serialStopBits", _serialStopBitsComboBox->currentText());
915 settings.setValue("serialAutoNMEA", _serialAutoNMEACheckBox->checkState());
916 settings.setValue("startTab", aogroup->currentIndex());
917
918 QStringList mountPoints;
919
920 for (int iRow = 0; iRow < _mountPointsTable->rowCount(); iRow++) {
921 QUrl url( "//" + _mountPointsTable->item(iRow, 0)->text() +
922 "@" + _mountPointsTable->item(iRow, 1)->text() );
923
924 mountPoints.append(url.toString() + " " +
925 _mountPointsTable->item(iRow, 2)->text()
926 + " " + _mountPointsTable->item(iRow, 3)->text()
927 + " " + _mountPointsTable->item(iRow, 4)->text()
928 + " " + _mountPointsTable->item(iRow, 5)->text()
929 + " " + _mountPointsTable->item(iRow, 6)->text());
930 }
931 settings.setValue("mountPoints", mountPoints);
932 if (_caster) {
933 _caster->slotReadMountPoints();
934 }
935 settings.sync();
936}
937
938// All get slots terminated
939////////////////////////////////////////////////////////////////////////////
940void bncWindow::slotGetThreadErrors() {
941 ((bncApp*)qApp)->slotMessage("All Get Threads Terminated", true);
942 if (!_actStop->isEnabled()) {
943 _actGetData->setEnabled(true);
944 }
945}
946
947// Retrieve Data
948////////////////////////////////////////////////////////////////////////////
949void bncWindow::slotGetData() {
950 slotSaveOptions();
951
952 _actDeleteMountPoints->setEnabled(false);
953 _actGetData->setEnabled(false);
954 _actStop->setEnabled(true);
955
956 _caster = new bncCaster(_outFileLineEdit->text(),
957 _outPortLineEdit->text().toInt());
958
959 ((bncApp*)qApp)->setPort(_outEphPortLineEdit->text().toInt());
960 ((bncApp*)qApp)->setPortCorr(_corrPortLineEdit->text().toInt());
961
962 connect(_caster, SIGNAL(getThreadErrors()),
963 this, SLOT(slotGetThreadErrors()));
964
965 connect (_caster, SIGNAL(mountPointsRead(QList<bncGetThread*>)),
966 this, SLOT(slotMountPointsRead(QList<bncGetThread*>)));
967
968 ((bncApp*)qApp)->slotMessage("============ Start BNC ============", true);
969
970 _caster->slotReadMountPoints();
971}
972
973// Retrieve Data
974////////////////////////////////////////////////////////////////////////////
975void bncWindow::slotStop() {
976 int iRet = QMessageBox::question(this, "Stop", "Stop retrieving data?",
977 QMessageBox::Yes, QMessageBox::No,
978 QMessageBox::NoButton);
979 if (iRet == QMessageBox::Yes) {
980 delete _caster; _caster = 0;
981 _actGetData->setEnabled(true);
982 _actStop->setEnabled(false);
983 }
984}
985
986// Close Application gracefully
987////////////////////////////////////////////////////////////////////////////
988void bncWindow::closeEvent(QCloseEvent* event) {
989
990 int iRet = QMessageBox::question(this, "Close", "Save Options?",
991 QMessageBox::Yes, QMessageBox::No,
992 QMessageBox::Cancel);
993
994 if (iRet == QMessageBox::Cancel) {
995 event->ignore();
996 return;
997 }
998 else if (iRet == QMessageBox::Yes) {
999 slotSaveOptions();
1000 }
1001
1002 QMainWindow::closeEvent(event);
1003}
1004
1005// User changed the selection of mountPoints
1006////////////////////////////////////////////////////////////////////////////
1007void bncWindow::slotSelectionChanged() {
1008 if (_mountPointsTable->selectedItems().isEmpty()) {
1009 _actDeleteMountPoints->setEnabled(false);
1010 }
1011 else {
1012 _actDeleteMountPoints->setEnabled(true);
1013 }
1014}
1015
1016// Display Program Messages
1017////////////////////////////////////////////////////////////////////////////
1018void bncWindow::slotWindowMessage(const QByteArray msg, bool showOnScreen) {
1019
1020#ifdef DEBUG_RTCM2_2021
1021 const int maxBufferSize = 1000;
1022#else
1023 const int maxBufferSize = 10000;
1024#endif
1025
1026 if (! showOnScreen ) {
1027 return;
1028 }
1029
1030 QString txt = _log->toPlainText() + "\n" +
1031 QDateTime::currentDateTime().toUTC().toString("yy-MM-dd hh:mm:ss ") + msg;
1032 _log->clear();
1033 _log->append(txt.right(maxBufferSize));
1034}
1035
1036// About Message
1037////////////////////////////////////////////////////////////////////////////
1038void bncWindow::slotAbout() {
1039 new bncAboutDlg(0);
1040}
1041
1042//Flowchart
1043////////////////////////////////////////////////////////////////////////////
1044void bncWindow::slotFlowchart() {
1045 new bncFlowchartDlg(0);
1046}
1047
1048// Help Window
1049////////////////////////////////////////////////////////////////////////////
1050void bncWindow::slotHelp() {
1051 QUrl url;
1052 url.setPath(":bnchelp.html");
1053 new bncHlpDlg(0, url);
1054}
1055
1056// Select Fonts
1057////////////////////////////////////////////////////////////////////////////
1058void bncWindow::slotFontSel() {
1059 bool ok;
1060 QFont newFont = QFontDialog::getFont(&ok, this->font(), this);
1061 if (ok) {
1062 QSettings settings;
1063 settings.setValue("font", newFont.toString());
1064 QApplication::setFont(newFont);
1065 int ww = QFontMetrics(newFont).width('w');
1066 setMinimumSize(60*ww, 80*ww);
1067 resize(60*ww, 80*ww);
1068 }
1069}
1070
1071// Whats This Help
1072void bncWindow::slotWhatsThis() {
1073 QWhatsThis::enterWhatsThisMode();
1074}
1075
1076//
1077////////////////////////////////////////////////////////////////////////////
1078void bncWindow::slotMountPointsRead(QList<bncGetThread*> threads) {
1079 populateMountPointsTable();
1080 QSettings settings;
1081 _binSamplSpinBox->setValue(settings.value("binSampl").toInt());
1082 _waitTimeSpinBox->setValue(settings.value("waitTime").toInt());
1083 QListIterator<bncGetThread*> iTh(threads);
1084 while (iTh.hasNext()) {
1085 bncGetThread* thread = iTh.next();
1086 for (int iRow = 0; iRow < _mountPointsTable->rowCount(); iRow++) {
1087 QUrl url( "//" + _mountPointsTable->item(iRow, 0)->text() +
1088 "@" + _mountPointsTable->item(iRow, 1)->text() );
1089 if (url == thread->mountPoint() &&
1090 _mountPointsTable->item(iRow, 3)->text() == thread->latitude() &&
1091 _mountPointsTable->item(iRow, 4)->text() == thread->longitude() ) {
1092 ((bncTableItem*) _mountPointsTable->item(iRow, 7))->setGetThread(thread);
1093 break;
1094 }
1095 }
1096 }
1097}
1098
1099//
1100////////////////////////////////////////////////////////////////////////////
1101void bncWindow::CreateMenu() {
1102 // Create Menus
1103 // ------------
1104 _menuFile = menuBar()->addMenu(tr("&File"));
1105 _menuFile->addAction(_actFontSel);
1106 _menuFile->addSeparator();
1107 _menuFile->addAction(_actSaveOpt);
1108 _menuFile->addSeparator();
1109 _menuFile->addAction(_actQuit);
1110
1111 _menuHlp = menuBar()->addMenu(tr("&Help"));
1112 _menuHlp->addAction(_actHelp);
1113 _menuHlp->addAction(_actFlowchart);
1114 _menuHlp->addAction(_actAbout);
1115}
1116
1117// Toolbar
1118////////////////////////////////////////////////////////////////////////////
1119void bncWindow::AddToolbar() {
1120 // Tool (Command) Bar
1121 // ------------------
1122 QToolBar* toolBar = new QToolBar;
1123 addToolBar(Qt::BottomToolBarArea, toolBar);
1124 toolBar->setMovable(false);
1125 toolBar->addAction(_actAddMountPoints);
1126 toolBar->addAction(_actDeleteMountPoints);
1127 toolBar->addAction(_actGetData);
1128 toolBar->addAction(_actStop);
1129 toolBar->addWidget(new QLabel(" "));
1130 toolBar->addAction(_actwhatsthis);
1131}
1132
1133// About
1134////////////////////////////////////////////////////////////////////////////
1135bncAboutDlg::bncAboutDlg(QWidget* parent) :
1136 QDialog(parent) {
1137
1138 QTextBrowser* tb = new QTextBrowser;
1139 QUrl url; url.setPath(":bncabout.html");
1140 tb->setSource(url);
1141 tb->setReadOnly(true);
1142
1143 int ww = QFontMetrics(font()).width('w');
1144 QPushButton* _closeButton = new QPushButton("Close");
1145 _closeButton->setMaximumWidth(10*ww);
1146 connect(_closeButton, SIGNAL(clicked()), this, SLOT(close()));
1147
1148 QGridLayout* dlgLayout = new QGridLayout();
1149 QLabel* img = new QLabel();
1150 img->setPixmap(QPixmap(":ntrip-logo.png"));
1151 dlgLayout->addWidget(img, 0,0);
1152 dlgLayout->addWidget(new QLabel("BKG Ntrip Client (BNC) Version 1.7"), 0,1);
1153 dlgLayout->addWidget(tb,1,0,1,2);
1154 dlgLayout->addWidget(_closeButton,2,1,Qt::AlignRight);
1155
1156 setLayout(dlgLayout);
1157 resize(60*ww, 60*ww);
1158 show();
1159}
1160
1161//
1162////////////////////////////////////////////////////////////////////////////
1163bncAboutDlg::~bncAboutDlg() {
1164};
1165
1166// Flowchart
1167////////////////////////////////////////////////////////////////////////////
1168bncFlowchartDlg::bncFlowchartDlg(QWidget* parent) :
1169 QDialog(parent) {
1170
1171 int ww = QFontMetrics(font()).width('w');
1172 QPushButton* _closeButton = new QPushButton("Close");
1173 _closeButton->setMaximumWidth(10*ww);
1174 connect(_closeButton, SIGNAL(clicked()), this, SLOT(close()));
1175
1176 QGridLayout* dlgLayout = new QGridLayout();
1177 QLabel* img = new QLabel();
1178 img->setPixmap(QPixmap(":bncflowchart.png"));
1179 dlgLayout->addWidget(img, 0,0);
1180 dlgLayout->addWidget(_closeButton,1,0,Qt::AlignLeft);
1181
1182 setLayout(dlgLayout);
1183 show();
1184}
1185
1186//
1187////////////////////////////////////////////////////////////////////////////
1188bncFlowchartDlg::~bncFlowchartDlg() {
1189};
1190
1191// Bnc Text
1192////////////////////////////////////////////////////////////////////////////
1193void bncWindow::bncText(const QString &text){
1194
1195 bool isEmpty = text.isEmpty();
1196
1197 QPalette palette;
1198
1199 // Proxy
1200 //------
1201 if (aogroup->currentIndex() == 0) {
1202 if (!isEmpty) {
1203 palette.setColor(_proxyPortLineEdit->backgroundRole(), Qt::white);
1204 _proxyPortLineEdit->setPalette(palette);
1205 _proxyPortLineEdit->setEnabled(true);
1206 } else {
1207 palette.setColor(_proxyPortLineEdit->backgroundRole(), Qt::lightGray);
1208 _proxyPortLineEdit->setPalette(palette);
1209 _proxyPortLineEdit->setEnabled(false);
1210 }
1211 }
1212
1213 // RINEX Observations
1214 // ------------------
1215 if (aogroup->currentIndex() == 2) {
1216 if (!isEmpty) {
1217 palette.setColor(_rnxIntrComboBox->backgroundRole(), Qt::white);
1218 _rnxIntrComboBox->setPalette(palette);
1219 palette.setColor(_rnxSamplSpinBox->backgroundRole(), Qt::white);
1220 _rnxSamplSpinBox->setPalette(palette);
1221 palette.setColor(_rnxSkelLineEdit->backgroundRole(), Qt::white);
1222 _rnxSkelLineEdit->setPalette(palette);
1223 palette.setColor(_rnxScrpLineEdit->backgroundRole(), Qt::white);
1224 _rnxScrpLineEdit->setPalette(palette);
1225 palette.setColor(_rnxV3CheckBox->backgroundRole(), Qt::white);
1226 _rnxV3CheckBox->setPalette(palette);
1227 _rnxIntrComboBox->setEnabled(true);
1228 _rnxSamplSpinBox->setEnabled(true);
1229 _rnxSkelLineEdit->setEnabled(true);
1230 _rnxScrpLineEdit->setEnabled(true);
1231 _rnxV3CheckBox->setEnabled(true);
1232 } else {
1233 palette.setColor(_rnxIntrComboBox->backgroundRole(), Qt::lightGray);
1234 _rnxIntrComboBox->setPalette(palette);
1235 palette.setColor(_rnxSkelLineEdit->backgroundRole(), Qt::lightGray);
1236 _rnxSkelLineEdit->setPalette(palette);
1237 palette.setColor(_rnxScrpLineEdit->backgroundRole(), Qt::lightGray);
1238 _rnxScrpLineEdit->setPalette(palette);
1239 palette.setColor(_rnxV3CheckBox->backgroundRole(), Qt::lightGray);
1240 _rnxV3CheckBox->setPalette(palette);
1241 palette.setColor(_rnxSamplSpinBox->backgroundRole(), Qt::lightGray);
1242 _rnxSamplSpinBox->setPalette(palette);
1243 _rnxIntrComboBox->setEnabled(false);
1244 _rnxSamplSpinBox->setEnabled(false);
1245 _rnxSkelLineEdit->setEnabled(false);
1246 _rnxScrpLineEdit->setEnabled(false);
1247 _rnxV3CheckBox->setEnabled(false);
1248 }
1249 }
1250
1251 // RINEX Ephemeris
1252 // ---------------
1253 if (aogroup->currentIndex() == 3) {
1254 if (!isEmpty) {
1255 _ephIntrComboBox->setPalette(palette);
1256 palette.setColor(_outEphPortLineEdit->backgroundRole(), Qt::white);
1257 _outEphPortLineEdit->setPalette(palette);
1258 palette.setColor(_ephV3CheckBox->backgroundRole(), Qt::white);
1259 _ephV3CheckBox->setPalette(palette);
1260 _ephIntrComboBox->setEnabled(false);
1261 _ephIntrComboBox->setEnabled(true);
1262 _outEphPortLineEdit->setEnabled(true);
1263 _ephV3CheckBox->setEnabled(true);
1264 } else {
1265 _ephIntrComboBox->setPalette(palette);
1266 palette.setColor(_outEphPortLineEdit->backgroundRole(), Qt::lightGray);
1267 _outEphPortLineEdit->setPalette(palette);
1268 palette.setColor(_ephV3CheckBox->backgroundRole(), Qt::lightGray);
1269 _ephV3CheckBox->setPalette(palette);
1270 _ephIntrComboBox->setEnabled(false);
1271 _ephIntrComboBox->setEnabled(false);
1272 _outEphPortLineEdit->setEnabled(false);
1273 _ephV3CheckBox->setEnabled(false);
1274 }
1275 }
1276
1277 // Ephemeris Corrections
1278 // ---------------------
1279 if (aogroup->currentIndex() == 4) {
1280 if (!isEmpty) {
1281 palette.setColor(_corrIntrComboBox->backgroundRole(), Qt::white);
1282 _corrIntrComboBox->setPalette(palette);
1283 palette.setColor(_corrPortLineEdit->backgroundRole(), Qt::white);
1284 _corrPortLineEdit->setPalette(palette);
1285 palette.setColor(_corrTimeSpinBox->backgroundRole(), Qt::white);
1286 _corrTimeSpinBox->setPalette(palette);
1287 _corrIntrComboBox->setEnabled(true);
1288 _corrPortLineEdit->setEnabled(true);
1289 _corrTimeSpinBox->setEnabled(true);
1290 } else {
1291 palette.setColor(_corrIntrComboBox->backgroundRole(), Qt::lightGray);
1292 _corrIntrComboBox->setPalette(palette);
1293 palette.setColor(_corrPortLineEdit->backgroundRole(), Qt::lightGray);
1294 _corrPortLineEdit->setPalette(palette);
1295 palette.setColor(_corrTimeSpinBox->backgroundRole(), Qt::lightGray);
1296 _corrTimeSpinBox->setPalette(palette);
1297 _corrIntrComboBox->setEnabled(false);
1298 _corrPortLineEdit->setEnabled(false);
1299 _corrTimeSpinBox->setEnabled(false);
1300 }
1301 }
1302
1303 // Feed Engine
1304 // -----------
1305 if (aogroup->currentIndex() == 5) {
1306 if (!isEmpty) {
1307 palette.setColor(_outUPortLineEdit->backgroundRole(), Qt::white);
1308 _outUPortLineEdit->setPalette(palette);
1309 palette.setColor(_outFileLineEdit->backgroundRole(), Qt::white);
1310 _outFileLineEdit->setPalette(palette);
1311 palette.setColor(_waitTimeSpinBox->backgroundRole(), Qt::white);
1312 _waitTimeSpinBox->setPalette(palette);
1313 palette.setColor(_binSamplSpinBox->backgroundRole(), Qt::white);
1314 _binSamplSpinBox->setPalette(palette);
1315 _waitTimeSpinBox->setEnabled(true);
1316 _outUPortLineEdit->setEnabled(true);
1317 _outFileLineEdit->setEnabled(true);
1318 _binSamplSpinBox->setEnabled(true);
1319 } else {
1320 palette.setColor(_outUPortLineEdit->backgroundRole(), Qt::lightGray);
1321 _outUPortLineEdit->setPalette(palette);
1322 palette.setColor(_outFileLineEdit->backgroundRole(), Qt::lightGray);
1323 _outFileLineEdit->setPalette(palette);
1324 palette.setColor(_waitTimeSpinBox->backgroundRole(), Qt::lightGray);
1325 _waitTimeSpinBox->setPalette(palette);
1326 palette.setColor(_binSamplSpinBox->backgroundRole(), Qt::lightGray);
1327 _binSamplSpinBox->setPalette(palette);
1328 _waitTimeSpinBox->setEnabled(false);
1329 _outUPortLineEdit->setEnabled(false);
1330 _outFileLineEdit->setEnabled(false);
1331 _binSamplSpinBox->setEnabled(false);
1332 }
1333 }
1334
1335 // Serial Link
1336 // -----------
1337 if (aogroup->currentIndex() == 6) {
1338 if (!isEmpty) {
1339 palette.setColor(_serialPortNameLineEdit->backgroundRole(), Qt::white);
1340 _serialPortNameLineEdit->setPalette(palette);
1341 palette.setColor(_serialBaudRateComboBox->backgroundRole(), Qt::white);
1342 _serialBaudRateComboBox->setPalette(palette);
1343 palette.setColor(_serialParityComboBox->backgroundRole(), Qt::white);
1344 _serialParityComboBox->setPalette(palette);
1345 palette.setColor(_serialDataBitsComboBox->backgroundRole(), Qt::white);
1346 _serialDataBitsComboBox->setPalette(palette);
1347 palette.setColor(_serialStopBitsComboBox->backgroundRole(), Qt::white);
1348 _serialStopBitsComboBox->setPalette(palette);
1349 palette.setColor(_serialAutoNMEACheckBox->backgroundRole(), Qt::white);
1350 _serialAutoNMEACheckBox->setPalette(palette);
1351 _serialPortNameLineEdit->setEnabled(true);
1352 _serialBaudRateComboBox->setEnabled(true);
1353 _serialParityComboBox->setEnabled(true);
1354 _serialDataBitsComboBox->setEnabled(true);
1355 _serialStopBitsComboBox->setEnabled(true);
1356 _serialAutoNMEACheckBox->setEnabled(true);
1357 } else {
1358 palette.setColor(_serialPortNameLineEdit->backgroundRole(), Qt::lightGray);
1359 _serialPortNameLineEdit->setPalette(palette);
1360 palette.setColor(_serialBaudRateComboBox->backgroundRole(), Qt::lightGray);
1361 _serialBaudRateComboBox->setPalette(palette);
1362 palette.setColor(_serialParityComboBox->backgroundRole(), Qt::lightGray);
1363 _serialParityComboBox->setPalette(palette);
1364 palette.setColor(_serialDataBitsComboBox->backgroundRole(), Qt::lightGray);
1365 _serialDataBitsComboBox->setPalette(palette);
1366 palette.setColor(_serialStopBitsComboBox->backgroundRole(), Qt::lightGray);
1367 _serialStopBitsComboBox->setPalette(palette);
1368 palette.setColor(_serialAutoNMEACheckBox->backgroundRole(), Qt::lightGray);
1369 _serialAutoNMEACheckBox->setPalette(palette);
1370 _serialPortNameLineEdit->setEnabled(false);
1371 _serialBaudRateComboBox->setEnabled(false);
1372 _serialParityComboBox->setEnabled(false);
1373 _serialDataBitsComboBox->setEnabled(false);
1374 _serialStopBitsComboBox->setEnabled(false);
1375 _serialAutoNMEACheckBox->setEnabled(false);
1376 }
1377 }
1378
1379 // Outages
1380 // -------
1381 if (aogroup->currentIndex() == 7) {
1382 if (!isEmpty) {
1383 palette.setColor(_adviseScriptLineEdit->backgroundRole(), Qt::white);
1384 _adviseScriptLineEdit->setPalette(palette);
1385 palette.setColor(_adviseFailSpinBox->backgroundRole(), Qt::white);
1386 _adviseFailSpinBox->setPalette(palette);
1387 palette.setColor(_adviseRecoSpinBox->backgroundRole(), Qt::white);
1388 _adviseRecoSpinBox->setPalette(palette);
1389 palette.setColor(_makePauseCheckBox->backgroundRole(), Qt::white);
1390 _makePauseCheckBox->setPalette(palette);
1391 _adviseFailSpinBox->setEnabled(true);
1392 _adviseRecoSpinBox->setEnabled(true);
1393 _makePauseCheckBox->setEnabled(true);
1394 _adviseScriptLineEdit->setEnabled(true);
1395 } else {
1396 palette.setColor(_adviseScriptLineEdit->backgroundRole(), Qt::lightGray);
1397 _adviseScriptLineEdit->setPalette(palette);
1398 palette.setColor(_adviseFailSpinBox->backgroundRole(), Qt::lightGray);
1399 _adviseFailSpinBox->setPalette(palette);
1400 palette.setColor(_adviseRecoSpinBox->backgroundRole(), Qt::lightGray);
1401 _adviseRecoSpinBox->setPalette(palette);
1402 palette.setColor(_makePauseCheckBox->backgroundRole(), Qt::lightGray);
1403 _makePauseCheckBox->setPalette(palette);
1404 _adviseFailSpinBox->setEnabled(false);
1405 _adviseRecoSpinBox->setEnabled(false);
1406 _makePauseCheckBox->setEnabled(false);
1407 _adviseScriptLineEdit->setEnabled(false);
1408 }
1409 }
1410
1411 // Miscellaneous
1412 // -------------
1413 if (aogroup->currentIndex() == 8) {
1414 if (!isEmpty) {
1415 palette.setColor(_perfIntrComboBox->backgroundRole(), Qt::white);
1416 _perfIntrComboBox->setPalette(palette);
1417 palette.setColor(_scanRTCMCheckBox->backgroundRole(), Qt::white);
1418 _scanRTCMCheckBox->setPalette(palette);
1419 _perfIntrComboBox->setEnabled(true);
1420 _scanRTCMCheckBox->setEnabled(true);
1421 } else {
1422 palette.setColor(_perfIntrComboBox->backgroundRole(), Qt::lightGray);
1423 _perfIntrComboBox->setPalette(palette);
1424 palette.setColor(_scanRTCMCheckBox->backgroundRole(), Qt::lightGray);
1425 _scanRTCMCheckBox->setPalette(palette);
1426 _perfIntrComboBox->setEnabled(false);
1427 _scanRTCMCheckBox->setEnabled(false);
1428 }
1429 }
1430}
1431
Note: See TracBrowser for help on using the repository browser.