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

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

* empty log message *

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