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

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

* empty log message *

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