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

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

* empty log message *

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