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

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

* empty log message *

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