source: ntrip/trunk/BNS/bnswindow.cpp@ 1802

Last change on this file since 1802 was 1795, checked in by mervart, 16 years ago

* empty log message *

File size: 53.6 KB
RevLine 
[748]1
2/* -------------------------------------------------------------------------
[749]3 * BKG NTRIP Server
[748]4 * -------------------------------------------------------------------------
5 *
6 * Class: bnsWindow
7 *
8 * Purpose: This class implements the main application window.
9 *
10 * Author: L. Mervart
11 *
12 * Created: 29-Mar-2008
13 *
14 * Changes:
15 *
16 * -----------------------------------------------------------------------*/
17
[749]18#include <iostream>
19
[748]20#include "bnswindow.h"
[749]21#include "bnshlpdlg.h"
[1668]22#include "bnssettings.h"
[1771]23#include "bnscustomtrafo.h"
[748]24
25using namespace std;
26
[754]27// About Dialog - Constructor
28////////////////////////////////////////////////////////////////////////////
29bnsAboutDlg::bnsAboutDlg(QWidget* parent) :
30 QDialog(parent) {
31
32 QTextBrowser* tb = new QTextBrowser;
33 QUrl url; url.setPath(":bnsabout.html");
34 tb->setSource(url);
35 tb->setReadOnly(true);
36
37 int ww = QFontMetrics(font()).width('w');
38 QPushButton* _closeButton = new QPushButton("Close");
39 _closeButton->setMaximumWidth(10*ww);
40 connect(_closeButton, SIGNAL(clicked()), this, SLOT(close()));
41
42 QGridLayout* dlgLayout = new QGridLayout();
43 QLabel* img = new QLabel();
44 img->setPixmap(QPixmap(":ntrip-logo.png"));
45 dlgLayout->addWidget(img, 0,0);
[1666]46 dlgLayout->addWidget(new QLabel("BKG Ntrip State Space Server (BNS) Version 1.1"), 0,1);
[754]47 dlgLayout->addWidget(tb,1,0,1,2);
48 dlgLayout->addWidget(_closeButton,2,1,Qt::AlignRight);
49
50 setLayout(dlgLayout);
51 resize(60*ww, 60*ww);
52 show();
53}
54
55// About Dialog - Destructor
56////////////////////////////////////////////////////////////////////////////
57bnsAboutDlg::~bnsAboutDlg() {
58};
59
[998]60// Flowchart Dialog - Constructor
61////////////////////////////////////////////////////////////////////////////
62bnsFlowchartDlg::bnsFlowchartDlg(QWidget* parent) :
63 QDialog(parent) {
64
65 int ww = QFontMetrics(font()).width('w');
66 QPushButton* _closeButton = new QPushButton("Close");
67 _closeButton->setMaximumWidth(10*ww);
68 connect(_closeButton, SIGNAL(clicked()), this, SLOT(close()));
69
70 QGridLayout* dlgLayout = new QGridLayout();
71 QLabel* img = new QLabel();
72 img->setPixmap(QPixmap(":bnsflowchart.png"));
73 dlgLayout->addWidget(img, 0,0);
74 dlgLayout->addWidget(_closeButton,1,0,Qt::AlignLeft);
75
76 setLayout(dlgLayout);
77 show();
78}
79
80// Flowchart Dialog - Destructor
81////////////////////////////////////////////////////////////////////////////
82bnsFlowchartDlg::~bnsFlowchartDlg() {
83};
84
[748]85// Constructor
86////////////////////////////////////////////////////////////////////////////
[758]87bnsWindow::bnsWindow() {
[749]88
[758]89 _bns = 0;
[757]90
[1668]91 bnsSettings settings;
[1671]92 QPalette palette;
93 QColor lightGray(230, 230, 230);
[752]94
95 QString fontString = settings.value("font").toString();
96 if ( !fontString.isEmpty() ) {
97 QFont newFont;
98 if (newFont.fromString(fontString)) {
[1057]99 QApplication::setFont(newFont);
[752]100 }
101 }
102
[749]103 int ww = QFontMetrics(this->font()).width('w');
104 setMinimumSize(77*ww, 65*ww);
[1666]105 setWindowTitle(tr("BKG Ntrip State Space Server (BNS) Version 1.1"));
[752]106 setWindowIcon(QPixmap(":ntrip-logo.png"));
[749]107
108 // Create Actions
109 // --------------
110 _actHelp = new QAction(tr("&Help Contents"),this);
111 connect(_actHelp, SIGNAL(triggered()), SLOT(slotHelp()));
112
113 _actAbout = new QAction(tr("&About BNS"),this);
114 connect(_actAbout, SIGNAL(triggered()), SLOT(slotAbout()));
115
[998]116 _actFlowchart = new QAction(tr("&Flow Chart"),this);
117 connect(_actFlowchart, SIGNAL(triggered()), SLOT(slotFlowchart()));
118
[749]119 _actFontSel = new QAction(tr("Select &Font"),this);
120 connect(_actFontSel, SIGNAL(triggered()), SLOT(slotFontSel()));
121
122 _actSaveOpt = new QAction(tr("&Save Options"),this);
123 connect(_actSaveOpt, SIGNAL(triggered()), SLOT(slotSaveOptions()));
124
125 _actQuit = new QAction(tr("&Quit"),this);
126 connect(_actQuit, SIGNAL(triggered()), SLOT(close()));
127
[753]128 _actWhatsThis= new QAction(tr("Help=Shift+F1"),this);
129 connect(_actWhatsThis, SIGNAL(triggered()), SLOT(slotWhatsThis()));
[749]130
[753]131 _actStart = new QAction(tr("Sta&rt"),this);
132 connect(_actStart, SIGNAL(triggered()), SLOT(slotStart()));
133
134 _actStop = new QAction(tr("Sto&p"),this);
135 connect(_actStop, SIGNAL(triggered()), SLOT(slotStop()));
136 _actStop->setEnabled(false);
137
[749]138 CreateMenu();
139 AddToolbar();
140
141 // Canvas with Editable Fields
142 // ---------------------------
143 _canvas = new QWidget;
144 setCentralWidget(_canvas);
145
[1668]146 // Proxy Options
147 // -------------
[958]148 _proxyHostLineEdit = new QLineEdit(settings.value("proxyHost").toString());
149 _proxyPortLineEdit = new QLineEdit(settings.value("proxyPort").toString());
150
[1668]151 // General Options
152 // ---------------
[958]153 _logFileLineEdit = new QLineEdit(settings.value("logFile").toString());
154 _fileAppendCheckBox = new QCheckBox();
155 _fileAppendCheckBox->setCheckState(Qt::CheckState(settings.value("fileAppend").toInt()));
[1668]156 _autoStartCheckBox = new QCheckBox();
157 _autoStartCheckBox->setCheckState(Qt::CheckState(
158 settings.value("autoStart").toInt()));
[958]159
[1668]160 // RINEX Ephemeris Options
161 // -----------------------
[958]162 _ephHostLineEdit = new QLineEdit(settings.value("ephHost").toString());
[752]163 _ephPortLineEdit = new QLineEdit(settings.value("ephPort").toString());
[1089]164 _ephEchoLineEdit = new QLineEdit(settings.value("ephEcho").toString());
[752]165
[1668]166 // Clocks & Orbits Options
167 // -----------------------
[787]168 _clkPortLineEdit = new QLineEdit(settings.value("clkPort").toString());
[1668]169 _inpEchoLineEdit = new QLineEdit(settings.value("inpEcho").toString());
[750]170
[1668]171
[1682]172 // Broadcast Corrections I Options
[1668]173 // -------------------------------
[1249]174 _outHost_1_LineEdit = new QLineEdit(settings.value("outHost1").toString());
175 _outPort_1_LineEdit = new QLineEdit(settings.value("outPort1").toString());
176 _password_1_LineEdit = new QLineEdit(settings.value("password1").toString());
177 _password_1_LineEdit->setEchoMode(QLineEdit::Password);
[1068]178 _mountpoint_1_LineEdit = new QLineEdit(settings.value("mountpoint_1").toString());
179 _refSys_1_ComboBox = new QComboBox;
180 _refSys_1_ComboBox->setEditable(false);
[1771]181 _refSys_1_ComboBox->addItems(QString("IGS05,ETRF2000,Custom").split(","));
[1068]182 int ii = _refSys_1_ComboBox->findText(settings.value("refSys_1").toString());
183 if (ii != -1) {
184 _refSys_1_ComboBox->setCurrentIndex(ii);
185 }
[1668]186 _outFile_1_LineEdit = new QLineEdit(settings.value("outFile_1").toString());
[1670]187 _beClocks1CheckBox = new QCheckBox();
188 _beClocks1CheckBox->setCheckState(Qt::CheckState(settings.value("beClocks1").toInt()));
[1668]189
[1682]190 // Broadcast Corrections II Options
[1668]191 // --------------------------------
192 _outHost_2_LineEdit = new QLineEdit(settings.value("outHost2").toString());
193 _outPort_2_LineEdit = new QLineEdit(settings.value("outPort2").toString());
194 _password_2_LineEdit = new QLineEdit(settings.value("password2").toString());
195 _password_2_LineEdit->setEchoMode(QLineEdit::Password);
196 _mountpoint_2_LineEdit = new QLineEdit(settings.value("mountpoint_2").toString());
[1068]197 _refSys_2_ComboBox = new QComboBox;
198 _refSys_2_ComboBox->setEditable(false);
[1771]199 _refSys_2_ComboBox->addItems(QString("IGS05,ETRF2000,Custom").split(","));
[1068]200 ii = _refSys_2_ComboBox->findText(settings.value("refSys_2").toString());
201 if (ii != -1) {
202 _refSys_2_ComboBox->setCurrentIndex(ii);
203 }
204 _outFile_2_LineEdit = new QLineEdit(settings.value("outFile_2").toString());
[1670]205 _beClocks2CheckBox = new QCheckBox();
206 _beClocks2CheckBox->setCheckState(Qt::CheckState(settings.value("beClocks2").toInt()));
[813]207
[1728]208 // Broadcast Corrections III Options
209 // ---------------------------------
210 _outHost_3_LineEdit = new QLineEdit(settings.value("outHost3").toString());
211 _outPort_3_LineEdit = new QLineEdit(settings.value("outPort3").toString());
212 _password_3_LineEdit = new QLineEdit(settings.value("password3").toString());
213 _password_3_LineEdit->setEchoMode(QLineEdit::Password);
214 _mountpoint_3_LineEdit = new QLineEdit(settings.value("mountpoint_3").toString());
215 _refSys_3_ComboBox = new QComboBox;
216 _refSys_3_ComboBox->setEditable(false);
[1771]217 _refSys_3_ComboBox->addItems(QString("IGS05,ETRF2000,Custom").split(","));
[1728]218 ii = _refSys_3_ComboBox->findText(settings.value("refSys_3").toString());
219 if (ii != -1) {
220 _refSys_3_ComboBox->setCurrentIndex(ii);
221 }
222 _outFile_3_LineEdit = new QLineEdit(settings.value("outFile_3").toString());
223 _beClocks3CheckBox = new QCheckBox();
224 _beClocks3CheckBox->setCheckState(Qt::CheckState(settings.value("beClocks3").toInt()));
225
[1795]226 // Broadcast Ephemerides
227 // ---------------------
228 _outHost_Eph_LineEdit = new QLineEdit(settings.value("outHostEph").toString());
229 _outPort_Eph_LineEdit = new QLineEdit(settings.value("outPortEph").toString());
230 _password_Eph_LineEdit = new QLineEdit(settings.value("passwordEph").toString());
231 _password_Eph_LineEdit->setEchoMode(QLineEdit::Password);
232 _mountpoint_Eph_LineEdit = new QLineEdit(settings.value("mountpoint_Eph").toString());
233
[1668]234 // RINEX Clocks Options
235 // --------------------
[846]236 _rnxPathLineEdit = new QLineEdit(settings.value("rnxPath").toString());
[845]237 _rnxIntrComboBox = new QComboBox;
[846]238 _rnxIntrComboBox->setEditable(false);
239 _rnxIntrComboBox->addItems(QString("1 min,2 min,5 min,10 min,15 min,30 min,1 hour,1 day").split(","));
[958]240 ii = _rnxIntrComboBox->findText(settings.value("rnxIntr").toString());
[846]241 if (ii != -1) {
242 _rnxIntrComboBox->setCurrentIndex(ii);
243 }
[845]244 _rnxSamplSpinBox = new QSpinBox;
[846]245 _rnxSamplSpinBox->setMinimum(0);
246 _rnxSamplSpinBox->setMaximum(60);
247 _rnxSamplSpinBox->setSingleStep(5);
248 _rnxSamplSpinBox->setMaximumWidth(9*ww);
249 _rnxSamplSpinBox->setValue(settings.value("rnxSampl").toInt());
250 _rnxSamplSpinBox->setSuffix(" sec");
[845]251
[1668]252 // SP3 Orbits Options
253 // ------------------
[846]254 _sp3PathLineEdit = new QLineEdit(settings.value("sp3Path").toString());
[845]255 _sp3IntrComboBox = new QComboBox;
[846]256 _sp3IntrComboBox->setEditable(false);
257 _sp3IntrComboBox->addItems(QString("1 min,2 min,5 min,10 min,15 min,30 min,1 hour,1 day").split(","));
258 ii = _sp3IntrComboBox->findText(settings.value("sp3Intr").toString());
259 if (ii != -1) {
260 _sp3IntrComboBox->setCurrentIndex(ii);
261 }
[845]262 _sp3SamplSpinBox = new QSpinBox;
[846]263 _sp3SamplSpinBox->setMinimum(0);
[855]264 _sp3SamplSpinBox->setMaximum(900);
265 _sp3SamplSpinBox->setSingleStep(60);
[846]266 _sp3SamplSpinBox->setMaximumWidth(9*ww);
267 _sp3SamplSpinBox->setValue(settings.value("sp3Sampl").toInt());
268 _sp3SamplSpinBox->setSuffix(" sec");
[1668]269
270 // Whats This
271 // ----------
272 _proxyHostLineEdit->setWhatsThis(tr("<p>If you are running BNS 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 BNS. 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 BNS outside your LAN on a network that has unobstructed connection to the Internet.</p>"));
273 _proxyPortLineEdit->setWhatsThis(tr("<p>Enter your proxy server port number in case one is operated in front of BNS.</p>"));
274 _logFileLineEdit->setWhatsThis(tr("<p>Records of BNS activities are shown in the Log 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>"));
275 _fileAppendCheckBox->setWhatsThis(tr("<p>When BNS 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 BNS, a system crash or when BNS crashed. Tick 'Append files' to continue with existing files and keep what has been recorded so far.</p>"));
276 _inpEchoLineEdit->setWhatsThis(tr("Specify the full path to a file where incoming clocks and orbits are saved. Beware that the size of this file can rapidly increase. Default is an empty option field meaning that incoming clocks and orbits are not saved."));
277 _ephHostLineEdit->setWhatsThis(tr("BNS reads Broadcast Ephemeris in RINEX Version 3 Navigation file format from an IP address. Specify the host IP e.g. of a BNC installation providing this information."));
278 _ephPortLineEdit->setWhatsThis(tr("BNS reads Broadcast Ephemeris in RINEX Version 3 Navigation file format from an IP address. Specify the IP port e.g. of a BNC installation providing this information."));
279 _ephEchoLineEdit->setWhatsThis(tr("Specify the full path to a file where incoming Broadcast Ephemeris are saved. Beware that the size of this file can rapidly increase. Default is an empty option field meaning that incoming Broadcast Ephemeris are not saved."));
280 _clkPortLineEdit->setWhatsThis(tr("BNS reads Clocks & Orbits referring to the IGS system (X,Y,Z, ECEF) in SP3 format from an IP port. Specify a local IP port e.g. for an RTNet installation to provide this information."));
281 _outHost_1_LineEdit->setWhatsThis(tr("BNS can stream clock and orbit corrections to Broadcast Ephemeris in RTCM Version 3 format. Specify the host IP of an NTRIP Broadcaster to upload the stream. An empty option field means that you don't want to upload corrections."));
282 _outPort_1_LineEdit->setWhatsThis(tr("Specify the IP port of an NTRIP Broadcaster to upload the stream. Default is port 80."));
[1728]283 _mountpoint_1_LineEdit->setWhatsThis(tr("Specify the mounpoint for stream upload to an NTRIP Broadcaster."));
[1668]284 _password_1_LineEdit->setWhatsThis(tr("Specify the stream upload password protecting the mounpoint on an NTRIP Broadcaster."));
285 _refSys_1_ComboBox->setWhatsThis(tr("Select the target reference system for outgoing clock and orbit corrections."));
[1728]286 _outFile_1_LineEdit->setWhatsThis(tr("Specify the full path to a file where outgoing clock and orbit corrections to Broadcast Ephemeris are saved. Beware that the size of this file can rapidly increase. Default is an empty option field meaning that outgoing corrections are not saved."));
[1668]287 _outHost_2_LineEdit->setWhatsThis(tr("BNS can stream clock and orbit corrections to Broadcast Ephemeris in RTCM Version 3 format. Specify the host IP of an NTRIP Broadcaster to upload the stream. An empty option field means that you don't want to upload corrections."));
288 _outPort_2_LineEdit->setWhatsThis(tr("Specify the IP port of an NTRIP Broadcaster to upload the stream. Default is port 80."));
[1728]289 _mountpoint_2_LineEdit->setWhatsThis(tr("Specify the mounpoint for stream upload to an NTRIP Broadcaster."));
[1668]290 _password_2_LineEdit->setWhatsThis(tr("Specify the stream upload password protecting the mounpoint on an NTRIP Broadcaster."));
291 _refSys_2_ComboBox->setWhatsThis(tr("Select the target reference system for outgoing clock and orbit corrections."));
292 _outFile_2_LineEdit->setWhatsThis(tr("Specify the full path to a file where outgoing clock and orbit corrections to Broadcast Ephemeris are saved. Beware that the size of this file can rapidly increase. Default is an empty option field meaning that outgoing corrections are not saved."));
[1728]293 _outHost_3_LineEdit->setWhatsThis(tr("BNS can stream clock and orbit corrections to Broadcast Ephemeris in RTCM Version 3 format. Specify the host IP of an NTRIP Broadcaster to upload the stream. An empty option field means that you don't want to upload corrections."));
294 _outPort_3_LineEdit->setWhatsThis(tr("Specify the IP port of an NTRIP Broadcaster to upload the stream. Default is port 80."));
295 _mountpoint_3_LineEdit->setWhatsThis(tr("Specify the mounpoint for stream upload to an NTRIP Broadcaster."));
296 _password_3_LineEdit->setWhatsThis(tr("Specify the stream upload password protecting the mounpoint on an NTRIP Broadcaster."));
297 _refSys_3_ComboBox->setWhatsThis(tr("Select the target reference system for outgoing clock and orbit corrections."));
298 _outFile_3_LineEdit->setWhatsThis(tr("Specify the full path to a file where outgoing clock and orbit corrections to Broadcast Ephemeris are saved. Beware that the size of this file can rapidly increase. Default is an empty option field meaning that outgoing corrections are not saved."));
[1668]299 _rnxPathLineEdit->setWhatsThis(tr("Specify the path for saving the generated clock corrections as Clock RINEX files. If the specified directory does not exist, BNS will not create Clock RINEX files."));
300 _rnxIntrComboBox->setWhatsThis(tr("Select the length of the Clock RINEX file."));
301 _rnxSamplSpinBox->setWhatsThis(tr("Select the Clock RINEX file sampling interval in seconds. A value of zero '0' tells BNS to store all available samples into Clock RINEX files."));
302 _sp3PathLineEdit->setWhatsThis(tr("Specify the path for saving the generated orbit corrections as SP3 orbit files. If the specified directory does not exist, BNS will not create SP3 orbit files."));
303 _sp3IntrComboBox->setWhatsThis(tr("Select the length of the SP3 orbit file."));
[958]304 _sp3SamplSpinBox->setWhatsThis(tr("Select the SP3 orbit file sampling interval in seconds. A value of zero '0' tells BNS to store all available samples into SP3 orbit files."));
[1668]305 _autoStartCheckBox->setWhatsThis(tr("<p>Tick 'Auto start' for auto-start of BNS at startup time in window mode with preassigned processing options.</p>"));
[1693]306 _beClocks1CheckBox->setWhatsThis(tr("<p>Ignore incoming clock estimates and send broadcast clocks instead of broadcast clock corrections.</p><p>Note that for compatibility with IGS post processing products these clocks will not be corrected for the 2nd order relativistic effect.</p>"));
307 _beClocks2CheckBox->setWhatsThis(tr("<p>Ignore incoming clock estimates and send broadcast clocks instead of broadcast clock corrections.</p><p>Note that for compatibility with IGS post processing products these clocks will not be corrected for the 2nd order relativistic effect.</p>"));
[845]308
[1668]309
[750]310 // TabWidget
311 // ---------
[1668]312 tabs = new QTabWidget();
[813]313
[958]314 // Proxy Tab
315 // ---------
316 QWidget* tab_prx = new QWidget();
317 tabs->setMaximumHeight(20*ww);
318 tabs->addTab(tab_prx, "Proxy");
[750]319
[958]320 QGridLayout* layout_prx = new QGridLayout;
[1668]321
[958]322 layout_prx->setColumnMinimumWidth(0,9*ww);
[1668]323 _proxyPortLineEdit->setMaximumWidth(9*ww);
[845]324
[1668]325 layout_prx->addWidget(new QLabel("Host"), 0, 0);
326 layout_prx->addWidget(_proxyHostLineEdit, 0, 1, 1, 10);
327 layout_prx->addWidget(new QLabel("Port"), 1, 0);
[958]328 layout_prx->addWidget(_proxyPortLineEdit, 1, 1);
[1668]329 layout_prx->addWidget(new QLabel("Settings for the proxy in protected networks, leave boxes blank if none."),2, 0, 1, 50, Qt::AlignLeft);
[958]330 layout_prx->addWidget(new QLabel(" "), 3, 0);
[813]331
[958]332 tab_prx->setLayout(layout_prx);
[752]333
[1668]334 connect(_proxyHostLineEdit, SIGNAL(textChanged(const QString &)),
335 this, SLOT(bnsText(const QString &)));
336 if (_proxyHostLineEdit->text().isEmpty()) {
337 _proxyPortLineEdit->setStyleSheet("background-color: lightGray");
338 _proxyPortLineEdit->setEnabled(false);
339 }
340
[958]341 // General Tab
342 // -----------
343 QWidget* tab_gen = new QWidget();
344 tabs->addTab(tab_gen, "General");
345
346 QGridLayout* layout_gen = new QGridLayout;
[1668]347
[958]348 layout_gen->setColumnMinimumWidth(0,9*ww);
[1668]349 _logFileLineEdit->setMaximumWidth(40*ww);
[958]350
[1668]351 layout_gen->addWidget(new QLabel("Logfile (full path) "), 0, 0);
352 layout_gen->addWidget(_logFileLineEdit, 0, 1);
353 layout_gen->addWidget(new QLabel("Append files"), 1, 0);
354 layout_gen->addWidget(_fileAppendCheckBox, 1, 1);
355 layout_gen->addWidget(new QLabel("Auto start"), 2, 0);
356 layout_gen->addWidget(_autoStartCheckBox, 2, 1);
357 layout_gen->addWidget(new QLabel("General settings for logfile and file handling."), 3, 0, 1, 50, Qt::AlignLeft);
[958]358
359 tab_gen->setLayout(layout_gen);
360
[1668]361 // RINEX Ephemeris Tab
362 // -------------------
[1083]363 QWidget* tab_eph = new QWidget();
[1084]364 tabs->addTab(tab_eph, "RINEX Ephemeris");
[958]365
[1083]366 QGridLayout* layout_eph = new QGridLayout;
[1668]367
[1083]368 layout_eph->setColumnMinimumWidth(0, 9*ww);
[1668]369 _ephPortLineEdit->setMaximumWidth(9*ww);
[958]370
[1083]371 layout_eph->addWidget(new QLabel("Host"), 0, 0);
[1668]372 layout_eph->addWidget(_ephHostLineEdit, 0, 1, 1, 10);
[1083]373 layout_eph->addWidget(new QLabel("Port"), 1, 0);
374 layout_eph->addWidget(_ephPortLineEdit, 1, 1);
[1089]375 layout_eph->addWidget(new QLabel("Save (full path)"), 2, 0);
[1668]376 layout_eph->addWidget(_ephEchoLineEdit, 2, 1, 1, 26);
377 layout_eph->addWidget(new QLabel("Read broadcast ephemeris in RINEX Version 3 Navigation format."), 3, 0, 1, 50, Qt::AlignLeft);
[958]378
[1083]379 tab_eph->setLayout(layout_eph);
[958]380
[1696]381 connect(_ephHostLineEdit, SIGNAL(textChanged(const QString &)),
382 this, SLOT(bnsText(const QString &)));
383 if (_ephHostLineEdit->text().isEmpty()) {
384 _ephPortLineEdit->setStyleSheet("background-color: lightGray");
385 _ephEchoLineEdit->setStyleSheet("background-color: lightGray");
386 _ephPortLineEdit->setEnabled(false);
387 _ephEchoLineEdit->setEnabled(false);
388 }
389
[1668]390 // Clocks & Orbits Tab
391 // -------------------
[1083]392 QWidget* tab_co = new QWidget();
393 tabs->addTab(tab_co,"Clocks && Orbits");
394
[1668]395 QGridLayout* layout_co = new QGridLayout;
[1083]396
397 layout_co->setColumnMinimumWidth(0, 9*ww);
[1668]398 _clkPortLineEdit->setMaximumWidth(9*ww);
[1083]399
400 layout_co->addWidget(new QLabel("Listening port"), 0, 0);
401 layout_co->addWidget(_clkPortLineEdit, 0, 1);
[1668]402 layout_co->addWidget(new QLabel("Save (full path) "), 1, 0);
[1083]403 layout_co->addWidget(_inpEchoLineEdit, 1, 1);
[1668]404 layout_co->addWidget(new QLabel("Read clocks and orbits in SP3 format."), 2, 0, 1, 50, Qt::AlignLeft);
[1083]405 layout_co->addWidget(new QLabel(""), 3, 0);
406
407 tab_co->setLayout(layout_co);
408
[1696]409 connect(_clkPortLineEdit, SIGNAL(textChanged(const QString &)),
410 this, SLOT(bnsText(const QString &)));
411 if (_clkPortLineEdit->text().isEmpty()) {
412 _inpEchoLineEdit->setStyleSheet("background-color: lightGray");
413 _inpEchoLineEdit->setEnabled(false);
414 }
415
[1682]416 // Broadcast Corrections I Tab
[1668]417 // ---------------------------
[1249]418 QWidget* tab_cas1 = new QWidget();
[1682]419 tabs->addTab(tab_cas1, "Broadcast Corrections I");
[813]420
[1249]421 QGridLayout* layout_cas1 = new QGridLayout;
[1668]422
[1249]423 layout_cas1->setColumnMinimumWidth(0, 9*ww);
[1668]424 _outPort_1_LineEdit->setMaximumWidth(9*ww);
425 _password_1_LineEdit->setMaximumWidth(9*ww);
426 _mountpoint_1_LineEdit->setMaximumWidth(12*ww);
427 _refSys_1_ComboBox->setMaximumWidth(12*ww);
[845]428
[1668]429 layout_cas1->addWidget(new QLabel("Host"), 0, 0);
430 layout_cas1->addWidget(_outHost_1_LineEdit, 0, 1, 1, 3);
431 layout_cas1->addWidget(new QLabel(" Port"), 0, 4, Qt::AlignRight);
[1699]432 layout_cas1->addWidget(_outPort_1_LineEdit, 0, 5, 1, 10);
[1668]433 layout_cas1->addWidget(new QLabel("Mountpoint"), 1, 0);
434 layout_cas1->addWidget(_mountpoint_1_LineEdit, 1, 1);
435 layout_cas1->addWidget(new QLabel("Password"), 1, 2, Qt::AlignRight);
436 layout_cas1->addWidget(_password_1_LineEdit, 1, 3);
437 layout_cas1->addWidget(new QLabel(" "), 1, 4);
438 layout_cas1->addWidget(new QLabel(" "), 1, 5);
439 layout_cas1->addWidget(new QLabel("System"), 2, 0);
440 layout_cas1->addWidget(_refSys_1_ComboBox, 2, 1);
441 layout_cas1->addWidget(new QLabel(" Save (full path)"), 2, 2, Qt::AlignRight);
442 layout_cas1->addWidget(_outFile_1_LineEdit, 2, 3, 1, 30);
[1670]443 layout_cas1->addWidget(new QLabel("Broadcast clocks"), 3, 0);
444 layout_cas1->addWidget(_beClocks1CheckBox, 3, 1);
445 layout_cas1->addWidget(new QLabel("Produce broadcast ephemeris corrections, upload to caster, reference system, local storage."), 4, 0, 1, 50);
[1668]446
[1249]447 tab_cas1->setLayout(layout_cas1);
[1771]448 connect(_refSys_1_ComboBox, SIGNAL(currentIndexChanged(const QString &)),
449 this, SLOT(customTrafo(const QString)));
[1668]450 connect(_outHost_1_LineEdit, SIGNAL(textChanged(const QString &)),
451 this, SLOT(bnsText(const QString &)));
452 if (_outHost_1_LineEdit->text().isEmpty()) {
453 _outPort_1_LineEdit->setStyleSheet("background-color: lightGray");
454 _mountpoint_1_LineEdit->setStyleSheet("background-color: lightGray");
455 _password_1_LineEdit->setStyleSheet("background-color: lightGray");
456 _outFile_1_LineEdit->setStyleSheet("background-color: lightGray");
457 _refSys_1_ComboBox->setStyleSheet("background-color: lightGray");
[1671]458 palette.setColor(_beClocks1CheckBox->backgroundRole(), lightGray);
459 _beClocks1CheckBox->setPalette(palette);
[1668]460 _outPort_1_LineEdit->setEnabled(false);
461 _mountpoint_1_LineEdit->setEnabled(false);
462 _password_1_LineEdit->setEnabled(false);
463 _outFile_1_LineEdit->setEnabled(false);
464 _refSys_1_ComboBox->setEnabled(false);
[1671]465 _beClocks1CheckBox->setEnabled(false);
[1668]466 }
467
[1682]468 // Broadcast Corrections II Tab
[1668]469 // ----------------------------
[1249]470 QWidget* tab_cas2 = new QWidget();
[1682]471 tabs->addTab(tab_cas2, "Broadcast Corrections II");
[1068]472
[1249]473 QGridLayout* layout_cas2 = new QGridLayout;
[1668]474
[1249]475 layout_cas2->setColumnMinimumWidth(0, 9*ww);
[1668]476 _outPort_2_LineEdit->setMaximumWidth(9*ww);
477 _password_2_LineEdit->setMaximumWidth(9*ww);
478 _mountpoint_2_LineEdit->setMaximumWidth(12*ww);
479 _refSys_2_ComboBox->setMaximumWidth(12*ww);
[1068]480
[1668]481 layout_cas2->addWidget(new QLabel("Host"), 0, 0);
482 layout_cas2->addWidget(_outHost_2_LineEdit, 0, 1, 1, 3);
483 layout_cas2->addWidget(new QLabel(" Port"), 0, 4, Qt::AlignRight);
[1699]484 layout_cas2->addWidget(_outPort_2_LineEdit, 0, 5, 1, 10);
[1668]485 layout_cas2->addWidget(new QLabel("Mountpoint"), 1, 0);
486 layout_cas2->addWidget(_mountpoint_2_LineEdit, 1, 1);
487 layout_cas2->addWidget(new QLabel("Password"), 1, 2, Qt::AlignRight);
488 layout_cas2->addWidget(_password_2_LineEdit, 1, 3);
489 layout_cas2->addWidget(new QLabel(" "), 1, 4);
490 layout_cas2->addWidget(new QLabel(" "), 1, 5);
491 layout_cas2->addWidget(new QLabel("System"), 2, 0);
492 layout_cas2->addWidget(_refSys_2_ComboBox, 2, 1);
493 layout_cas2->addWidget(new QLabel(" Save (full path)"), 2, 2, Qt::AlignRight);
494 layout_cas2->addWidget(_outFile_2_LineEdit, 2, 3, 1, 30);
[1670]495 layout_cas2->addWidget(new QLabel("Broadcast clocks"), 3, 0);
496 layout_cas2->addWidget(_beClocks2CheckBox, 3, 1);
497 layout_cas2->addWidget(new QLabel("Produce broadcast ephemeris corrections, upload to caster, reference system, local storage."), 4, 0, 1, 50);
[1668]498
[1249]499 tab_cas2->setLayout(layout_cas2);
[1771]500 connect(_refSys_2_ComboBox, SIGNAL(currentIndexChanged(const QString &)),
501 this, SLOT(customTrafo(const QString)));
[1668]502 connect(_outHost_2_LineEdit, SIGNAL(textChanged(const QString &)),
503 this, SLOT(bnsText(const QString &)));
504 if (_outHost_2_LineEdit->text().isEmpty()) {
505 _outPort_2_LineEdit->setStyleSheet("background-color: lightGray");
506 _mountpoint_2_LineEdit->setStyleSheet("background-color: lightGray");
507 _password_2_LineEdit->setStyleSheet("background-color: lightGray");
508 _outFile_2_LineEdit->setStyleSheet("background-color: lightGray");
509 _refSys_2_ComboBox->setStyleSheet("background-color: lightGray");
[1671]510 palette.setColor(_beClocks2CheckBox->backgroundRole(), lightGray);
511 _beClocks2CheckBox->setPalette(palette);
[1668]512 _outPort_2_LineEdit->setEnabled(false);
513 _mountpoint_2_LineEdit->setEnabled(false);
514 _password_2_LineEdit->setEnabled(false);
515 _outFile_2_LineEdit->setEnabled(false);
516 _refSys_2_ComboBox->setEnabled(false);
[1671]517 _beClocks2CheckBox->setEnabled(false);
[1668]518 }
519
[1728]520 // Broadcast Corrections III Tab
521 // -----------------------------
522 QWidget* tab_cas3 = new QWidget();
523 tabs->addTab(tab_cas3, "Broadcast Corrections III");
524
525 QGridLayout* layout_cas3 = new QGridLayout;
526
527 layout_cas3->setColumnMinimumWidth(0, 9*ww);
528 _outPort_3_LineEdit->setMaximumWidth(9*ww);
529 _password_3_LineEdit->setMaximumWidth(9*ww);
530 _mountpoint_3_LineEdit->setMaximumWidth(12*ww);
531 _refSys_3_ComboBox->setMaximumWidth(12*ww);
532
533 layout_cas3->addWidget(new QLabel("Host"), 0, 0);
534 layout_cas3->addWidget(_outHost_3_LineEdit, 0, 1, 1, 3);
535 layout_cas3->addWidget(new QLabel(" Port"), 0, 4, Qt::AlignRight);
536 layout_cas3->addWidget(_outPort_3_LineEdit, 0, 5, 1, 10);
537 layout_cas3->addWidget(new QLabel("Mountpoint"), 1, 0);
538 layout_cas3->addWidget(_mountpoint_3_LineEdit, 1, 1);
539 layout_cas3->addWidget(new QLabel("Password"), 1, 2, Qt::AlignRight);
540 layout_cas3->addWidget(_password_3_LineEdit, 1, 3);
541 layout_cas3->addWidget(new QLabel(" "), 1, 4);
542 layout_cas3->addWidget(new QLabel(" "), 1, 5);
543 layout_cas3->addWidget(new QLabel("System"), 2, 0);
544 layout_cas3->addWidget(_refSys_3_ComboBox, 2, 1);
545 layout_cas3->addWidget(new QLabel(" Save (full path)"), 2, 2, Qt::AlignRight);
546 layout_cas3->addWidget(_outFile_3_LineEdit, 2, 3, 1, 30);
547 layout_cas3->addWidget(new QLabel("Broadcast clocks"), 3, 0);
548 layout_cas3->addWidget(_beClocks3CheckBox, 3, 1);
549 layout_cas3->addWidget(new QLabel("Produce broadcast ephemeris corrections, upload to caster, reference system, local storage."), 4, 0, 1, 50);
550
551 tab_cas3->setLayout(layout_cas3);
[1771]552 connect(_refSys_3_ComboBox, SIGNAL(currentIndexChanged(const QString &)),
553 this, SLOT(customTrafo(const QString)));
[1728]554 connect(_outHost_3_LineEdit, SIGNAL(textChanged(const QString &)),
555 this, SLOT(bnsText(const QString &)));
556 if (_outHost_3_LineEdit->text().isEmpty()) {
557 _outPort_3_LineEdit->setStyleSheet("background-color: lightGray");
558 _mountpoint_3_LineEdit->setStyleSheet("background-color: lightGray");
559 _password_3_LineEdit->setStyleSheet("background-color: lightGray");
560 _outFile_3_LineEdit->setStyleSheet("background-color: lightGray");
561 _refSys_3_ComboBox->setStyleSheet("background-color: lightGray");
562 palette.setColor(_beClocks3CheckBox->backgroundRole(), lightGray);
563 _beClocks3CheckBox->setPalette(palette);
564 _outPort_3_LineEdit->setEnabled(false);
565 _mountpoint_3_LineEdit->setEnabled(false);
566 _password_3_LineEdit->setEnabled(false);
567 _outFile_3_LineEdit->setEnabled(false);
568 _refSys_3_ComboBox->setEnabled(false);
569 _beClocks3CheckBox->setEnabled(false);
570 }
571
[1795]572 // Broadcast Ephemerides
573 // ---------------------
574 QWidget* tab_casEph = new QWidget();
575 tabs->addTab(tab_casEph, "Broadcast Ephemerides");
576
577 QGridLayout* layout_casEph = new QGridLayout;
578
579 layout_casEph->setColumnMinimumWidth(0, 9*ww);
580 _outPort_Eph_LineEdit->setMaximumWidth(9*ww);
581 _password_Eph_LineEdit->setMaximumWidth(9*ww);
582 _mountpoint_Eph_LineEdit->setMaximumWidth(12*ww);
583
584 layout_casEph->addWidget(new QLabel("Host"), 0, 0);
585 layout_casEph->addWidget(_outHost_Eph_LineEdit, 0, 1, 1, 3);
586 layout_casEph->addWidget(new QLabel(" Port"), 0, 4, Qt::AlignRight);
587 layout_casEph->addWidget(_outPort_Eph_LineEdit, 0, 5, 1, 10);
588 layout_casEph->addWidget(new QLabel("Mountpoint"), 1, 0);
589 layout_casEph->addWidget(_mountpoint_Eph_LineEdit, 1, 1);
590 layout_casEph->addWidget(new QLabel("Password"), 1, 2, Qt::AlignRight);
591 layout_casEph->addWidget(_password_Eph_LineEdit, 1, 3);
592 layout_casEph->addWidget(new QLabel("Concatenated Broadcast Ephemerides"), 2, 0, 1, 50);
593
594 tab_casEph->setLayout(layout_casEph);
595 connect(_outHost_Eph_LineEdit, SIGNAL(textChanged(const QString &)),
596 this, SLOT(bnsText(const QString &)));
597 if (_outHost_Eph_LineEdit->text().isEmpty()) {
598 _outPort_Eph_LineEdit->setStyleSheet("background-color: lightGray");
599 _mountpoint_Eph_LineEdit->setStyleSheet("background-color: lightGray");
600 _password_Eph_LineEdit->setStyleSheet("background-color: lightGray");
601 _outPort_Eph_LineEdit->setEnabled(false);
602 _mountpoint_Eph_LineEdit->setEnabled(false);
603 _password_Eph_LineEdit->setEnabled(false);
604 }
605
[1668]606 // RINEX Clocks Tab
607 // ----------------
[845]608 QWidget* tab_rin = new QWidget();
[958]609 tabs->addTab(tab_rin, "RINEX Clocks ");
[845]610
611 QGridLayout* layout_rin = new QGridLayout;
[1668]612
[958]613 layout_rin->setColumnMinimumWidth(0, 9*ww);
[1668]614 _rnxIntrComboBox->setMaximumWidth(9*ww);
[845]615
[958]616 layout_rin->addWidget(new QLabel("Directory"), 0, 0);
[1668]617 layout_rin->addWidget(_rnxPathLineEdit, 0, 1, 1, 27);
[958]618 layout_rin->addWidget(new QLabel("Interval"), 1, 0);
619 layout_rin->addWidget(_rnxIntrComboBox, 1, 1);
620 layout_rin->addWidget(new QLabel("Sampling"), 2, 0);
621 layout_rin->addWidget(_rnxSamplSpinBox, 2, 1);
[1668]622 layout_rin->addWidget(new QLabel("Save clock corrections in Clock RINEX file format."), 3, 0, 1, 50, Qt::AlignLeft);
623 layout_rin->addWidget(new QLabel(" "), 3, 0);
[845]624
625 tab_rin->setLayout(layout_rin);
626
[1668]627 connect(_rnxPathLineEdit, SIGNAL(textChanged(const QString &)),
628 this, SLOT(bnsText(const QString &)));
629 if (_rnxPathLineEdit->text().isEmpty()) {
630 _rnxIntrComboBox->setStyleSheet("background-color: lightGray");
631 _rnxSamplSpinBox->setStyleSheet("background-color: lightGray");
632 _rnxIntrComboBox->setEnabled(false);
633 _rnxSamplSpinBox->setEnabled(false);
634 }
635
636 // SP3 Orbits Tab
637 // --------------
[958]638 QWidget* tab_sp3 = new QWidget();
639 tabs->addTab(tab_sp3, "SP3 Orbits");
640
641 QGridLayout* layout_sp3 = new QGridLayout;
[1668]642
[958]643 layout_sp3->setColumnMinimumWidth(0, 9*ww);
[1668]644 _sp3IntrComboBox->setMaximumWidth(9*ww);
[958]645
646 layout_sp3->addWidget(new QLabel("Directory"), 0, 0);
[1668]647 layout_sp3->addWidget(_sp3PathLineEdit, 0, 1, 1, 27);
[958]648 layout_sp3->addWidget(new QLabel("Interval"), 1, 0);
649 layout_sp3->addWidget(_sp3IntrComboBox, 1, 1);
650 layout_sp3->addWidget(new QLabel("Sampling"), 2, 0);
651 layout_sp3->addWidget(_sp3SamplSpinBox, 2, 1);
[1668]652 layout_sp3->addWidget(new QLabel("Save orbit corrections in SP3 file format."), 3, 0, 1, 50, Qt::AlignLeft);
653 layout_sp3->addWidget(new QLabel(" "), 3, 0);
[958]654
655 tab_sp3->setLayout(layout_sp3);
656
[1668]657 connect(_sp3PathLineEdit, SIGNAL(textChanged(const QString &)),
658 this, SLOT(bnsText(const QString &)));
659 if (_sp3PathLineEdit->text().isEmpty()) {
660 _sp3IntrComboBox->setStyleSheet("background-color: lightGray");
661 _sp3SamplSpinBox->setStyleSheet("background-color: lightGray");
662 _sp3IntrComboBox->setEnabled(false);
663 _sp3SamplSpinBox->setEnabled(false);
664 }
665
666 tabs->setCurrentIndex(settings.value("startTab").toInt());
667
[750]668 // Log
669 // ---
670 _log = new QTextBrowser();
671 _log->setReadOnly(true);
672 _log->setWhatsThis(tr("Records of BNS's activities are shown in the Log section."));
673
[1058]674 // Status
675 // ------
[1083]676 _status = new QGroupBox(tr("Status"));
[1058]677 QGridLayout* layout_status = new QGridLayout;
678
679 _statusLbl[0] = new QLabel("0 byte(s)"); _statusCnt[0] = 0;
680 _statusLbl[1] = new QLabel("0 byte(s)"); _statusCnt[1] = 0;
681 _statusLbl[2] = new QLabel("0 byte(s)"); _statusCnt[2] = 0;
[1728]682 _statusLbl[3] = new QLabel("0 byte(s)"); _statusCnt[3] = 0;
683 _statusLbl[9] = new QLabel("0 byte(s)"); _statusCnt[4] = 0;
[1262]684 _statusLbl[7] = new QLabel("RINEX Ephemeris:");
[1083]685 _statusLbl[4] = new QLabel("Clocks & Orbits:");
[1682]686 _statusLbl[5] = new QLabel("Broadcast Corrections I:");
687 _statusLbl[6] = new QLabel("Broadcast Corrections II:");
[1728]688 _statusLbl[8] = new QLabel("Broadcast Corrections III:");
[1058]689
[1083]690 _statusLbl[0]->setWhatsThis(tr("Status of incoming broadcast ephemeris."));
691 _statusLbl[1]->setWhatsThis(tr("Status of incoming stream of clocks and orbits."));
692 _statusLbl[2]->setWhatsThis(tr("Status of outgoing stream to NTRIP broadcaster."));
[1262]693 _statusLbl[7]->setWhatsThis(tr("Status of incoming broadcast ephemeris."));
[1258]694 _statusLbl[4]->setWhatsThis(tr("Status of incoming stream of clocks and orbits I."));
695 _statusLbl[5]->setWhatsThis(tr("Status of outgoing stream to NTRIP broadcaster I."));
696 _statusLbl[6]->setWhatsThis(tr("Status of outgoing stream to NTRIP broadcaster II."));
[1262]697 _statusLbl[3]->setWhatsThis(tr("Status of outgoing stream to NTRIP broadcaster II."));
[1728]698 _statusLbl[8]->setWhatsThis(tr("Status of outgoing stream to NTRIP broadcaster III."));
[1083]699
[1262]700 layout_status->addWidget(_statusLbl[7], 0, 0);
[1058]701 layout_status->addWidget(_statusLbl[0], 0, 1);
[1728]702 layout_status->addWidget(_statusLbl[5], 0, 2);
703 layout_status->addWidget(_statusLbl[2], 0, 3);
[1083]704 layout_status->addWidget(_statusLbl[4], 1, 0);
705 layout_status->addWidget(_statusLbl[1], 1, 1);
[1256]706 layout_status->addWidget(_statusLbl[6], 1, 2);
[1262]707 layout_status->addWidget(_statusLbl[3], 1, 3);
[1728]708 layout_status->addWidget(_statusLbl[8], 2, 2);
709 layout_status->addWidget(_statusLbl[9], 2, 3);
[1058]710 _status->setLayout(layout_status);
711
[750]712 // Main Layout
713 // -----------
714 QVBoxLayout* mainLayout = new QVBoxLayout;
715 mainLayout->addWidget(tabs);
716 mainLayout->addWidget(_log);
[1058]717 mainLayout->addWidget(_status);
[750]718
719 _canvas->setLayout(mainLayout);
[1668]720
721 // Auto start
722 // ----------
723 if ( Qt::CheckState(settings.value("autoStart").toInt()) == Qt::Checked) {
724 slotStart();
725 }
726
[748]727}
728
729// Destructor
730////////////////////////////////////////////////////////////////////////////
731bnsWindow::~bnsWindow() {
732}
733
734// Close Application gracefully
735////////////////////////////////////////////////////////////////////////////
736void bnsWindow::closeEvent(QCloseEvent* event) {
[749]737
738int iRet = QMessageBox::question(this, "Close", "Save Options?",
739 QMessageBox::Yes, QMessageBox::No,
740 QMessageBox::Cancel);
741
742 if (iRet == QMessageBox::Cancel) {
743 event->ignore();
744 return;
745 }
746 else if (iRet == QMessageBox::Yes) {
747 slotSaveOptions();
748 }
749
[748]750 QMainWindow::closeEvent(event);
751}
752
[749]753// About Message
754////////////////////////////////////////////////////////////////////////////
755void bnsWindow::slotAbout() {
756 new bnsAboutDlg(0);
757}
758
[1668]759// Flowchart
[998]760////////////////////////////////////////////////////////////////////////////
761void bnsWindow::slotFlowchart() {
762 new bnsFlowchartDlg(0);
763}
764
[749]765// Help Window
766////////////////////////////////////////////////////////////////////////////
767void bnsWindow::slotHelp() {
768 QUrl url;
769 url.setPath(":bnshelp.html");
770 new bnsHlpDlg(0, url);
771}
772
773// Select Fonts
774////////////////////////////////////////////////////////////////////////////
775void bnsWindow::slotFontSel() {
776 bool ok;
777 QFont newFont = QFontDialog::getFont(&ok, this->font(), this);
778 if (ok) {
[1668]779 bnsSettings settings;
[749]780 settings.setValue("font", newFont.toString());
781 QApplication::setFont(newFont);
782 int ww = QFontMetrics(newFont).width('w');
[752]783 setMinimumSize(77*ww, 65*ww);
[749]784 }
785}
786
787// Whats This Help
788////////////////////////////////////////////////////////////////////////////
789void bnsWindow::slotWhatsThis() {
790QWhatsThis::enterWhatsThisMode();
791}
792
793// Create Menus
794////////////////////////////////////////////////////////////////////////////
795void bnsWindow::CreateMenu() {
796 _menuFile = menuBar()->addMenu(tr("&File"));
797 _menuFile->addAction(_actFontSel);
798 _menuFile->addSeparator();
799 _menuFile->addAction(_actSaveOpt);
800 _menuFile->addSeparator();
801 _menuFile->addAction(_actQuit);
802
803 _menuHlp = menuBar()->addMenu(tr("&Help"));
804 _menuHlp->addAction(_actHelp);
[998]805 _menuHlp->addAction(_actFlowchart);
[749]806 _menuHlp->addAction(_actAbout);
807}
808
809// Tool (Command) Bar
810////////////////////////////////////////////////////////////////////////////
811void bnsWindow::AddToolbar() {
812 QToolBar* toolBar = new QToolBar;
813 addToolBar(Qt::BottomToolBarArea, toolBar);
814 toolBar->setMovable(false);
[753]815 toolBar->addAction(_actStart);
816 toolBar->addAction(_actStop);
[749]817 toolBar->addWidget(new QLabel(" "));
[753]818 toolBar->addAction(_actWhatsThis);
[749]819}
820
821// Save Options
822////////////////////////////////////////////////////////////////////////////
823void bnsWindow::slotSaveOptions() {
[1668]824 bnsSettings settings;
[1249]825 settings.setValue("proxyHost", _proxyHostLineEdit->text());
826 settings.setValue("proxyPort", _proxyPortLineEdit->text());
[1728]827
[1249]828 settings.setValue("logFile", _logFileLineEdit->text());
829 settings.setValue("fileAppend", _fileAppendCheckBox->checkState());
[1668]830 settings.setValue("autoStart", _autoStartCheckBox->checkState());
[1728]831
[1249]832 settings.setValue("ephHost", _ephHostLineEdit->text());
833 settings.setValue("ephPort", _ephPortLineEdit->text());
834 settings.setValue("ephEcho", _ephEchoLineEdit->text());
[1728]835
[1249]836 settings.setValue("clkPort", _clkPortLineEdit->text());
[1728]837 settings.setValue("inpEcho", _inpEchoLineEdit->text());
838
[1249]839 settings.setValue("outHost1", _outHost_1_LineEdit->text());
840 settings.setValue("outPort1", _outPort_1_LineEdit->text());
[1728]841 settings.setValue("mountpoint_1",_mountpoint_1_LineEdit->text());
842 settings.setValue("password1", _password_1_LineEdit->text());
843 settings.setValue("refSys_1", _refSys_1_ComboBox->currentText());
844 settings.setValue("outFile_1", _outFile_1_LineEdit->text());
845 settings.setValue("beClocks1", _beClocks1CheckBox->checkState());
846
[1251]847 settings.setValue("outHost2", _outHost_2_LineEdit->text());
848 settings.setValue("outPort2", _outPort_2_LineEdit->text());
[1249]849 settings.setValue("mountpoint_2",_mountpoint_2_LineEdit->text());
[1728]850 settings.setValue("password2", _password_2_LineEdit->text());
851 settings.setValue("refSys_2", _refSys_2_ComboBox->currentText());
[1249]852 settings.setValue("outFile_2", _outFile_2_LineEdit->text());
[1728]853 settings.setValue("beClocks2", _beClocks2CheckBox->checkState());
854
855 settings.setValue("outHost3", _outHost_3_LineEdit->text());
856 settings.setValue("outPort3", _outPort_3_LineEdit->text());
857 settings.setValue("mountpoint_3",_mountpoint_3_LineEdit->text());
858 settings.setValue("password3", _password_3_LineEdit->text());
859 settings.setValue("refSys_3", _refSys_3_ComboBox->currentText());
860 settings.setValue("outFile_3", _outFile_3_LineEdit->text());
861 settings.setValue("beClocks3", _beClocks2CheckBox->checkState());
[1795]862
863 settings.setValue("outHostEph", _outHost_Eph_LineEdit->text());
864 settings.setValue("outPortEph", _outPort_Eph_LineEdit->text());
865 settings.setValue("mountpoint_Eph",_mountpoint_Eph_LineEdit->text());
866 settings.setValue("passwordEph", _password_Eph_LineEdit->text());
867
[1249]868 settings.setValue("rnxPath", _rnxPathLineEdit->text());
869 settings.setValue("rnxIntr", _rnxIntrComboBox->currentText());
870 settings.setValue("rnxSampl", _rnxSamplSpinBox->value());
[1728]871
[1249]872 settings.setValue("sp3Path", _sp3PathLineEdit->text());
873 settings.setValue("sp3Intr", _sp3IntrComboBox->currentText());
874 settings.setValue("sp3Sampl", _sp3SamplSpinBox->value());
[1728]875
[1668]876 settings.setValue("startTab", tabs->currentIndex());
[749]877}
878
[750]879// Display Program Messages
880////////////////////////////////////////////////////////////////////////////
881void bnsWindow::slotMessage(const QByteArray msg) {
882
883 const int maxBufferSize = 10000;
884
885 QString txt = _log->toPlainText() + "\n" +
886 QDateTime::currentDateTime().toUTC().toString("yy-MM-dd hh:mm:ss ") + msg;
887 _log->clear();
888 _log->append(txt.right(maxBufferSize));
889}
[753]890
[760]891// Delete bns
892////////////////////////////////////////////////////////////////////////////
893void bnsWindow::deleteBns() {
894 _actStart->setEnabled(true);
895 _actStop->setEnabled(false);
[762]896 _bns->terminate();
[764]897 _bns->wait(100);
[760]898 delete _bns;
899 _bns = 0;
900}
901
902// Error in bns
903////////////////////////////////////////////////////////////////////////////
904void bnsWindow::slotError(const QByteArray msg) {
905 slotMessage(msg);
906 deleteBns();
907}
908
[753]909// Stop
910////////////////////////////////////////////////////////////////////////////
911void bnsWindow::slotStop() {
912 int iRet = QMessageBox::question(this, "Stop", "Do you want to stop?",
913 QMessageBox::Yes, QMessageBox::No,
914 QMessageBox::NoButton);
915 if (iRet == QMessageBox::Yes) {
[760]916 deleteBns();
[753]917 }
918}
919
920// Start
921////////////////////////////////////////////////////////////////////////////
922void bnsWindow::slotStart() {
923 slotSaveOptions();
924
925 _actStart->setEnabled(false);
926 _actStop->setEnabled(true);
927
[758]928 _bns = new t_bns(0);
[760]929
[758]930 connect(_bns, SIGNAL(newMessage(QByteArray)),
931 this, SLOT(slotMessage(const QByteArray)));
[760]932
933 connect(_bns, SIGNAL(error(QByteArray)),
934 this, SLOT(slotError(const QByteArray)));
935
[1058]936 connect(_bns, SIGNAL(newEphBytes(int)), this, SLOT(slotEphBytes(int)));
937 connect(_bns, SIGNAL(newClkBytes(int)), this, SLOT(slotClkBytes(int)));
[1258]938 connect(_bns, SIGNAL(newOutBytes1(int)), this, SLOT(slotOutBytes1(int)));
939 connect(_bns, SIGNAL(newOutBytes2(int)), this, SLOT(slotOutBytes2(int)));
[1728]940 connect(_bns, SIGNAL(newOutBytes3(int)), this, SLOT(slotOutBytes3(int)));
[1058]941
[757]942 _bns->start();
[753]943}
[1058]944
945// Input and output bytes statistics
946////////////////////////////////////////////////////////////////////////////
947void bnsWindow::slotEphBytes(int nBytes) {
948 updateStatus(0, nBytes);
949}
950void bnsWindow::slotClkBytes(int nBytes) {
951 updateStatus(1, nBytes);
952}
[1258]953void bnsWindow::slotOutBytes1(int nBytes) {
[1058]954 updateStatus(2, nBytes);
955}
[1258]956void bnsWindow::slotOutBytes2(int nBytes) {
957 updateStatus(3, nBytes);
958}
[1728]959void bnsWindow::slotOutBytes3(int nBytes) {
960 updateStatus(4, nBytes);
961}
[1058]962
963void bnsWindow::updateStatus(int ii, int nBytes) {
964 QMutexLocker locker(&_mutex);
965
966 _statusCnt[ii] += nBytes;
967
968 if (_statusCnt[ii] < 1e3) {
969 _statusLbl[ii]->setText(QString("%1 byte(s)").arg((int)_statusCnt[ii]));
970 }
971 else if (_statusCnt[ii] < 1e6) {
972 _statusLbl[ii]->setText(QString("%1 kb").arg(_statusCnt[ii]/1.e3, 5));
973 }
974 else {
975 _statusLbl[ii]->setText(QString("%1 Mb").arg(_statusCnt[ii]/1.e6, 5));
976 }
977}
[1668]978
979// Bns Text
980////////////////////////////////////////////////////////////////////////////
981void bnsWindow::bnsText(const QString &text){
982
983 bool isEmpty = text.isEmpty();
984
985 QPalette palette;
986 QColor lightGray(230, 230, 230);
987 QColor white(255, 255, 255);
988
989 // Enable/disable Proxy Options
[1696]990 // ----------------------------
[1668]991 if (tabs->currentIndex() == 0) {
992 if (!isEmpty) {
993 _proxyPortLineEdit->setStyleSheet("background-color: white");
994 _proxyPortLineEdit->setEnabled(true);
995 } else {
996 _proxyPortLineEdit->setStyleSheet("background-color: lightGray");
997 _proxyPortLineEdit->setEnabled(false);
998 }
999 }
1000
[1696]1001 // Enable/disable RINEX Ephemeris Options
1002 // --------------------------------------
1003 if (tabs->currentIndex() == 2) {
1004 if (!isEmpty) {
1005 _ephPortLineEdit->setStyleSheet("background-color: white");
1006 _ephEchoLineEdit->setStyleSheet("background-color: white");
[1771]1007 _ephPortLineEdit->setEnabled(true);
[1696]1008 _ephEchoLineEdit->setEnabled(true);
1009 } else {
1010 _ephPortLineEdit->setStyleSheet("background-color: lightGray");
1011 _ephEchoLineEdit->setStyleSheet("background-color: lightGray");
[1771]1012 _ephPortLineEdit->setEnabled(false);
[1696]1013 _ephEchoLineEdit->setEnabled(false);
1014 }
1015 }
1016
1017 // Enable/disable Clocks & Orbits Options
1018 // --------------------------------------
1019 if (tabs->currentIndex() == 3) {
1020 if (!isEmpty) {
1021 _inpEchoLineEdit->setStyleSheet("background-color: white");
1022 _inpEchoLineEdit->setEnabled(true);
1023 } else {
1024 _inpEchoLineEdit->setStyleSheet("background-color: lightGray");
1025 _inpEchoLineEdit->setEnabled(false);
1026 }
1027 }
1028
[1682]1029 // Enable/disable Broadcast Corrections I Options
[1668]1030 // -----------------------------------------------
1031 if (tabs->currentIndex() == 4) {
1032 if (!isEmpty) {
1033 _outPort_1_LineEdit->setStyleSheet("background-color: white");
1034 _mountpoint_1_LineEdit->setStyleSheet("background-color: white");
1035 _password_1_LineEdit->setStyleSheet("background-color: white");
1036 _outFile_1_LineEdit->setStyleSheet("background-color: white");
1037 _refSys_1_ComboBox->setStyleSheet("background-color: white");
[1671]1038 palette.setColor(_beClocks1CheckBox->backgroundRole(), white);
1039 _beClocks1CheckBox->setPalette(palette);
[1668]1040 _outPort_1_LineEdit->setEnabled(true);
1041 _mountpoint_1_LineEdit->setEnabled(true);
1042 _password_1_LineEdit->setEnabled(true);
1043 _outFile_1_LineEdit->setEnabled(true);
1044 _refSys_1_ComboBox->setEnabled(true);
[1671]1045 _beClocks1CheckBox->setEnabled(true);
[1668]1046 } else {
1047 _outPort_1_LineEdit->setStyleSheet("background-color: lightGray");
1048 _mountpoint_1_LineEdit->setStyleSheet("background-color: lightGray");
1049 _password_1_LineEdit->setStyleSheet("background-color: lightGray");
1050 _outFile_1_LineEdit->setStyleSheet("background-color: lightGray");
1051 _refSys_1_ComboBox->setStyleSheet("background-color: lightGray");
[1671]1052 palette.setColor(_beClocks1CheckBox->backgroundRole(), lightGray);
1053 _beClocks1CheckBox->setPalette(palette);
[1668]1054 _outPort_1_LineEdit->setEnabled(false);
1055 _mountpoint_1_LineEdit->setEnabled(false);
1056 _password_1_LineEdit->setEnabled(false);
1057 _outFile_1_LineEdit->setEnabled(false);
1058 _refSys_1_ComboBox->setEnabled(false);
[1671]1059 _beClocks1CheckBox->setEnabled(false);
[1668]1060 }
1061 }
1062
[1682]1063 // Enable/disable Broadcast Corrections II Options
[1668]1064 // -----------------------------------------------
1065 if (tabs->currentIndex() == 5) {
1066 if (!isEmpty) {
1067 _outPort_2_LineEdit->setStyleSheet("background-color: white");
1068 _mountpoint_2_LineEdit->setStyleSheet("background-color: white");
1069 _password_2_LineEdit->setStyleSheet("background-color: white");
1070 _outFile_2_LineEdit->setStyleSheet("background-color: white");
1071 _refSys_2_ComboBox->setStyleSheet("background-color: white");
[1671]1072 palette.setColor(_beClocks2CheckBox->backgroundRole(), white);
1073 _beClocks2CheckBox->setPalette(palette);
[1668]1074 _outPort_2_LineEdit->setEnabled(true);
1075 _mountpoint_2_LineEdit->setEnabled(true);
1076 _password_2_LineEdit->setEnabled(true);
1077 _outFile_2_LineEdit->setEnabled(true);
1078 _refSys_2_ComboBox->setEnabled(true);
[1671]1079 _beClocks2CheckBox->setEnabled(true);
[1668]1080 } else {
1081 _outPort_2_LineEdit->setStyleSheet("background-color: lightGray");
1082 _mountpoint_2_LineEdit->setStyleSheet("background-color: lightGray");
1083 _password_2_LineEdit->setStyleSheet("background-color: lightGray");
1084 _outFile_2_LineEdit->setStyleSheet("background-color: lightGray");
1085 _refSys_2_ComboBox->setStyleSheet("background-color: lightGray");
[1671]1086 palette.setColor(_beClocks2CheckBox->backgroundRole(), lightGray);
1087 _beClocks2CheckBox->setPalette(palette);
[1668]1088 _outPort_2_LineEdit->setEnabled(false);
1089 _mountpoint_2_LineEdit->setEnabled(false);
1090 _password_2_LineEdit->setEnabled(false);
1091 _outFile_2_LineEdit->setEnabled(false);
1092 _refSys_2_ComboBox->setEnabled(false);
[1671]1093 _beClocks2CheckBox->setEnabled(false);
[1668]1094 }
1095 }
1096
[1728]1097 // Enable/disable Broadcast Corrections III Options
1098 // -----------------------------------------------
1099 if (tabs->currentIndex() == 6) {
1100 if (!isEmpty) {
1101 _outPort_3_LineEdit->setStyleSheet("background-color: white");
1102 _mountpoint_3_LineEdit->setStyleSheet("background-color: white");
1103 _password_3_LineEdit->setStyleSheet("background-color: white");
1104 _outFile_3_LineEdit->setStyleSheet("background-color: white");
1105 _refSys_3_ComboBox->setStyleSheet("background-color: white");
1106 palette.setColor(_beClocks3CheckBox->backgroundRole(), white);
1107 _beClocks3CheckBox->setPalette(palette);
1108 _outPort_3_LineEdit->setEnabled(true);
1109 _mountpoint_3_LineEdit->setEnabled(true);
1110 _password_3_LineEdit->setEnabled(true);
1111 _outFile_3_LineEdit->setEnabled(true);
1112 _refSys_3_ComboBox->setEnabled(true);
1113 _beClocks3CheckBox->setEnabled(true);
1114 } else {
1115 _outPort_3_LineEdit->setStyleSheet("background-color: lightGray");
1116 _mountpoint_3_LineEdit->setStyleSheet("background-color: lightGray");
1117 _password_3_LineEdit->setStyleSheet("background-color: lightGray");
1118 _outFile_3_LineEdit->setStyleSheet("background-color: lightGray");
1119 _refSys_3_ComboBox->setStyleSheet("background-color: lightGray");
1120 palette.setColor(_beClocks3CheckBox->backgroundRole(), lightGray);
1121 _beClocks3CheckBox->setPalette(palette);
1122 _outPort_3_LineEdit->setEnabled(false);
1123 _mountpoint_3_LineEdit->setEnabled(false);
1124 _password_3_LineEdit->setEnabled(false);
1125 _outFile_3_LineEdit->setEnabled(false);
1126 _refSys_3_ComboBox->setEnabled(false);
1127 _beClocks3CheckBox->setEnabled(false);
1128 }
1129 }
1130
[1795]1131 // Enable/disable Broadcast Ephemerides
1132 // ------------------------------------k-----------
1133 if (tabs->currentIndex() == 7) {
1134 if (!isEmpty) {
1135 _outPort_Eph_LineEdit->setStyleSheet("background-color: white");
1136 _mountpoint_Eph_LineEdit->setStyleSheet("background-color: white");
1137 _password_Eph_LineEdit->setStyleSheet("background-color: white");
1138 _outPort_Eph_LineEdit->setEnabled(true);
1139 _mountpoint_Eph_LineEdit->setEnabled(true);
1140 _password_Eph_LineEdit->setEnabled(true);
1141 } else {
1142 _outPort_Eph_LineEdit->setStyleSheet("background-color: lightGray");
1143 _mountpoint_Eph_LineEdit->setStyleSheet("background-color: lightGray");
1144 _password_Eph_LineEdit->setStyleSheet("background-color: lightGray");
1145 _outPort_Eph_LineEdit->setEnabled(false);
1146 _mountpoint_Eph_LineEdit->setEnabled(false);
1147 _password_Eph_LineEdit->setEnabled(false);
1148 }
1149 }
1150
[1668]1151 // Enable/disable RINEX Clocks Options
1152 // -----------------------------------
[1795]1153 if (tabs->currentIndex() == 8) {
[1668]1154 if (!isEmpty) {
1155 _rnxIntrComboBox->setStyleSheet("background-color: white");
1156 _rnxSamplSpinBox->setStyleSheet("background-color: white");
1157 _rnxIntrComboBox->setEnabled(true);
1158 _rnxSamplSpinBox->setEnabled(true);
1159 } else {
1160 _rnxIntrComboBox->setStyleSheet("background-color: lightGray");
1161 _rnxSamplSpinBox->setStyleSheet("background-color: lightGray");
1162 _rnxIntrComboBox->setEnabled(false);
1163 _rnxSamplSpinBox->setEnabled(false);
1164 }
1165 }
1166
1167 // Enable/disable SP3 Orbits Options
1168 // ---------------------------------
[1795]1169 if (tabs->currentIndex() == 9) {
[1668]1170 if (!isEmpty) {
1171 _sp3IntrComboBox->setStyleSheet("background-color: white");
1172 _sp3SamplSpinBox->setStyleSheet("background-color: white");
1173 _sp3IntrComboBox->setEnabled(true);
1174 _sp3SamplSpinBox->setEnabled(true);
1175 } else {
1176 _sp3IntrComboBox->setStyleSheet("background-color: lightGray");
1177 _sp3SamplSpinBox->setStyleSheet("background-color: lightGray");
1178 _sp3IntrComboBox->setEnabled(false);
1179 _sp3SamplSpinBox->setEnabled(false);
1180 }
1181 }
1182
1183}
[1771]1184
1185// Custom transformation parameters
1186////////////////////////////////////////////////////////////////////////////
1187void bnsWindow::customTrafo(const QString &text){
1188 if (text == "Custom" ) {
1189 bnsCustomTrafo* dlg = new bnsCustomTrafo(this);
1190 dlg->exec();
1191 delete dlg;
1192 }
1193}
1194
Note: See TracBrowser for help on using the repository browser.