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

Last change on this file since 1472 was 1472, checked in by weber, 14 years ago

* empty log message *

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