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

Last change on this file since 1560 was 1560, checked in by mervart, 15 years ago

* empty log message *

File size: 66.9 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#include "bncsettings.h"
52
53using namespace std;
54
55// Constructor
56////////////////////////////////////////////////////////////////////////////
57bncWindow::bncWindow() {
58
59 _caster = 0;
60
61 int ww = QFontMetrics(this->font()).width('w');
62
63 static const QStringList labels = QString("account, Streams: broadcaster:port/mountpoint,decoder,lat,long,nmea,ntrip,bytes").split(",");
64
65 setMinimumSize(85*ww, 65*ww);
66
67 setWindowTitle(tr("BKG Ntrip Client (BNC) Version 1.7"));
68
69 connect((bncApp*)qApp, SIGNAL(newMessage(QByteArray,bool)),
70 this, SLOT(slotWindowMessage(QByteArray,bool)));
71
72 QPalette palette;
73 QColor lightGray(230, 230, 230);
74
75 // Create Actions
76 // --------------
77 _actHelp = new QAction(tr("&Help Contents"),this);
78 connect(_actHelp, SIGNAL(triggered()), SLOT(slotHelp()));
79
80 _actAbout = new QAction(tr("&About BNC"),this);
81 connect(_actAbout, SIGNAL(triggered()), SLOT(slotAbout()));
82
83 _actFlowchart = new QAction(tr("&Flow Chart"),this);
84 connect(_actFlowchart, SIGNAL(triggered()), SLOT(slotFlowchart()));
85
86 _actFontSel = new QAction(tr("Select &Font"),this);
87 connect(_actFontSel, SIGNAL(triggered()), SLOT(slotFontSel()));
88
89 _actSaveOpt = new QAction(tr("&Save && Activate Options"),this);
90 connect(_actSaveOpt, SIGNAL(triggered()), SLOT(slotSaveOptions()));
91
92 _actQuit = new QAction(tr("&Quit"),this);
93 connect(_actQuit, SIGNAL(triggered()), SLOT(close()));
94
95 _actAddMountPoints = new QAction(tr("Add &Streams"),this);
96 connect(_actAddMountPoints, SIGNAL(triggered()), SLOT(slotAddMountPoints()));
97
98 _actDeleteMountPoints = new QAction(tr("&Delete Streams"),this);
99 connect(_actDeleteMountPoints, SIGNAL(triggered()), SLOT(slotDeleteMountPoints()));
100 _actDeleteMountPoints->setEnabled(false);
101
102 _actGetData = new QAction(tr("Sta&rt"),this);
103 connect(_actGetData, SIGNAL(triggered()), SLOT(slotGetData()));
104
105 _actStop = new QAction(tr("Sto&p"),this);
106 connect(_actStop, SIGNAL(triggered()), SLOT(slotStop()));
107 _actStop->setEnabled(false);
108
109 _actwhatsthis= new QAction(tr("Help=Shift+F1"),this);
110 connect(_actwhatsthis, SIGNAL(triggered()), SLOT(slotWhatsThis()));
111
112 CreateMenu();
113 AddToolbar();
114
115 bncSettings settings;
116 _proxyHostLineEdit = new QLineEdit(settings.value("proxyHost").toString());
117 _proxyPortLineEdit = new QLineEdit(settings.value("proxyPort").toString());
118 _proxyPortLineEdit->setMaximumWidth(9*ww);
119 _miscMountLineEdit = new QLineEdit(settings.value("miscMount").toString());
120 _scanRTCMCheckBox = new QCheckBox();
121 _scanRTCMCheckBox->setCheckState(Qt::CheckState(
122 settings.value("scanRTCM").toInt()));
123 _waitTimeSpinBox = new QSpinBox();
124 _waitTimeSpinBox->setMinimum(1);
125 _waitTimeSpinBox->setMaximum(30);
126 _waitTimeSpinBox->setSingleStep(1);
127 _waitTimeSpinBox->setSuffix(" sec");
128 _waitTimeSpinBox->setMaximumWidth(9*ww);
129 _waitTimeSpinBox->setValue(settings.value("waitTime").toInt());
130 _outFileLineEdit = new QLineEdit(settings.value("outFile").toString());
131 _outPortLineEdit = new QLineEdit(settings.value("outPort").toString());
132 _outPortLineEdit->setMaximumWidth(9*ww);
133 _outUPortLineEdit = new QLineEdit(settings.value("outUPort").toString());
134 _outUPortLineEdit->setMaximumWidth(9*ww);
135 _outEphPortLineEdit = new QLineEdit(settings.value("outEphPort").toString());
136 _outEphPortLineEdit->setMaximumWidth(9*ww);
137 _corrPortLineEdit = new QLineEdit(settings.value("corrPort").toString());
138 _corrPortLineEdit->setMaximumWidth(9*ww);
139 _rnxPathLineEdit = new QLineEdit(settings.value("rnxPath").toString());
140 _ephPathLineEdit = new QLineEdit(settings.value("ephPath").toString());
141 _corrPathLineEdit = new QLineEdit(settings.value("corrPath").toString());
142
143 _rnxV3CheckBox = new QCheckBox();
144 _rnxV3CheckBox->setCheckState(Qt::CheckState(settings.value("rnxV3").toInt()));
145 _ephV3CheckBox = new QCheckBox();
146 _ephV3CheckBox->setCheckState(Qt::CheckState(settings.value("ephV3").toInt()));
147 _rnxScrpLineEdit = new QLineEdit(settings.value("rnxScript").toString());
148 _rnxSkelLineEdit = new QLineEdit(settings.value("rnxSkel").toString());
149 _rnxSkelLineEdit->setMaximumWidth(5*ww);
150 _rnxAppendCheckBox = new QCheckBox();
151 _rnxAppendCheckBox->setCheckState(Qt::CheckState(
152 settings.value("rnxAppend").toInt()));
153 _autoStartCheckBox = new QCheckBox();
154 _autoStartCheckBox->setCheckState(Qt::CheckState(
155 settings.value("autoStart").toInt()));
156 _rnxIntrComboBox = new QComboBox();
157 _rnxIntrComboBox->setMaximumWidth(9*ww);
158 _rnxIntrComboBox->setEditable(false);
159 _rnxIntrComboBox->addItems(QString("1 min,2 min,5 min,10 min,15 min,30 min,1 hour,1 day").split(","));
160 int ii = _rnxIntrComboBox->findText(settings.value("rnxIntr").toString());
161 if (ii != -1) {
162 _rnxIntrComboBox->setCurrentIndex(ii);
163 }
164 _onTheFlyComboBox = new QComboBox();
165 _onTheFlyComboBox->setMaximumWidth(9*ww);
166 _onTheFlyComboBox->setEditable(false);
167 _onTheFlyComboBox->addItems(QString("1 day,1 hour,1 min").split(","));
168 ii = _onTheFlyComboBox->findText(settings.value("onTheFlyInterval").toString());
169 if (ii != -1) {
170 _onTheFlyComboBox->setCurrentIndex(ii);
171 }
172 _ephIntrComboBox = new QComboBox();
173 _ephIntrComboBox->setMaximumWidth(9*ww);
174 _ephIntrComboBox->setEditable(false);
175 _ephIntrComboBox->addItems(QString("1 min,2 min,5 min,10 min,15 min,30 min,1 hour,1 day").split(","));
176 int jj = _ephIntrComboBox->findText(settings.value("ephIntr").toString());
177 if (jj != -1) {
178 _ephIntrComboBox->setCurrentIndex(jj);
179 }
180 _corrIntrComboBox = new QComboBox();
181 _corrIntrComboBox->setMaximumWidth(9*ww);
182 _corrIntrComboBox->setEditable(false);
183 _corrIntrComboBox->addItems(QString("1 min,2 min,5 min,10 min,15 min,30 min,1 hour,1 day").split(","));
184 int mm = _corrIntrComboBox->findText(settings.value("corrIntr").toString());
185 if (mm != -1) {
186 _corrIntrComboBox->setCurrentIndex(mm);
187 }
188 _corrTimeSpinBox = new QSpinBox();
189 _corrTimeSpinBox->setMinimum(1);
190 _corrTimeSpinBox->setMaximum(30);
191 _corrTimeSpinBox->setSingleStep(1);
192 _corrTimeSpinBox->setSuffix(" sec");
193 _corrTimeSpinBox->setMaximumWidth(9*ww);
194 _corrTimeSpinBox->setValue(settings.value("corrTime").toInt());
195 _rnxSamplSpinBox = new QSpinBox();
196 _rnxSamplSpinBox->setMinimum(0);
197 _rnxSamplSpinBox->setMaximum(60);
198 _rnxSamplSpinBox->setSingleStep(5);
199 _rnxSamplSpinBox->setMaximumWidth(9*ww);
200 _rnxSamplSpinBox->setValue(settings.value("rnxSampl").toInt());
201 _rnxSamplSpinBox->setSuffix(" sec");
202
203 _binSamplSpinBox = new QSpinBox();
204 _binSamplSpinBox->setMinimum(0);
205 _binSamplSpinBox->setMaximum(60);
206 _binSamplSpinBox->setSingleStep(5);
207 _binSamplSpinBox->setMaximumWidth(9*ww);
208 _binSamplSpinBox->setValue(settings.value("binSampl").toInt());
209 _binSamplSpinBox->setSuffix(" sec");
210
211 _obsRateComboBox = new QComboBox();
212 _obsRateComboBox->setMaximumWidth(9*ww);
213 _obsRateComboBox->setEditable(false);
214 _obsRateComboBox->addItems(QString(",0.1 Hz,0.2 Hz,0.5 Hz,1 Hz,5 Hz").split(","));
215 int kk = _obsRateComboBox->findText(settings.value("obsRate").toString());
216 if (kk != -1) {
217 _obsRateComboBox->setCurrentIndex(kk);
218 }
219 _makePauseCheckBox = new QCheckBox();
220 _makePauseCheckBox->setCheckState(Qt::CheckState(
221 settings.value("makePause").toInt()));
222 _adviseRecoSpinBox = new QSpinBox();
223 _adviseRecoSpinBox->setMinimum(0);
224 _adviseRecoSpinBox->setMaximum(60);
225 _adviseRecoSpinBox->setSingleStep(1);
226 _adviseRecoSpinBox->setSuffix(" min");
227 _adviseRecoSpinBox->setMaximumWidth(9*ww);
228 _adviseRecoSpinBox->setValue(settings.value("adviseReco").toInt());
229 _adviseFailSpinBox = new QSpinBox();
230 _adviseFailSpinBox->setMinimum(0);
231 _adviseFailSpinBox->setMaximum(60);
232 _adviseFailSpinBox->setSingleStep(1);
233 _adviseFailSpinBox->setSuffix(" min");
234 _adviseFailSpinBox->setMaximumWidth(9*ww);
235 _adviseFailSpinBox->setValue(settings.value("adviseFail").toInt());
236 _logFileLineEdit = new QLineEdit(settings.value("logFile").toString());
237 _adviseScriptLineEdit = new QLineEdit(settings.value("adviseScript").toString());
238
239 _serialPortNameLineEdit = new QLineEdit(settings.value("serialPortName").toString());
240 _serialMountPointLineEdit = new QLineEdit(settings.value("serialMountPoint").toString());
241
242
243 _serialBaudRateComboBox = new QComboBox();
244 _serialBaudRateComboBox->setMaximumWidth(9*ww);
245 _serialBaudRateComboBox->addItems(QString("110,300,600,"
246 "1200,2400,4800,9600,19200,38400,57600,115200").split(","));
247 kk = _serialBaudRateComboBox->findText(settings.value("serialBaudRate").toString());
248 if (kk != -1) {
249 _serialBaudRateComboBox->setCurrentIndex(kk);
250 }
251 _serialParityComboBox = new QComboBox();
252 _serialParityComboBox->setMaximumWidth(9*ww);
253 _serialParityComboBox->addItems(QString("NONE,ODD,EVEN,SPACE").split(","));
254 kk = _serialParityComboBox->findText(settings.value("serialParity").toString());
255 if (kk != -1) {
256 _serialParityComboBox->setCurrentIndex(kk);
257 }
258 _serialDataBitsComboBox = new QComboBox();
259 _serialDataBitsComboBox->setMaximumWidth(5*ww);
260 _serialDataBitsComboBox->addItems(QString("5,6,7,8").split(","));
261 kk = _serialDataBitsComboBox->findText(settings.value("serialDataBits").toString());
262 if (kk != -1) {
263 _serialDataBitsComboBox->setCurrentIndex(kk);
264 }
265 _serialStopBitsComboBox = new QComboBox();
266 _serialStopBitsComboBox->setMaximumWidth(5*ww);
267 _serialStopBitsComboBox->addItems(QString("1,2").split(","));
268 kk = _serialStopBitsComboBox->findText(settings.value("serialStopBits").toString());
269 if (kk != -1) {
270 _serialStopBitsComboBox->setCurrentIndex(kk);
271 }
272 _serialAutoNMEACheckBox = new QCheckBox();
273 _serialAutoNMEACheckBox->setCheckState(Qt::CheckState(
274 settings.value("serialAutoNMEA").toInt()));
275
276 _perfIntrComboBox = new QComboBox();
277 _perfIntrComboBox->setMaximumWidth(9*ww);
278 _perfIntrComboBox->setEditable(false);
279 _perfIntrComboBox->addItems(QString(",2 sec, 10 sec,1 min,5 min,15 min,1 hour,6 hours,1 day").split(","));
280 int ll = _perfIntrComboBox->findText(settings.value("perfIntr").toString());
281 if (ll != -1) {
282 _perfIntrComboBox->setCurrentIndex(ll);
283 }
284
285 _mountPointsTable = new QTableWidget(0,8);
286
287 _mountPointsTable->horizontalHeader()->resizeSection(1,34*ww);
288 _mountPointsTable->horizontalHeader()->resizeSection(2,9*ww);
289 _mountPointsTable->horizontalHeader()->resizeSection(3,7*ww);
290 _mountPointsTable->horizontalHeader()->resizeSection(4,7*ww);
291 _mountPointsTable->horizontalHeader()->resizeSection(5,5*ww);
292 _mountPointsTable->horizontalHeader()->resizeSection(6,4*ww);
293 _mountPointsTable->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
294 _mountPointsTable->horizontalHeader()->setStretchLastSection(true);
295 _mountPointsTable->setHorizontalHeaderLabels(labels);
296 _mountPointsTable->setGridStyle(Qt::NoPen);
297 _mountPointsTable->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
298 _mountPointsTable->setSelectionMode(QAbstractItemView::ExtendedSelection);
299 _mountPointsTable->setSelectionBehavior(QAbstractItemView::SelectRows);
300 _mountPointsTable->hideColumn(0);
301 connect(_mountPointsTable, SIGNAL(itemSelectionChanged()),
302 SLOT(slotSelectionChanged()));
303 populateMountPointsTable();
304
305 _log = new QTextBrowser();
306 _log->setReadOnly(true);
307
308 // WhatsThis
309 // ---------
310 _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>"));
311 _proxyPortLineEdit->setWhatsThis(tr("<p>Enter your proxy server port number in case a proxy is operated in front of BNC.</p>"));
312 _waitTimeSpinBox->setWhatsThis(tr("<p>When feeding a real-time GNSS network 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 network engine or products.</p>"));
313 _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."));
314 _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."));
315 _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."));
316 _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."));
317 _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."));
318 _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."));
319 _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."));
320 _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."));
321 _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."));
322 _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>"));
323 _rnxSkelLineEdit->setWhatsThis(tr("<p>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.</p><p>A file in the RINEX Observations 'Directory' with a 'Skeleton extension' suffix is interpreted by BNC as a personal RINEX header skeleton file for the corresponding stream.</p>"));
324 _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>"));
325 _autoStartCheckBox->setWhatsThis(tr("<p>Tick 'Auto start' for auto-start of BNC at startup time in window mode with preassigned processing options.</p>"));
326 _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>"));
327 _rnxIntrComboBox->setWhatsThis(tr("<p>Select the length of the RINEX Observation file.</p>"));
328 _ephIntrComboBox->setWhatsThis(tr("<p>Select the length of the RINEX Navigation file.</p>"));
329 _corrIntrComboBox->setWhatsThis(tr("<p>Select the length of the Broadcast Ephemeris Correction files.</p>"));
330 _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>"));
331 _binSamplSpinBox->setWhatsThis(tr("<p>Select the synchronized observation sampling interval in seconds. A value of zero '0' tells BNC to send/store all received epochs.</p>"));
332 _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>"));
333 _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>"));
334 _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>"));
335 _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>"));
336 _logFileLineEdit->setWhatsThis(tr("<p>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.</p><p>The logfile name will automatically be extended by a string '_YYMMDD' carrying the current date."));
337 _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>"));
338 _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>"));
339 _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>"));
340 _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."));
341 _ephV3CheckBox->setWhatsThis(tr("The default format for output of RINEX Navigation data containing Broadcast Ephemeris is RINEX Version 2.11. Select 'Version 3' if you want to output the ephemeris in RINEX Version 3 format."));
342 _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."));
343 _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>"));
344 _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>"));
345 _serialMountPointLineEdit->setWhatsThis(tr("<p>Enter a 'Mountpoint' to forward the corresponding stream to a serial connected device.</p>"));
346 _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>"));
347 _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>"));
348 _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>"));
349 _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>"));
350 _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>"));
351 _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>"));
352
353 // Canvas with Editable Fields
354 // ---------------------------
355 _canvas = new QWidget;
356 setCentralWidget(_canvas);
357
358//QTabWidget* aogroup = new QTabWidget();
359 aogroup = new QTabWidget();
360 QWidget* pgroup = new QWidget();
361 QWidget* ggroup = new QWidget();
362 QWidget* sgroup = new QWidget();
363 QWidget* egroup = new QWidget();
364 QWidget* agroup = new QWidget();
365 QWidget* cgroup = new QWidget();
366 QWidget* ogroup = new QWidget();
367 QWidget* rgroup = new QWidget();
368 QWidget* sergroup = new QWidget();
369 aogroup->addTab(pgroup,tr("Proxy"));
370 aogroup->addTab(ggroup,tr("General"));
371 aogroup->addTab(ogroup,tr("RINEX Observations"));
372 aogroup->addTab(egroup,tr("RINEX Ephemeris"));
373 aogroup->addTab(cgroup,tr("Ephemeris Corrections"));
374 aogroup->addTab(sgroup,tr("Feed Engine"));
375 aogroup->addTab(sergroup,tr("Serial Link"));
376 aogroup->addTab(agroup,tr("Outages"));
377 aogroup->addTab(rgroup,tr("Miscellaneous"));
378
379 // Proxy
380 // ----
381 QGridLayout* pLayout = new QGridLayout;
382 pLayout->setColumnMinimumWidth(0,13*ww);
383 pLayout->addWidget(new QLabel("Proxy host"), 0, 0);
384 pLayout->addWidget(_proxyHostLineEdit, 0, 1, 1,10);
385 pLayout->addWidget(new QLabel("Proxy port"), 1, 0);
386 pLayout->addWidget(_proxyPortLineEdit, 1, 1);
387 pLayout->addWidget(new QLabel("Settings for the proxy in protected networks, leave boxes blank if none."),2, 0, 1, 50, Qt::AlignLeft);
388 pLayout->addWidget(new QLabel(" "),3,0);
389 pLayout->addWidget(new QLabel(" "),4,0);
390 pLayout->addWidget(new QLabel(" "),5,0);
391 pgroup->setLayout(pLayout);
392
393
394 connect(_proxyHostLineEdit, SIGNAL(textChanged(const QString &)),
395 this, SLOT(bncText(const QString &)));
396 if (_proxyHostLineEdit->text().isEmpty()) {
397 _proxyPortLineEdit->setStyleSheet("background-color: lightGray");
398 _proxyPortLineEdit->setEnabled(false);
399 }
400
401 // General
402 // -------
403 QGridLayout* gLayout = new QGridLayout;
404 gLayout->setColumnMinimumWidth(0,14*ww);
405 gLayout->addWidget(new QLabel("Logfile (full path)"), 0, 0);
406 gLayout->addWidget(_logFileLineEdit, 0, 1);
407 gLayout->addWidget(new QLabel("Append files"), 1, 0);
408 gLayout->addWidget(_rnxAppendCheckBox, 1, 1);
409 gLayout->addWidget(new QLabel("Reread configuration"), 2, 0);
410 gLayout->addWidget(_onTheFlyComboBox, 2, 1);
411 gLayout->addWidget(new QLabel("Auto start"), 3, 0);
412 gLayout->addWidget(_autoStartCheckBox, 3, 1);
413 gLayout->addWidget(new QLabel("General settings for logfile, file handling, configuration on-the-fly, and auto-start."),4, 0, 1, 2, Qt::AlignLeft);
414 gLayout->addWidget(new QLabel(" "),5,0);
415 ggroup->setLayout(gLayout);
416
417 // Feed Engine
418 // -----------
419 QGridLayout* sLayout = new QGridLayout;
420 sLayout->setColumnMinimumWidth(0,14*ww);
421 sLayout->addWidget(new QLabel("Port"), 0, 0);
422 sLayout->addWidget(_outPortLineEdit, 0, 1);
423 sLayout->addWidget(new QLabel("Wait for full epoch"), 0, 2, Qt::AlignRight);
424 sLayout->addWidget(_waitTimeSpinBox, 0, 3, Qt::AlignLeft);
425 sLayout->addWidget(new QLabel("Sampling"), 1, 0);
426 sLayout->addWidget(_binSamplSpinBox, 1, 1, Qt::AlignLeft);
427 sLayout->addWidget(new QLabel("File (full path)"), 2, 0);
428 sLayout->addWidget(_outFileLineEdit, 2, 1, 1, 30);
429 sLayout->addWidget(new QLabel("Port (unsynchronized)"), 3, 0);
430 sLayout->addWidget(_outUPortLineEdit, 3, 1);
431 sLayout->addWidget(new QLabel("Output decoded observations in a binary format to feed a real-time GNSS engine."),4,0,1,30);
432 sLayout->addWidget(new QLabel(" "),5,0);
433 sgroup->setLayout(sLayout);
434
435 connect(_outPortLineEdit, SIGNAL(textChanged(const QString &)),
436 this, SLOT(bncText(const QString &)));
437 connect(_outFileLineEdit, SIGNAL(textChanged(const QString &)),
438 this, SLOT(bncText(const QString &)));
439 if (_outPortLineEdit->text().isEmpty() && _outFileLineEdit->text().isEmpty()) {
440 _waitTimeSpinBox->setStyleSheet("background-color: lightGray");
441 _binSamplSpinBox->setStyleSheet("background-color: lightGray");
442 _waitTimeSpinBox->setEnabled(false);
443 _binSamplSpinBox->setEnabled(false);
444 }
445
446 // RINEX Ephemeris
447 // ---------------
448 QGridLayout* eLayout = new QGridLayout;
449 eLayout->setColumnMinimumWidth(0,14*ww);
450 eLayout->addWidget(new QLabel("Directory"), 0, 0);
451 eLayout->addWidget(_ephPathLineEdit, 0, 1);
452 eLayout->addWidget(new QLabel("Interval"), 1, 0);
453 eLayout->addWidget(_ephIntrComboBox, 1, 1);
454 eLayout->addWidget(new QLabel("Port"), 2, 0);
455 eLayout->addWidget(_outEphPortLineEdit, 2, 1);
456 eLayout->addWidget(new QLabel("Version 3"), 3, 0);
457 eLayout->addWidget(_ephV3CheckBox, 3, 1);
458 eLayout->addWidget(new QLabel("Saving RINEX ephemeris files and ephemeris output through IP port."),4,0,1,2,Qt::AlignLeft);
459 eLayout->addWidget(new QLabel(" "),5,0);
460 egroup->setLayout(eLayout);
461
462 connect(_ephPathLineEdit, SIGNAL(textChanged(const QString &)),
463 this, SLOT(bncText(const QString &)));
464 connect(_outEphPortLineEdit, SIGNAL(textChanged(const QString &)),
465 this, SLOT(bncText(const QString &)));
466
467 if (_ephPathLineEdit->text().isEmpty() && _outEphPortLineEdit->text().isEmpty()) {
468 _ephIntrComboBox->setStyleSheet("background-color: lightGray");
469 palette.setColor(_ephV3CheckBox->backgroundRole(), lightGray);
470 _ephV3CheckBox->setPalette(palette);
471 _ephIntrComboBox->setEnabled(false);
472 _ephV3CheckBox->setEnabled(false);
473 }
474 if (_ephPathLineEdit->text().isEmpty() && !_outEphPortLineEdit->text().isEmpty()) {
475 _ephIntrComboBox->setStyleSheet("background-color: lightGray");
476 _ephIntrComboBox->setEnabled(false);
477 }
478
479 // Outages
480 // -------
481 QGridLayout* aLayout = new QGridLayout;
482 aLayout->setColumnMinimumWidth(0,14*ww);
483 aLayout->addWidget(new QLabel("Observation rate"), 0, 0);
484 aLayout->addWidget(_obsRateComboBox, 0, 1);
485 aLayout->addWidget(new QLabel("Failure threshold"), 1, 0);
486 aLayout->addWidget(_adviseFailSpinBox, 1, 1);
487 aLayout->addWidget(new QLabel("Recovery threshold"), 2, 0);
488 aLayout->addWidget(_adviseRecoSpinBox, 2, 1);
489 aLayout->addWidget(new QLabel("Pause"), 2, 2, Qt::AlignRight);
490 aLayout->addWidget(_makePauseCheckBox, 2, 3, Qt::AlignLeft);
491 aLayout->addWidget(new QLabel("Script (full path)"), 3, 0);
492 aLayout->addWidget(_adviseScriptLineEdit, 3, 1,1,10);
493 aLayout->addWidget(new QLabel("Outage report, handling of corrupted streams."),5,0,1,10,Qt::AlignLeft);
494 agroup->setLayout(aLayout);
495
496 connect(_obsRateComboBox, SIGNAL(currentIndexChanged(const QString &)),
497 this, SLOT(bncText(const QString)));
498 if (_obsRateComboBox->currentText().isEmpty()) {
499 _adviseFailSpinBox->setStyleSheet("background-color: lightGray");
500 _adviseRecoSpinBox->setStyleSheet("background-color: lightGray");
501 palette.setColor(_makePauseCheckBox->backgroundRole(), lightGray);
502 _makePauseCheckBox->setPalette(palette);
503 _adviseScriptLineEdit->setStyleSheet("background-color: lightGray");
504 _adviseFailSpinBox->setEnabled(false);
505 _adviseRecoSpinBox->setEnabled(false);
506 _makePauseCheckBox->setEnabled(false);
507 _adviseScriptLineEdit->setEnabled(false);
508 }
509
510 // Miscellaneous
511 // -------------
512 QGridLayout* rLayout = new QGridLayout;
513 rLayout->setColumnMinimumWidth(0,14*ww);
514 rLayout->addWidget(new QLabel("Mountpoint"), 0, 0);
515 rLayout->addWidget(_miscMountLineEdit, 0, 1, 1,7);
516 rLayout->addWidget(new QLabel("Log latency"), 1, 0);
517 rLayout->addWidget(_perfIntrComboBox, 1, 1);
518 rLayout->addWidget(new QLabel("Scan RTCM"), 2, 0);
519 rLayout->addWidget(_scanRTCMCheckBox, 2, 1);
520 rLayout->addWidget(new QLabel("Log latencies or scan RTCM streams for numbers of message types and antenna information."),3, 0,1,30);
521 rLayout->addWidget(new QLabel(" "), 4, 0);
522 rLayout->addWidget(new QLabel(" "), 5, 0);
523 rgroup->setLayout(rLayout);
524
525 connect(_miscMountLineEdit, SIGNAL(textChanged(const QString &)),
526 this, SLOT(bncText(const QString &)));
527 if (_miscMountLineEdit->text().isEmpty()) {
528 _perfIntrComboBox->setStyleSheet("background-color: lightGray");
529 palette.setColor(_scanRTCMCheckBox->backgroundRole(), lightGray);
530 _scanRTCMCheckBox->setPalette(palette);
531 _perfIntrComboBox->setEnabled(false);
532 _scanRTCMCheckBox->setEnabled(false);
533 }
534
535 // RINEX Observations
536 // ------------------
537 QGridLayout* oLayout = new QGridLayout;
538 oLayout->setColumnMinimumWidth(0,14*ww);
539 oLayout->addWidget(new QLabel("Directory"), 0, 0);
540 oLayout->addWidget(_rnxPathLineEdit, 0, 1,1,12);
541 oLayout->addWidget(new QLabel("Interval"), 1, 0);
542 oLayout->addWidget(_rnxIntrComboBox, 1, 1);
543 oLayout->addWidget(new QLabel("Sampling"), 1, 2, Qt::AlignRight);
544 oLayout->addWidget(_rnxSamplSpinBox, 1, 3, Qt::AlignLeft);
545 oLayout->addWidget(new QLabel("Skeleton extension"), 2, 0);
546 oLayout->addWidget(_rnxSkelLineEdit, 2, 1,1,1, Qt::AlignLeft);
547 oLayout->addWidget(new QLabel("Script (full path)"), 3, 0);
548 oLayout->addWidget(_rnxScrpLineEdit, 3, 1,1,12);
549 oLayout->addWidget(new QLabel("Version 3"), 4, 0);
550 oLayout->addWidget(_rnxV3CheckBox, 4, 1);
551 oLayout->addWidget(new QLabel("Saving RINEX observation files."),5,0,1,12, Qt::AlignLeft);
552 ogroup->setLayout(oLayout);
553
554 connect(_rnxPathLineEdit, SIGNAL(textChanged(const QString &)),
555 this, SLOT(bncText(const QString &)));
556 if (_rnxPathLineEdit->text().isEmpty()) {
557 _rnxIntrComboBox->setStyleSheet("background-color: lightGray");
558 _rnxSamplSpinBox->setStyleSheet("background-color: lightGray");
559 _rnxSkelLineEdit->setStyleSheet("background-color: lightGray");
560 _rnxScrpLineEdit->setStyleSheet("background-color: lightGray");
561 palette.setColor(_rnxV3CheckBox->backgroundRole(), lightGray);
562 _rnxV3CheckBox->setPalette(palette);
563 _rnxIntrComboBox->setEnabled(false);
564 _rnxSamplSpinBox->setEnabled(false);
565 _rnxSkelLineEdit->setEnabled(false);
566 _rnxScrpLineEdit->setEnabled(false);
567 _rnxV3CheckBox->setEnabled(false);
568 }
569
570 // Ephemeris Corrections
571 // ---------------------
572 QGridLayout* cLayout = new QGridLayout;
573 cLayout->setColumnMinimumWidth(0,14*ww);
574 cLayout->addWidget(new QLabel("Directory"), 0, 0);
575 cLayout->addWidget(_corrPathLineEdit, 0, 1,1,30);
576 cLayout->addWidget(new QLabel("Interval"), 1, 0);
577 cLayout->addWidget(_corrIntrComboBox, 1, 1);
578 cLayout->addWidget(new QLabel("Port"), 2, 0);
579 cLayout->addWidget(_corrPortLineEdit, 2, 1);
580 cLayout->addWidget(new QLabel("Wait for full epoch"), 2, 2, Qt::AlignRight);
581 cLayout->addWidget(_corrTimeSpinBox, 2, 3, Qt::AlignLeft);
582 cLayout->addWidget(new QLabel("Saving Broadcast Ephemeris correction files and correction output through IP port."),3,0,1,30);
583 cLayout->addWidget(new QLabel(" "),4,0);
584 cLayout->addWidget(new QLabel(" "),5,0);
585 cgroup->setLayout(cLayout);
586
587 connect(_corrPathLineEdit, SIGNAL(textChanged(const QString &)),
588 this, SLOT(bncText(const QString &)));
589 connect(_corrPortLineEdit, SIGNAL(textChanged(const QString &)),
590 this, SLOT(bncText(const QString &)));
591 if (_corrPathLineEdit->text().isEmpty()) {
592 _corrIntrComboBox->setStyleSheet("background-color: lightGray");
593 _corrIntrComboBox->setEnabled(false);
594 }
595 if (_corrPortLineEdit->text().isEmpty()) {
596 _corrTimeSpinBox->setStyleSheet("background-color: lightGray");
597 _corrTimeSpinBox->setEnabled(false);
598 }
599
600 // Serial Link
601 // -----------
602 QGridLayout* serLayout = new QGridLayout;
603 serLayout->setColumnMinimumWidth(0,14*ww);
604 serLayout->addWidget(new QLabel("Mountpoint"), 0,0, Qt::AlignLeft);
605 serLayout->addWidget(_serialMountPointLineEdit, 0,1,1,2);
606 serLayout->addWidget(new QLabel("Port name"), 1,0, Qt::AlignLeft);
607 serLayout->addWidget(_serialPortNameLineEdit, 1,1,1,2);
608 serLayout->addWidget(new QLabel("Baud rate"), 2,0, Qt::AlignLeft);
609 serLayout->addWidget(_serialBaudRateComboBox, 2,1);
610 serLayout->addWidget(new QLabel(" Parity "), 2,2, Qt::AlignRight);
611 serLayout->addWidget(_serialParityComboBox, 2,3);
612 serLayout->addWidget(new QLabel("Data bits"), 3,0, Qt::AlignLeft);
613 serLayout->addWidget(_serialDataBitsComboBox, 3,1);
614 serLayout->addWidget(new QLabel(" Stop bits "), 3,2, Qt::AlignRight);
615 serLayout->addWidget(_serialStopBitsComboBox, 3,3);
616 serLayout->addWidget(new QLabel("Auto NMEA"), 4, 0);
617 serLayout->addWidget(_serialAutoNMEACheckBox, 4, 1);
618 serLayout->addWidget(new QLabel("Serial port settings to feed a serial connected device."),5,0,1,30);
619
620 connect(_serialMountPointLineEdit, SIGNAL(textChanged(const QString &)),
621 this, SLOT(bncText(const QString &)));
622 if (_serialMountPointLineEdit->text().isEmpty()) {
623 _serialPortNameLineEdit->setStyleSheet("background-color: lightGray");
624 _serialBaudRateComboBox->setStyleSheet("background-color: lightGray");
625 _serialParityComboBox->setStyleSheet("background-color: lightGray");
626 _serialDataBitsComboBox->setStyleSheet("background-color: lightGray");
627 _serialStopBitsComboBox->setStyleSheet("background-color: lightGray");
628 palette.setColor(_serialAutoNMEACheckBox->backgroundRole(), lightGray);
629 _serialAutoNMEACheckBox->setPalette(palette);
630 _serialPortNameLineEdit->setEnabled(false);
631 _serialBaudRateComboBox->setEnabled(false);
632 _serialParityComboBox->setEnabled(false);
633 _serialDataBitsComboBox->setEnabled(false);
634 _serialStopBitsComboBox->setEnabled(false);
635 _serialAutoNMEACheckBox->setEnabled(false);
636 }
637
638 sergroup->setLayout(serLayout);
639
640 QGridLayout* mLayout = new QGridLayout;
641 aogroup->setCurrentIndex(settings.value("startTab").toInt());
642 mLayout->addWidget(aogroup, 0,0);
643 mLayout->addWidget(_mountPointsTable, 1,0);
644 mLayout->addWidget(new QLabel(" Logs:"),2,0);
645 mLayout->addWidget(_log, 3,0);
646
647 _canvas->setLayout(mLayout);
648
649 // Auto start
650 // ----------
651 if ( Qt::CheckState(settings.value("autoStart").toInt()) == Qt::Checked) {
652 slotGetData();
653 }
654}
655
656// Destructor
657////////////////////////////////////////////////////////////////////////////
658bncWindow::~bncWindow() {
659 delete _caster;
660}
661
662//
663////////////////////////////////////////////////////////////////////////////
664void bncWindow::populateMountPointsTable() {
665
666 for (int iRow = _mountPointsTable->rowCount()-1; iRow >=0; iRow--) {
667 _mountPointsTable->removeRow(iRow);
668 }
669
670 bncSettings settings;
671
672 QListIterator<QString> it(settings.value("mountPoints").toStringList());
673 if (!it.hasNext()) {
674 _actGetData->setEnabled(false);
675 }
676 int iRow = 0;
677 while (it.hasNext()) {
678 QStringList hlp = it.next().split(" ");
679 if (hlp.size() < 5) continue;
680 _mountPointsTable->insertRow(iRow);
681
682 QUrl url(hlp[0]);
683
684 QString fullPath = url.host() + QString(":%1").arg(url.port()) + url.path();
685 QString format(hlp[1]); QString latitude(hlp[2]); QString longitude(hlp[3]);
686 QString nmea(hlp[4]);
687 QString ntripVersion = "1";
688 if (hlp.size() >= 6) {
689 ntripVersion = (hlp[5]);
690 }
691
692 QTableWidgetItem* it;
693 it = new QTableWidgetItem(url.userInfo());
694 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
695 _mountPointsTable->setItem(iRow, 0, it);
696
697 it = new QTableWidgetItem(fullPath);
698 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
699 _mountPointsTable->setItem(iRow, 1, it);
700
701 it = new QTableWidgetItem(format);
702 _mountPointsTable->setItem(iRow, 2, it);
703
704 if (nmea == "yes") {
705 it = new QTableWidgetItem(latitude);
706 _mountPointsTable->setItem(iRow, 3, it);
707 it = new QTableWidgetItem(longitude);
708 _mountPointsTable->setItem(iRow, 4, it);
709 } else {
710 it = new QTableWidgetItem(latitude);
711 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
712 _mountPointsTable->setItem(iRow, 3, it);
713 it = new QTableWidgetItem(longitude);
714 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
715 _mountPointsTable->setItem(iRow, 4, it);
716 }
717
718 it = new QTableWidgetItem(nmea);
719 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
720 _mountPointsTable->setItem(iRow, 5, it);
721
722 it = new QTableWidgetItem(ntripVersion);
723 //// it->setFlags(it->flags() & ~Qt::ItemIsEditable);
724 _mountPointsTable->setItem(iRow, 6, it);
725
726 bncTableItem* bncIt = new bncTableItem();
727 bncIt->setFlags(bncIt->flags() & ~Qt::ItemIsEditable);
728 _mountPointsTable->setItem(iRow, 7, bncIt);
729
730 iRow++;
731 }
732
733 _mountPointsTable->sortItems(1);
734}
735
736// Retrieve Table
737////////////////////////////////////////////////////////////////////////////
738void bncWindow::slotAddMountPoints() {
739
740 bncSettings settings;
741 QString proxyHost = settings.value("proxyHost").toString();
742 int proxyPort = settings.value("proxyPort").toInt();
743 if (proxyHost != _proxyHostLineEdit->text() ||
744 proxyPort != _proxyPortLineEdit->text().toInt()) {
745 int iRet = QMessageBox::question(this, "Question", "Proxy options "
746 "changed. Use the new ones?",
747 QMessageBox::Yes, QMessageBox::No,
748 QMessageBox::NoButton);
749 if (iRet == QMessageBox::Yes) {
750 settings.setValue("proxyHost", _proxyHostLineEdit->text());
751 settings.setValue("proxyPort", _proxyPortLineEdit->text());
752 settings.sync();
753 }
754 }
755
756 bncTableDlg* dlg = new bncTableDlg(this);
757 dlg->move(this->pos().x()+50, this->pos().y()+50);
758 connect(dlg, SIGNAL(newMountPoints(QStringList*)),
759 this, SLOT(slotNewMountPoints(QStringList*)));
760 dlg->exec();
761 delete dlg;
762
763}
764
765// Delete Selected Mount Points
766////////////////////////////////////////////////////////////////////////////
767void bncWindow::slotDeleteMountPoints() {
768
769 int nRows = _mountPointsTable->rowCount();
770 bool flg[nRows];
771 for (int iRow = 0; iRow < nRows; iRow++) {
772 if (_mountPointsTable->isItemSelected(_mountPointsTable->item(iRow,1))) {
773 flg[iRow] = true;
774 }
775 else {
776 flg[iRow] = false;
777 }
778 }
779 for (int iRow = nRows-1; iRow >= 0; iRow--) {
780 if (flg[iRow]) {
781 _mountPointsTable->removeRow(iRow);
782 }
783 }
784 _actDeleteMountPoints->setEnabled(false);
785
786 if (_mountPointsTable->rowCount() == 0) {
787 _actGetData->setEnabled(false);
788 }
789}
790
791// New Mount Points Selected
792////////////////////////////////////////////////////////////////////////////
793void bncWindow::slotNewMountPoints(QStringList* mountPoints) {
794 int iRow = 0;
795 QListIterator<QString> it(*mountPoints);
796 while (it.hasNext()) {
797 QStringList hlp = it.next().split(" ");
798 QUrl url(hlp[0]);
799 QString fullPath = url.host() + QString(":%1").arg(url.port()) + url.path();
800 QString format(hlp[1]); QString latitude(hlp[2]); QString longitude(hlp[3]);
801 QString nmea(hlp[4]);
802 QString ntripVersion = "1";
803 if (hlp.size() >= 6) {
804 ntripVersion = (hlp[5]);
805 }
806
807 _mountPointsTable->insertRow(iRow);
808
809 QTableWidgetItem* it;
810 it = new QTableWidgetItem(url.userInfo());
811 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
812 _mountPointsTable->setItem(iRow, 0, it);
813
814 it = new QTableWidgetItem(fullPath);
815 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
816 _mountPointsTable->setItem(iRow, 1, it);
817
818 it = new QTableWidgetItem(format);
819 _mountPointsTable->setItem(iRow, 2, it);
820
821 if (nmea == "yes") {
822 it = new QTableWidgetItem(latitude);
823 _mountPointsTable->setItem(iRow, 3, it);
824 it = new QTableWidgetItem(longitude);
825 _mountPointsTable->setItem(iRow, 4, it);
826 } else {
827 it = new QTableWidgetItem(latitude);
828 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
829 _mountPointsTable->setItem(iRow, 3, it);
830 it = new QTableWidgetItem(longitude);
831 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
832 _mountPointsTable->setItem(iRow, 4, it);
833 }
834
835 it = new QTableWidgetItem(nmea);
836 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
837 _mountPointsTable->setItem(iRow, 5, it);
838
839 it = new QTableWidgetItem(ntripVersion);
840 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
841 _mountPointsTable->setItem(iRow, 6, it);
842
843 bncTableItem* bncIt = new bncTableItem();
844 _mountPointsTable->setItem(iRow, 7, bncIt);
845
846 iRow++;
847 }
848 _mountPointsTable->hideColumn(0);
849 _mountPointsTable->sortItems(1);
850 if (mountPoints->count() > 0 && !_actStop->isEnabled()) {
851 _actGetData->setEnabled(true);
852 }
853 delete mountPoints;
854}
855
856// Save Options
857////////////////////////////////////////////////////////////////////////////
858void bncWindow::slotSaveOptions() {
859
860 QStringList mountPoints;
861 for (int iRow = 0; iRow < _mountPointsTable->rowCount(); iRow++) {
862 QUrl url( "//" + _mountPointsTable->item(iRow, 0)->text() +
863 "@" + _mountPointsTable->item(iRow, 1)->text() );
864
865 mountPoints.append(url.toString() + " " +
866 _mountPointsTable->item(iRow, 2)->text()
867 + " " + _mountPointsTable->item(iRow, 3)->text()
868 + " " + _mountPointsTable->item(iRow, 4)->text()
869 + " " + _mountPointsTable->item(iRow, 5)->text()
870 + " " + _mountPointsTable->item(iRow, 6)->text());
871 }
872
873 bncSettings settings;
874
875 settings.setValue("adviseFail", _adviseFailSpinBox->value());
876 settings.setValue("adviseReco", _adviseRecoSpinBox->value());
877 settings.setValue("adviseScript",_adviseScriptLineEdit->text());
878 settings.setValue("autoStart", _autoStartCheckBox->checkState());
879 settings.setValue("binSampl", _binSamplSpinBox->value());
880 settings.setValue("corrIntr", _corrIntrComboBox->currentText());
881 settings.setValue("corrPath", _corrPathLineEdit->text());
882 settings.setValue("corrPort", _corrPortLineEdit->text());
883 settings.setValue("corrTime", _corrTimeSpinBox->value());
884 settings.setValue("ephIntr", _ephIntrComboBox->currentText());
885 settings.setValue("ephPath", _ephPathLineEdit->text());
886 settings.setValue("ephV3", _ephV3CheckBox->checkState());
887 settings.setValue("logFile", _logFileLineEdit->text());
888 settings.setValue("makePause", _makePauseCheckBox->checkState());
889 settings.setValue("miscMount", _miscMountLineEdit->text());
890 settings.setValue("mountPoints", mountPoints);
891 settings.setValue("obsRate", _obsRateComboBox->currentText());
892 settings.setValue("onTheFlyInterval", _onTheFlyComboBox->currentText());
893 settings.setValue("outEphPort", _outEphPortLineEdit->text());
894 settings.setValue("outFile", _outFileLineEdit->text());
895 settings.setValue("outPort", _outPortLineEdit->text());
896 settings.setValue("outUPort", _outUPortLineEdit->text());
897 settings.setValue("perfIntr", _perfIntrComboBox->currentText());
898 settings.setValue("proxyHost", _proxyHostLineEdit->text());
899 settings.setValue("proxyPort", _proxyPortLineEdit->text());
900 settings.setValue("rnxAppend", _rnxAppendCheckBox->checkState());
901 settings.setValue("rnxIntr", _rnxIntrComboBox->currentText());
902 settings.setValue("rnxPath", _rnxPathLineEdit->text());
903 settings.setValue("rnxSampl", _rnxSamplSpinBox->value());
904 settings.setValue("rnxScript", _rnxScrpLineEdit->text());
905 settings.setValue("rnxSkel", _rnxSkelLineEdit->text());
906 settings.setValue("rnxV3", _rnxV3CheckBox->checkState());
907 settings.setValue("scanRTCM", _scanRTCMCheckBox->checkState());
908 settings.setValue("serialAutoNMEA", _serialAutoNMEACheckBox->checkState());
909 settings.setValue("serialBaudRate", _serialBaudRateComboBox->currentText());
910 settings.setValue("serialDataBits", _serialDataBitsComboBox->currentText());
911 settings.setValue("serialMountPoint",_serialMountPointLineEdit->text());
912 settings.setValue("serialParity", _serialParityComboBox->currentText());
913 settings.setValue("serialPortName", _serialPortNameLineEdit->text());
914 settings.setValue("serialStopBits", _serialStopBitsComboBox->currentText());
915 settings.setValue("startTab", aogroup->currentIndex());
916 settings.setValue("waitTime", _waitTimeSpinBox->value());
917
918 if (_caster) {
919 _caster->slotReadMountPoints();
920 }
921 settings.sync();
922}
923
924// All get slots terminated
925////////////////////////////////////////////////////////////////////////////
926void bncWindow::slotGetThreadsFinished() {
927 ((bncApp*)qApp)->slotMessage("All Get Threads Terminated", true);
928 delete _caster; _caster = 0;
929 _actGetData->setEnabled(true);
930 _actStop->setEnabled(false);
931}
932
933// Retrieve Data
934////////////////////////////////////////////////////////////////////////////
935void bncWindow::slotGetData() {
936 slotSaveOptions();
937
938 _actDeleteMountPoints->setEnabled(false);
939 _actGetData->setEnabled(false);
940 _actStop->setEnabled(true);
941
942 _caster = new bncCaster(_outFileLineEdit->text(),
943 _outPortLineEdit->text().toInt());
944
945 ((bncApp*)qApp)->setPort(_outEphPortLineEdit->text().toInt());
946 ((bncApp*)qApp)->setPortCorr(_corrPortLineEdit->text().toInt());
947
948 connect(_caster, SIGNAL(getThreadsFinished()),
949 this, SLOT(slotGetThreadsFinished()));
950
951 connect (_caster, SIGNAL(mountPointsRead(QList<bncGetThread*>)),
952 this, SLOT(slotMountPointsRead(QList<bncGetThread*>)));
953
954 ((bncApp*)qApp)->slotMessage("============ Start BNC ============", true);
955
956 _caster->slotReadMountPoints();
957}
958
959// Retrieve Data
960////////////////////////////////////////////////////////////////////////////
961void bncWindow::slotStop() {
962 int iRet = QMessageBox::question(this, "Stop", "Stop retrieving data?",
963 QMessageBox::Yes, QMessageBox::No,
964 QMessageBox::NoButton);
965 if (iRet == QMessageBox::Yes) {
966 delete _caster; _caster = 0;
967 _actGetData->setEnabled(true);
968 _actStop->setEnabled(false);
969 }
970}
971
972// Close Application gracefully
973////////////////////////////////////////////////////////////////////////////
974void bncWindow::closeEvent(QCloseEvent* event) {
975
976 int iRet = QMessageBox::question(this, "Close", "Save Options?",
977 QMessageBox::Yes, QMessageBox::No,
978 QMessageBox::Cancel);
979
980 if (iRet == QMessageBox::Cancel) {
981 event->ignore();
982 return;
983 }
984 else if (iRet == QMessageBox::Yes) {
985 slotSaveOptions();
986 }
987
988 QMainWindow::closeEvent(event);
989}
990
991// User changed the selection of mountPoints
992////////////////////////////////////////////////////////////////////////////
993void bncWindow::slotSelectionChanged() {
994 if (_mountPointsTable->selectedItems().isEmpty()) {
995 _actDeleteMountPoints->setEnabled(false);
996 }
997 else {
998 _actDeleteMountPoints->setEnabled(true);
999 }
1000}
1001
1002// Display Program Messages
1003////////////////////////////////////////////////////////////////////////////
1004void bncWindow::slotWindowMessage(const QByteArray msg, bool showOnScreen) {
1005
1006#ifdef DEBUG_RTCM2_2021
1007 const int maxBufferSize = 1000;
1008#else
1009 const int maxBufferSize = 10000;
1010#endif
1011
1012 if (! showOnScreen ) {
1013 return;
1014 }
1015
1016 QString txt = _log->toPlainText() + "\n" +
1017 QDateTime::currentDateTime().toUTC().toString("yy-MM-dd hh:mm:ss ") + msg;
1018 _log->clear();
1019 _log->append(txt.right(maxBufferSize));
1020}
1021
1022// About Message
1023////////////////////////////////////////////////////////////////////////////
1024void bncWindow::slotAbout() {
1025 new bncAboutDlg(0);
1026}
1027
1028//Flowchart
1029////////////////////////////////////////////////////////////////////////////
1030void bncWindow::slotFlowchart() {
1031 new bncFlowchartDlg(0);
1032}
1033
1034// Help Window
1035////////////////////////////////////////////////////////////////////////////
1036void bncWindow::slotHelp() {
1037 QUrl url;
1038 url.setPath(":bnchelp.html");
1039 new bncHlpDlg(0, url);
1040}
1041
1042// Select Fonts
1043////////////////////////////////////////////////////////////////////////////
1044void bncWindow::slotFontSel() {
1045 bool ok;
1046 QFont newFont = QFontDialog::getFont(&ok, this->font(), this);
1047 if (ok) {
1048 bncSettings settings;
1049 settings.setValue("font", newFont.toString());
1050 QApplication::setFont(newFont);
1051 int ww = QFontMetrics(newFont).width('w');
1052 setMinimumSize(60*ww, 80*ww);
1053 resize(60*ww, 80*ww);
1054 }
1055}
1056
1057// Whats This Help
1058void bncWindow::slotWhatsThis() {
1059 QWhatsThis::enterWhatsThisMode();
1060}
1061
1062//
1063////////////////////////////////////////////////////////////////////////////
1064void bncWindow::slotMountPointsRead(QList<bncGetThread*> threads) {
1065 populateMountPointsTable();
1066 bncSettings settings;
1067 _binSamplSpinBox->setValue(settings.value("binSampl").toInt());
1068 _waitTimeSpinBox->setValue(settings.value("waitTime").toInt());
1069 QListIterator<bncGetThread*> iTh(threads);
1070 while (iTh.hasNext()) {
1071 bncGetThread* thread = iTh.next();
1072 for (int iRow = 0; iRow < _mountPointsTable->rowCount(); iRow++) {
1073 QUrl url( "//" + _mountPointsTable->item(iRow, 0)->text() +
1074 "@" + _mountPointsTable->item(iRow, 1)->text() );
1075 if (url == thread->mountPoint() &&
1076 _mountPointsTable->item(iRow, 3)->text() == thread->latitude() &&
1077 _mountPointsTable->item(iRow, 4)->text() == thread->longitude() ) {
1078 ((bncTableItem*) _mountPointsTable->item(iRow, 7))->setGetThread(thread);
1079 break;
1080 }
1081 }
1082 }
1083}
1084
1085//
1086////////////////////////////////////////////////////////////////////////////
1087void bncWindow::CreateMenu() {
1088 // Create Menus
1089 // ------------
1090 _menuFile = menuBar()->addMenu(tr("&File"));
1091 _menuFile->addAction(_actFontSel);
1092 _menuFile->addSeparator();
1093 _menuFile->addAction(_actSaveOpt);
1094 _menuFile->addSeparator();
1095 _menuFile->addAction(_actQuit);
1096
1097 _menuHlp = menuBar()->addMenu(tr("&Help"));
1098 _menuHlp->addAction(_actHelp);
1099 _menuHlp->addAction(_actFlowchart);
1100 _menuHlp->addAction(_actAbout);
1101}
1102
1103// Toolbar
1104////////////////////////////////////////////////////////////////////////////
1105void bncWindow::AddToolbar() {
1106 // Tool (Command) Bar
1107 // ------------------
1108 QToolBar* toolBar = new QToolBar;
1109 addToolBar(Qt::BottomToolBarArea, toolBar);
1110 toolBar->setMovable(false);
1111 toolBar->addAction(_actAddMountPoints);
1112 toolBar->addAction(_actDeleteMountPoints);
1113 toolBar->addAction(_actGetData);
1114 toolBar->addAction(_actStop);
1115 toolBar->addWidget(new QLabel(" "));
1116 toolBar->addAction(_actwhatsthis);
1117}
1118
1119// About
1120////////////////////////////////////////////////////////////////////////////
1121bncAboutDlg::bncAboutDlg(QWidget* parent) :
1122 QDialog(parent) {
1123
1124 QTextBrowser* tb = new QTextBrowser;
1125 QUrl url; url.setPath(":bncabout.html");
1126 tb->setSource(url);
1127 tb->setReadOnly(true);
1128
1129 int ww = QFontMetrics(font()).width('w');
1130 QPushButton* _closeButton = new QPushButton("Close");
1131 _closeButton->setMaximumWidth(10*ww);
1132 connect(_closeButton, SIGNAL(clicked()), this, SLOT(close()));
1133
1134 QGridLayout* dlgLayout = new QGridLayout();
1135 QLabel* img = new QLabel();
1136 img->setPixmap(QPixmap(":ntrip-logo.png"));
1137 dlgLayout->addWidget(img, 0,0);
1138 dlgLayout->addWidget(new QLabel("BKG Ntrip Client (BNC) Version 1.7"), 0,1);
1139 dlgLayout->addWidget(tb,1,0,1,2);
1140 dlgLayout->addWidget(_closeButton,2,1,Qt::AlignRight);
1141
1142 setLayout(dlgLayout);
1143 resize(60*ww, 60*ww);
1144 setWindowTitle("About BNC");
1145 show();
1146}
1147
1148//
1149////////////////////////////////////////////////////////////////////////////
1150bncAboutDlg::~bncAboutDlg() {
1151};
1152
1153// Flowchart
1154////////////////////////////////////////////////////////////////////////////
1155bncFlowchartDlg::bncFlowchartDlg(QWidget* parent) :
1156 QDialog(parent) {
1157
1158 int ww = QFontMetrics(font()).width('w');
1159 QPushButton* _closeButton = new QPushButton("Close");
1160 _closeButton->setMaximumWidth(10*ww);
1161 connect(_closeButton, SIGNAL(clicked()), this, SLOT(close()));
1162
1163 QGridLayout* dlgLayout = new QGridLayout();
1164 QLabel* img = new QLabel();
1165 img->setPixmap(QPixmap(":bncflowchart.png"));
1166 dlgLayout->addWidget(img, 0,0);
1167 dlgLayout->addWidget(_closeButton,1,0,Qt::AlignLeft);
1168
1169 setLayout(dlgLayout);
1170 setWindowTitle("Flow Chart");
1171 show();
1172}
1173
1174//
1175////////////////////////////////////////////////////////////////////////////
1176bncFlowchartDlg::~bncFlowchartDlg() {
1177};
1178
1179// Bnc Text
1180////////////////////////////////////////////////////////////////////////////
1181void bncWindow::bncText(const QString &text){
1182
1183 bool isEmpty = text.isEmpty();
1184
1185 QPalette palette;
1186 QColor lightGray(230, 230, 230);
1187 QColor white(255, 255, 255);
1188
1189 // Proxy
1190 //------
1191 if (aogroup->currentIndex() == 0) {
1192 if (!isEmpty) {
1193 _proxyPortLineEdit->setStyleSheet("background-color: white");
1194 _proxyPortLineEdit->setEnabled(true);
1195 } else {
1196 _proxyPortLineEdit->setStyleSheet("background-color: lightGray");
1197 _proxyPortLineEdit->setEnabled(false);
1198 }
1199 }
1200
1201 // RINEX Observations
1202 // ------------------
1203 if (aogroup->currentIndex() == 2) {
1204 if (!isEmpty) {
1205 _rnxSamplSpinBox->setStyleSheet("background-color: white");
1206 _rnxSkelLineEdit->setStyleSheet("background-color: white");
1207 _rnxScrpLineEdit->setStyleSheet("background-color: white");
1208 palette.setColor(_rnxV3CheckBox->backgroundRole(), white);
1209 _rnxV3CheckBox->setPalette(palette);
1210 _rnxIntrComboBox->setStyleSheet("background-color: white");
1211 _rnxSamplSpinBox->setEnabled(true);
1212 _rnxSkelLineEdit->setEnabled(true);
1213 _rnxScrpLineEdit->setEnabled(true);
1214 _rnxV3CheckBox->setEnabled(true);
1215 _rnxIntrComboBox->setEnabled(true);
1216 } else {
1217 _rnxSamplSpinBox->setStyleSheet("background-color: lightGray");
1218 _rnxSkelLineEdit->setStyleSheet("background-color: lightGray");
1219 _rnxScrpLineEdit->setStyleSheet("background-color: lightGray");
1220 palette.setColor(_rnxV3CheckBox->backgroundRole(), lightGray);
1221 _rnxV3CheckBox->setPalette(palette);
1222 _rnxIntrComboBox->setStyleSheet("background-color: lightGray");
1223 _rnxSamplSpinBox->setEnabled(false);
1224 _rnxSkelLineEdit->setEnabled(false);
1225 _rnxScrpLineEdit->setEnabled(false);
1226 _rnxV3CheckBox->setEnabled(false);
1227 _rnxIntrComboBox->setEnabled(false);
1228 }
1229 }
1230
1231 // RINEX Ephemeris
1232 // ---------------
1233 if (aogroup->currentIndex() == 3) {
1234 if (!_ephPathLineEdit->text().isEmpty() && !_outEphPortLineEdit->text().isEmpty()) {
1235 _ephIntrComboBox->setStyleSheet("background-color: white");
1236 palette.setColor(_ephV3CheckBox->backgroundRole(), white);
1237 _ephV3CheckBox->setPalette(palette);
1238 _ephIntrComboBox->setEnabled(true);
1239 _ephV3CheckBox->setEnabled(true);
1240 }
1241 if (_ephPathLineEdit->text().isEmpty() && !_outEphPortLineEdit->text().isEmpty()) {
1242 _ephIntrComboBox->setStyleSheet("background-color: lightGray");
1243 palette.setColor(_ephV3CheckBox->backgroundRole(), white);
1244 _ephV3CheckBox->setPalette(palette);
1245 _ephIntrComboBox->setEnabled(false);
1246 _ephV3CheckBox->setEnabled(true);
1247 }
1248 if (!_ephPathLineEdit->text().isEmpty() && _outEphPortLineEdit->text().isEmpty()) {
1249 _ephIntrComboBox->setStyleSheet("background-color: white");
1250 palette.setColor(_ephV3CheckBox->backgroundRole(), white);
1251 _ephV3CheckBox->setPalette(palette);
1252 _ephIntrComboBox->setEnabled(true);
1253 _ephV3CheckBox->setEnabled(true);
1254 }
1255 if (_ephPathLineEdit->text().isEmpty() && _outEphPortLineEdit->text().isEmpty()) {
1256 _ephIntrComboBox->setStyleSheet("background-color: lightGray");
1257 palette.setColor(_ephV3CheckBox->backgroundRole(), lightGray);
1258 _ephV3CheckBox->setPalette(palette);
1259 _ephIntrComboBox->setEnabled(false);
1260 _ephV3CheckBox->setEnabled(false);
1261 }
1262 }
1263
1264 // Ephemeris Corrections
1265 // ---------------------
1266 if (aogroup->currentIndex() == 4) {
1267 if (!isEmpty) {
1268 if (!_corrPathLineEdit->text().isEmpty()) {
1269 _corrIntrComboBox->setStyleSheet("background-color: white");
1270 _corrPortLineEdit->setStyleSheet("background-color: white");
1271 _corrIntrComboBox->setEnabled(true);
1272 _corrPortLineEdit->setEnabled(true);
1273 }
1274 if (!_corrPortLineEdit->text().isEmpty()) {
1275 _corrTimeSpinBox->setStyleSheet("background-color: white");
1276 _corrTimeSpinBox->setEnabled(true);
1277 }
1278 } else {
1279 if (_corrPathLineEdit->text().isEmpty()) {
1280 _corrIntrComboBox->setStyleSheet("background-color: lightGray");
1281 _corrIntrComboBox->setEnabled(false);
1282 }
1283 if (_corrPortLineEdit->text().isEmpty()) {
1284 _corrTimeSpinBox->setStyleSheet("background-color: lightGray");
1285 _corrTimeSpinBox->setEnabled(false);
1286 }
1287 }
1288 }
1289
1290 // Feed Engine
1291 // -----------
1292 if (aogroup->currentIndex() == 5) {
1293 if ( !_outPortLineEdit->text().isEmpty() || !_outFileLineEdit->text().isEmpty()) {
1294 _waitTimeSpinBox->setStyleSheet("background-color: white");
1295 _binSamplSpinBox->setStyleSheet("background-color: white");
1296 _waitTimeSpinBox->setEnabled(true);
1297 _binSamplSpinBox->setEnabled(true);
1298 } else {
1299 _waitTimeSpinBox->setStyleSheet("background-color: lightGray");
1300 _binSamplSpinBox->setStyleSheet("background-color: lightGray");
1301 _waitTimeSpinBox->setEnabled(false);
1302 _binSamplSpinBox->setEnabled(false);
1303 }
1304 }
1305
1306 // Serial Link
1307 // -----------
1308 if (aogroup->currentIndex() == 6) {
1309 if (!isEmpty) {
1310 _serialPortNameLineEdit->setStyleSheet("background-color: white");
1311 _serialBaudRateComboBox->setStyleSheet("background-color: white");
1312 _serialParityComboBox->setStyleSheet("background-color: white");
1313 _serialDataBitsComboBox->setStyleSheet("background-color: white");
1314 _serialStopBitsComboBox->setStyleSheet("background-color: white");
1315 palette.setColor(_serialAutoNMEACheckBox->backgroundRole(), white);
1316 _serialAutoNMEACheckBox->setPalette(palette);
1317 _serialPortNameLineEdit->setEnabled(true);
1318 _serialBaudRateComboBox->setEnabled(true);
1319 _serialParityComboBox->setEnabled(true);
1320 _serialDataBitsComboBox->setEnabled(true);
1321 _serialStopBitsComboBox->setEnabled(true);
1322 _serialAutoNMEACheckBox->setEnabled(true);
1323 } else {
1324 _serialPortNameLineEdit->setStyleSheet("background-color: lightGray");
1325 _serialBaudRateComboBox->setStyleSheet("background-color: lightGray");
1326 _serialParityComboBox->setStyleSheet("background-color: lightGray");
1327 _serialDataBitsComboBox->setStyleSheet("background-color: lightGray");
1328 _serialStopBitsComboBox->setStyleSheet("background-color: lightGray");
1329 palette.setColor(_serialAutoNMEACheckBox->backgroundRole(), lightGray);
1330 _serialAutoNMEACheckBox->setPalette(palette);
1331 _serialPortNameLineEdit->setEnabled(false);
1332 _serialBaudRateComboBox->setEnabled(false);
1333 _serialParityComboBox->setEnabled(false);
1334 _serialDataBitsComboBox->setEnabled(false);
1335 _serialStopBitsComboBox->setEnabled(false);
1336 _serialAutoNMEACheckBox->setEnabled(false);
1337 }
1338 }
1339
1340 // Outages
1341 // -------
1342 if (aogroup->currentIndex() == 7) {
1343 if (!isEmpty) {
1344 _adviseScriptLineEdit->setStyleSheet("background-color: white");
1345 _adviseFailSpinBox->setStyleSheet("background-color: white");
1346 _adviseRecoSpinBox->setStyleSheet("background-color: white");
1347 palette.setColor(_makePauseCheckBox->backgroundRole(), white);
1348 _makePauseCheckBox->setPalette(palette);
1349 _adviseFailSpinBox->setEnabled(true);
1350 _adviseRecoSpinBox->setEnabled(true);
1351 _makePauseCheckBox->setEnabled(true);
1352 _adviseScriptLineEdit->setEnabled(true);
1353 } else {
1354 _adviseScriptLineEdit->setStyleSheet("background-color: lightGray");
1355 _adviseFailSpinBox->setStyleSheet("background-color: lightGray");
1356 _adviseRecoSpinBox->setStyleSheet("background-color: lightGray");
1357 palette.setColor(_makePauseCheckBox->backgroundRole(), lightGray);
1358 _makePauseCheckBox->setPalette(palette);
1359 _adviseFailSpinBox->setEnabled(false);
1360 _adviseRecoSpinBox->setEnabled(false);
1361 _makePauseCheckBox->setEnabled(false);
1362 _adviseScriptLineEdit->setEnabled(false);
1363 }
1364 }
1365
1366 // Miscellaneous
1367 // -------------
1368 if (aogroup->currentIndex() == 8) {
1369 if (!isEmpty) {
1370 _perfIntrComboBox->setStyleSheet("background-color: white");
1371 palette.setColor(_scanRTCMCheckBox->backgroundRole(), white);
1372 _scanRTCMCheckBox->setPalette(palette);
1373 _perfIntrComboBox->setEnabled(true);
1374 _scanRTCMCheckBox->setEnabled(true);
1375 } else {
1376 _perfIntrComboBox->setStyleSheet("background-color: lightGray");
1377 palette.setColor(_scanRTCMCheckBox->backgroundRole(), lightGray);
1378 _scanRTCMCheckBox->setPalette(palette);
1379 _perfIntrComboBox->setEnabled(false);
1380 _scanRTCMCheckBox->setEnabled(false);
1381 }
1382 }
1383}
Note: See TracBrowser for help on using the repository browser.