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

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

* empty log message *

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