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

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

* empty log message *

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