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

Last change on this file since 2127 was 2127, checked in by mervart, 14 years ago

* empty log message *

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