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

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

* empty log message *

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