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

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

* empty log message *

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