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

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

* empty log message *

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