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

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

* empty log message *

File size: 42.4 KB
Line 
1
2/* -------------------------------------------------------------------------
3 * BKG NTRIP Server
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
18#include <iostream>
19
20#include "bnswindow.h"
21#include "bnshlpdlg.h"
22#include "bnssettings.h"
23
24using namespace std;
25
26// About Dialog - Constructor
27////////////////////////////////////////////////////////////////////////////
28bnsAboutDlg::bnsAboutDlg(QWidget* parent) :
29 QDialog(parent) {
30
31 QTextBrowser* tb = new QTextBrowser;
32 QUrl url; url.setPath(":bnsabout.html");
33 tb->setSource(url);
34 tb->setReadOnly(true);
35
36 int ww = QFontMetrics(font()).width('w');
37 QPushButton* _closeButton = new QPushButton("Close");
38 _closeButton->setMaximumWidth(10*ww);
39 connect(_closeButton, SIGNAL(clicked()), this, SLOT(close()));
40
41 QGridLayout* dlgLayout = new QGridLayout();
42 QLabel* img = new QLabel();
43 img->setPixmap(QPixmap(":ntrip-logo.png"));
44 dlgLayout->addWidget(img, 0,0);
45 dlgLayout->addWidget(new QLabel("BKG Ntrip State Space Server (BNS) Version 1.1"), 0,1);
46 dlgLayout->addWidget(tb,1,0,1,2);
47 dlgLayout->addWidget(_closeButton,2,1,Qt::AlignRight);
48
49 setLayout(dlgLayout);
50 resize(60*ww, 60*ww);
51 show();
52}
53
54// About Dialog - Destructor
55////////////////////////////////////////////////////////////////////////////
56bnsAboutDlg::~bnsAboutDlg() {
57};
58
59// Flowchart Dialog - Constructor
60////////////////////////////////////////////////////////////////////////////
61bnsFlowchartDlg::bnsFlowchartDlg(QWidget* parent) :
62 QDialog(parent) {
63
64 int ww = QFontMetrics(font()).width('w');
65 QPushButton* _closeButton = new QPushButton("Close");
66 _closeButton->setMaximumWidth(10*ww);
67 connect(_closeButton, SIGNAL(clicked()), this, SLOT(close()));
68
69 QGridLayout* dlgLayout = new QGridLayout();
70 QLabel* img = new QLabel();
71 img->setPixmap(QPixmap(":bnsflowchart.png"));
72 dlgLayout->addWidget(img, 0,0);
73 dlgLayout->addWidget(_closeButton,1,0,Qt::AlignLeft);
74
75 setLayout(dlgLayout);
76 show();
77}
78
79// Flowchart Dialog - Destructor
80////////////////////////////////////////////////////////////////////////////
81bnsFlowchartDlg::~bnsFlowchartDlg() {
82};
83
84// Constructor
85////////////////////////////////////////////////////////////////////////////
86bnsWindow::bnsWindow() {
87
88 _bns = 0;
89
90 bnsSettings settings;
91 QPalette palette;
92 QColor lightGray(230, 230, 230);
93
94 QString fontString = settings.value("font").toString();
95 if ( !fontString.isEmpty() ) {
96 QFont newFont;
97 if (newFont.fromString(fontString)) {
98 QApplication::setFont(newFont);
99 }
100 }
101
102 int ww = QFontMetrics(this->font()).width('w');
103 setMinimumSize(77*ww, 65*ww);
104 setWindowTitle(tr("BKG Ntrip State Space Server (BNS) Version 1.1"));
105 setWindowIcon(QPixmap(":ntrip-logo.png"));
106
107 // Create Actions
108 // --------------
109 _actHelp = new QAction(tr("&Help Contents"),this);
110 connect(_actHelp, SIGNAL(triggered()), SLOT(slotHelp()));
111
112 _actAbout = new QAction(tr("&About BNS"),this);
113 connect(_actAbout, SIGNAL(triggered()), SLOT(slotAbout()));
114
115 _actFlowchart = new QAction(tr("&Flow Chart"),this);
116 connect(_actFlowchart, SIGNAL(triggered()), SLOT(slotFlowchart()));
117
118 _actFontSel = new QAction(tr("Select &Font"),this);
119 connect(_actFontSel, SIGNAL(triggered()), SLOT(slotFontSel()));
120
121 _actSaveOpt = new QAction(tr("&Save Options"),this);
122 connect(_actSaveOpt, SIGNAL(triggered()), SLOT(slotSaveOptions()));
123
124 _actQuit = new QAction(tr("&Quit"),this);
125 connect(_actQuit, SIGNAL(triggered()), SLOT(close()));
126
127 _actWhatsThis= new QAction(tr("Help=Shift+F1"),this);
128 connect(_actWhatsThis, SIGNAL(triggered()), SLOT(slotWhatsThis()));
129
130 _actStart = new QAction(tr("Sta&rt"),this);
131 connect(_actStart, SIGNAL(triggered()), SLOT(slotStart()));
132
133 _actStop = new QAction(tr("Sto&p"),this);
134 connect(_actStop, SIGNAL(triggered()), SLOT(slotStop()));
135 _actStop->setEnabled(false);
136
137 CreateMenu();
138 AddToolbar();
139
140 // Canvas with Editable Fields
141 // ---------------------------
142 _canvas = new QWidget;
143 setCentralWidget(_canvas);
144
145 // Proxy Options
146 // -------------
147 _proxyHostLineEdit = new QLineEdit(settings.value("proxyHost").toString());
148 _proxyPortLineEdit = new QLineEdit(settings.value("proxyPort").toString());
149
150 // General Options
151 // ---------------
152 _logFileLineEdit = new QLineEdit(settings.value("logFile").toString());
153 _fileAppendCheckBox = new QCheckBox();
154 _fileAppendCheckBox->setCheckState(Qt::CheckState(settings.value("fileAppend").toInt()));
155 _autoStartCheckBox = new QCheckBox();
156 _autoStartCheckBox->setCheckState(Qt::CheckState(
157 settings.value("autoStart").toInt()));
158
159 // RINEX Ephemeris Options
160 // -----------------------
161 _ephHostLineEdit = new QLineEdit(settings.value("ephHost").toString());
162 _ephPortLineEdit = new QLineEdit(settings.value("ephPort").toString());
163 _ephEchoLineEdit = new QLineEdit(settings.value("ephEcho").toString());
164
165 // Clocks & Orbits Options
166 // -----------------------
167 _clkPortLineEdit = new QLineEdit(settings.value("clkPort").toString());
168 _inpEchoLineEdit = new QLineEdit(settings.value("inpEcho").toString());
169
170
171 // Broadcast Corrections I Options
172 // -------------------------------
173 _outHost_1_LineEdit = new QLineEdit(settings.value("outHost1").toString());
174 _outPort_1_LineEdit = new QLineEdit(settings.value("outPort1").toString());
175 _password_1_LineEdit = new QLineEdit(settings.value("password1").toString());
176 _password_1_LineEdit->setEchoMode(QLineEdit::Password);
177 _mountpoint_1_LineEdit = new QLineEdit(settings.value("mountpoint_1").toString());
178 _refSys_1_ComboBox = new QComboBox;
179 _refSys_1_ComboBox->setEditable(false);
180 _refSys_1_ComboBox->addItems(QString("IGS05,ETRF2000").split(","));
181 int ii = _refSys_1_ComboBox->findText(settings.value("refSys_1").toString());
182 if (ii != -1) {
183 _refSys_1_ComboBox->setCurrentIndex(ii);
184 }
185 _outFile_1_LineEdit = new QLineEdit(settings.value("outFile_1").toString());
186 _beClocks1CheckBox = new QCheckBox();
187 _beClocks1CheckBox->setCheckState(Qt::CheckState(settings.value("beClocks1").toInt()));
188
189 // Broadcast Corrections II Options
190 // --------------------------------
191 _outHost_2_LineEdit = new QLineEdit(settings.value("outHost2").toString());
192 _outPort_2_LineEdit = new QLineEdit(settings.value("outPort2").toString());
193 _password_2_LineEdit = new QLineEdit(settings.value("password2").toString());
194 _password_2_LineEdit->setEchoMode(QLineEdit::Password);
195 _mountpoint_2_LineEdit = new QLineEdit(settings.value("mountpoint_2").toString());
196 _refSys_2_ComboBox = new QComboBox;
197 _refSys_2_ComboBox->setEditable(false);
198 _refSys_2_ComboBox->addItems(QString("IGS05,ETRF2000").split(","));
199 ii = _refSys_2_ComboBox->findText(settings.value("refSys_2").toString());
200 if (ii != -1) {
201 _refSys_2_ComboBox->setCurrentIndex(ii);
202 }
203 _outFile_2_LineEdit = new QLineEdit(settings.value("outFile_2").toString());
204 _beClocks2CheckBox = new QCheckBox();
205 _beClocks2CheckBox->setCheckState(Qt::CheckState(settings.value("beClocks2").toInt()));
206
207 // RINEX Clocks Options
208 // --------------------
209 _rnxPathLineEdit = new QLineEdit(settings.value("rnxPath").toString());
210 _rnxIntrComboBox = new QComboBox;
211 _rnxIntrComboBox->setEditable(false);
212 _rnxIntrComboBox->addItems(QString("1 min,2 min,5 min,10 min,15 min,30 min,1 hour,1 day").split(","));
213 ii = _rnxIntrComboBox->findText(settings.value("rnxIntr").toString());
214 if (ii != -1) {
215 _rnxIntrComboBox->setCurrentIndex(ii);
216 }
217 _rnxSamplSpinBox = new QSpinBox;
218 _rnxSamplSpinBox->setMinimum(0);
219 _rnxSamplSpinBox->setMaximum(60);
220 _rnxSamplSpinBox->setSingleStep(5);
221 _rnxSamplSpinBox->setMaximumWidth(9*ww);
222 _rnxSamplSpinBox->setValue(settings.value("rnxSampl").toInt());
223 _rnxSamplSpinBox->setSuffix(" sec");
224
225 // SP3 Orbits Options
226 // ------------------
227 _sp3PathLineEdit = new QLineEdit(settings.value("sp3Path").toString());
228 _sp3IntrComboBox = new QComboBox;
229 _sp3IntrComboBox->setEditable(false);
230 _sp3IntrComboBox->addItems(QString("1 min,2 min,5 min,10 min,15 min,30 min,1 hour,1 day").split(","));
231 ii = _sp3IntrComboBox->findText(settings.value("sp3Intr").toString());
232 if (ii != -1) {
233 _sp3IntrComboBox->setCurrentIndex(ii);
234 }
235 _sp3SamplSpinBox = new QSpinBox;
236 _sp3SamplSpinBox->setMinimum(0);
237 _sp3SamplSpinBox->setMaximum(900);
238 _sp3SamplSpinBox->setSingleStep(60);
239 _sp3SamplSpinBox->setMaximumWidth(9*ww);
240 _sp3SamplSpinBox->setValue(settings.value("sp3Sampl").toInt());
241 _sp3SamplSpinBox->setSuffix(" sec");
242
243 // Whats This
244 // ----------
245 _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>"));
246 _proxyPortLineEdit->setWhatsThis(tr("<p>Enter your proxy server port number in case one is operated in front of BNS.</p>"));
247 _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>"));
248 _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>"));
249 _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."));
250 _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."));
251 _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."));
252 _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."));
253 _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."));
254 _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."));
255 _outPort_1_LineEdit->setWhatsThis(tr("Specify the IP port of an NTRIP Broadcaster to upload the stream. Default is port 80."));
256 _password_1_LineEdit->setWhatsThis(tr("Specify the stream upload password protecting the mounpoint on an NTRIP Broadcaster."));
257 _mountpoint_1_LineEdit->setWhatsThis(tr("Specify the mounpoint for stream upload to an NTRIP Broadcaster."));
258 _refSys_1_ComboBox->setWhatsThis(tr("Select the target reference system for outgoing clock and orbit corrections."));
259 _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."));
260 _outPort_2_LineEdit->setWhatsThis(tr("Specify the IP port of an NTRIP Broadcaster to upload the stream. Default is port 80."));
261 _password_2_LineEdit->setWhatsThis(tr("Specify the stream upload password protecting the mounpoint on an NTRIP Broadcaster."));
262 _mountpoint_2_LineEdit->setWhatsThis(tr("Specify the mounpoint for stream upload to an NTRIP Broadcaster."));
263 _refSys_2_ComboBox->setWhatsThis(tr("Select the target reference system for outgoing clock and orbit corrections."));
264 _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."));
265 _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."));
266 _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."));
267 _rnxIntrComboBox->setWhatsThis(tr("Select the length of the Clock RINEX file."));
268 _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."));
269 _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."));
270 _sp3IntrComboBox->setWhatsThis(tr("Select the length of the SP3 orbit file."));
271 _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."));
272 _autoStartCheckBox->setWhatsThis(tr("<p>Tick 'Auto start' for auto-start of BNS at startup time in window mode with preassigned processing options.</p>"));
273 _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>"));
274 _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>"));
275
276
277 // TabWidget
278 // ---------
279 tabs = new QTabWidget();
280
281 // Proxy Tab
282 // ---------
283 QWidget* tab_prx = new QWidget();
284 tabs->setMaximumHeight(20*ww);
285 tabs->addTab(tab_prx, "Proxy");
286
287 QGridLayout* layout_prx = new QGridLayout;
288
289 layout_prx->setColumnMinimumWidth(0,9*ww);
290 _proxyPortLineEdit->setMaximumWidth(9*ww);
291
292 layout_prx->addWidget(new QLabel("Host"), 0, 0);
293 layout_prx->addWidget(_proxyHostLineEdit, 0, 1, 1, 10);
294 layout_prx->addWidget(new QLabel("Port"), 1, 0);
295 layout_prx->addWidget(_proxyPortLineEdit, 1, 1);
296 layout_prx->addWidget(new QLabel("Settings for the proxy in protected networks, leave boxes blank if none."),2, 0, 1, 50, Qt::AlignLeft);
297 layout_prx->addWidget(new QLabel(" "), 3, 0);
298
299 tab_prx->setLayout(layout_prx);
300
301 connect(_proxyHostLineEdit, SIGNAL(textChanged(const QString &)),
302 this, SLOT(bnsText(const QString &)));
303 if (_proxyHostLineEdit->text().isEmpty()) {
304 _proxyPortLineEdit->setStyleSheet("background-color: lightGray");
305 _proxyPortLineEdit->setEnabled(false);
306 }
307
308 // General Tab
309 // -----------
310 QWidget* tab_gen = new QWidget();
311 tabs->addTab(tab_gen, "General");
312
313 QGridLayout* layout_gen = new QGridLayout;
314
315 layout_gen->setColumnMinimumWidth(0,9*ww);
316 _logFileLineEdit->setMaximumWidth(40*ww);
317
318 layout_gen->addWidget(new QLabel("Logfile (full path) "), 0, 0);
319 layout_gen->addWidget(_logFileLineEdit, 0, 1);
320 layout_gen->addWidget(new QLabel("Append files"), 1, 0);
321 layout_gen->addWidget(_fileAppendCheckBox, 1, 1);
322 layout_gen->addWidget(new QLabel("Auto start"), 2, 0);
323 layout_gen->addWidget(_autoStartCheckBox, 2, 1);
324 layout_gen->addWidget(new QLabel("General settings for logfile and file handling."), 3, 0, 1, 50, Qt::AlignLeft);
325
326 tab_gen->setLayout(layout_gen);
327
328 // RINEX Ephemeris Tab
329 // -------------------
330 QWidget* tab_eph = new QWidget();
331 tabs->addTab(tab_eph, "RINEX Ephemeris");
332
333 QGridLayout* layout_eph = new QGridLayout;
334
335 layout_eph->setColumnMinimumWidth(0, 9*ww);
336 _ephPortLineEdit->setMaximumWidth(9*ww);
337
338 layout_eph->addWidget(new QLabel("Host"), 0, 0);
339 layout_eph->addWidget(_ephHostLineEdit, 0, 1, 1, 10);
340 layout_eph->addWidget(new QLabel("Port"), 1, 0);
341 layout_eph->addWidget(_ephPortLineEdit, 1, 1);
342 layout_eph->addWidget(new QLabel("Save (full path)"), 2, 0);
343 layout_eph->addWidget(_ephEchoLineEdit, 2, 1, 1, 26);
344 layout_eph->addWidget(new QLabel("Read broadcast ephemeris in RINEX Version 3 Navigation format."), 3, 0, 1, 50, Qt::AlignLeft);
345
346 tab_eph->setLayout(layout_eph);
347
348 connect(_ephHostLineEdit, SIGNAL(textChanged(const QString &)),
349 this, SLOT(bnsText(const QString &)));
350 if (_ephHostLineEdit->text().isEmpty()) {
351 _ephPortLineEdit->setStyleSheet("background-color: lightGray");
352 _ephEchoLineEdit->setStyleSheet("background-color: lightGray");
353 _ephPortLineEdit->setEnabled(false);
354 _ephEchoLineEdit->setEnabled(false);
355 }
356
357 // Clocks & Orbits Tab
358 // -------------------
359 QWidget* tab_co = new QWidget();
360 tabs->addTab(tab_co,"Clocks && Orbits");
361
362 QGridLayout* layout_co = new QGridLayout;
363
364 layout_co->setColumnMinimumWidth(0, 9*ww);
365 _clkPortLineEdit->setMaximumWidth(9*ww);
366
367 layout_co->addWidget(new QLabel("Listening port"), 0, 0);
368 layout_co->addWidget(_clkPortLineEdit, 0, 1);
369 layout_co->addWidget(new QLabel("Save (full path) "), 1, 0);
370 layout_co->addWidget(_inpEchoLineEdit, 1, 1);
371 layout_co->addWidget(new QLabel("Read clocks and orbits in SP3 format."), 2, 0, 1, 50, Qt::AlignLeft);
372 layout_co->addWidget(new QLabel(""), 3, 0);
373
374 tab_co->setLayout(layout_co);
375
376 connect(_clkPortLineEdit, SIGNAL(textChanged(const QString &)),
377 this, SLOT(bnsText(const QString &)));
378 if (_clkPortLineEdit->text().isEmpty()) {
379 _inpEchoLineEdit->setStyleSheet("background-color: lightGray");
380 _inpEchoLineEdit->setEnabled(false);
381 }
382
383 // Broadcast Corrections I Tab
384 // ---------------------------
385 QWidget* tab_cas1 = new QWidget();
386 tabs->addTab(tab_cas1, "Broadcast Corrections I");
387
388 QGridLayout* layout_cas1 = new QGridLayout;
389
390 layout_cas1->setColumnMinimumWidth(0, 9*ww);
391 _outPort_1_LineEdit->setMaximumWidth(9*ww);
392 _password_1_LineEdit->setMaximumWidth(9*ww);
393 _mountpoint_1_LineEdit->setMaximumWidth(12*ww);
394 _refSys_1_ComboBox->setMaximumWidth(12*ww);
395
396 layout_cas1->addWidget(new QLabel("Host"), 0, 0);
397 layout_cas1->addWidget(_outHost_1_LineEdit, 0, 1, 1, 3);
398 layout_cas1->addWidget(new QLabel(" Port"), 0, 4, Qt::AlignRight);
399 layout_cas1->addWidget(_outPort_1_LineEdit, 0, 5);
400 layout_cas1->addWidget(new QLabel("Mountpoint"), 1, 0);
401 layout_cas1->addWidget(_mountpoint_1_LineEdit, 1, 1);
402 layout_cas1->addWidget(new QLabel("Password"), 1, 2, Qt::AlignRight);
403 layout_cas1->addWidget(_password_1_LineEdit, 1, 3);
404 layout_cas1->addWidget(new QLabel(" "), 1, 4);
405 layout_cas1->addWidget(new QLabel(" "), 1, 5);
406 layout_cas1->addWidget(new QLabel("System"), 2, 0);
407 layout_cas1->addWidget(_refSys_1_ComboBox, 2, 1);
408 layout_cas1->addWidget(new QLabel(" Save (full path)"), 2, 2, Qt::AlignRight);
409 layout_cas1->addWidget(_outFile_1_LineEdit, 2, 3, 1, 30);
410 layout_cas1->addWidget(new QLabel("Broadcast clocks"), 3, 0);
411 layout_cas1->addWidget(_beClocks1CheckBox, 3, 1);
412 layout_cas1->addWidget(new QLabel("Produce broadcast ephemeris corrections, upload to caster, reference system, local storage."), 4, 0, 1, 50);
413
414 tab_cas1->setLayout(layout_cas1);
415
416 connect(_outHost_1_LineEdit, SIGNAL(textChanged(const QString &)),
417 this, SLOT(bnsText(const QString &)));
418 if (_outHost_1_LineEdit->text().isEmpty()) {
419 _outPort_1_LineEdit->setStyleSheet("background-color: lightGray");
420 _mountpoint_1_LineEdit->setStyleSheet("background-color: lightGray");
421 _password_1_LineEdit->setStyleSheet("background-color: lightGray");
422 _outFile_1_LineEdit->setStyleSheet("background-color: lightGray");
423 _refSys_1_ComboBox->setStyleSheet("background-color: lightGray");
424 palette.setColor(_beClocks1CheckBox->backgroundRole(), lightGray);
425 _beClocks1CheckBox->setPalette(palette);
426 _outPort_1_LineEdit->setEnabled(false);
427 _mountpoint_1_LineEdit->setEnabled(false);
428 _password_1_LineEdit->setEnabled(false);
429 _outFile_1_LineEdit->setEnabled(false);
430 _refSys_1_ComboBox->setEnabled(false);
431 _beClocks1CheckBox->setEnabled(false);
432 }
433
434 // Broadcast Corrections II Tab
435 // ----------------------------
436 QWidget* tab_cas2 = new QWidget();
437 tabs->addTab(tab_cas2, "Broadcast Corrections II");
438
439 QGridLayout* layout_cas2 = new QGridLayout;
440
441 layout_cas2->setColumnMinimumWidth(0, 9*ww);
442 _outPort_2_LineEdit->setMaximumWidth(9*ww);
443 _password_2_LineEdit->setMaximumWidth(9*ww);
444 _mountpoint_2_LineEdit->setMaximumWidth(12*ww);
445 _refSys_2_ComboBox->setMaximumWidth(12*ww);
446
447 layout_cas2->addWidget(new QLabel("Host"), 0, 0);
448 layout_cas2->addWidget(_outHost_2_LineEdit, 0, 1, 1, 3);
449 layout_cas2->addWidget(new QLabel(" Port"), 0, 4, Qt::AlignRight);
450 layout_cas2->addWidget(_outPort_2_LineEdit, 0, 5);
451 layout_cas2->addWidget(new QLabel("Mountpoint"), 1, 0);
452 layout_cas2->addWidget(_mountpoint_2_LineEdit, 1, 1);
453 layout_cas2->addWidget(new QLabel("Password"), 1, 2, Qt::AlignRight);
454 layout_cas2->addWidget(_password_2_LineEdit, 1, 3);
455 layout_cas2->addWidget(new QLabel(" "), 1, 4);
456 layout_cas2->addWidget(new QLabel(" "), 1, 5);
457 layout_cas2->addWidget(new QLabel("System"), 2, 0);
458 layout_cas2->addWidget(_refSys_2_ComboBox, 2, 1);
459 layout_cas2->addWidget(new QLabel(" Save (full path)"), 2, 2, Qt::AlignRight);
460 layout_cas2->addWidget(_outFile_2_LineEdit, 2, 3, 1, 30);
461 layout_cas2->addWidget(new QLabel("Broadcast clocks"), 3, 0);
462 layout_cas2->addWidget(_beClocks2CheckBox, 3, 1);
463 layout_cas2->addWidget(new QLabel("Produce broadcast ephemeris corrections, upload to caster, reference system, local storage."), 4, 0, 1, 50);
464
465 tab_cas2->setLayout(layout_cas2);
466
467 connect(_outHost_2_LineEdit, SIGNAL(textChanged(const QString &)),
468 this, SLOT(bnsText(const QString &)));
469 if (_outHost_2_LineEdit->text().isEmpty()) {
470 _outPort_2_LineEdit->setStyleSheet("background-color: lightGray");
471 _mountpoint_2_LineEdit->setStyleSheet("background-color: lightGray");
472 _password_2_LineEdit->setStyleSheet("background-color: lightGray");
473 _outFile_2_LineEdit->setStyleSheet("background-color: lightGray");
474 _refSys_2_ComboBox->setStyleSheet("background-color: lightGray");
475 palette.setColor(_beClocks2CheckBox->backgroundRole(), lightGray);
476 _beClocks2CheckBox->setPalette(palette);
477 _outPort_2_LineEdit->setEnabled(false);
478 _mountpoint_2_LineEdit->setEnabled(false);
479 _password_2_LineEdit->setEnabled(false);
480 _outFile_2_LineEdit->setEnabled(false);
481 _refSys_2_ComboBox->setEnabled(false);
482 _beClocks2CheckBox->setEnabled(false);
483 }
484
485 // RINEX Clocks Tab
486 // ----------------
487 QWidget* tab_rin = new QWidget();
488 tabs->addTab(tab_rin, "RINEX Clocks ");
489
490 QGridLayout* layout_rin = new QGridLayout;
491
492 layout_rin->setColumnMinimumWidth(0, 9*ww);
493 _rnxIntrComboBox->setMaximumWidth(9*ww);
494
495 layout_rin->addWidget(new QLabel("Directory"), 0, 0);
496 layout_rin->addWidget(_rnxPathLineEdit, 0, 1, 1, 27);
497 layout_rin->addWidget(new QLabel("Interval"), 1, 0);
498 layout_rin->addWidget(_rnxIntrComboBox, 1, 1);
499 layout_rin->addWidget(new QLabel("Sampling"), 2, 0);
500 layout_rin->addWidget(_rnxSamplSpinBox, 2, 1);
501 layout_rin->addWidget(new QLabel("Save clock corrections in Clock RINEX file format."), 3, 0, 1, 50, Qt::AlignLeft);
502 layout_rin->addWidget(new QLabel(" "), 3, 0);
503
504 tab_rin->setLayout(layout_rin);
505
506 connect(_rnxPathLineEdit, SIGNAL(textChanged(const QString &)),
507 this, SLOT(bnsText(const QString &)));
508 if (_rnxPathLineEdit->text().isEmpty()) {
509 _rnxIntrComboBox->setStyleSheet("background-color: lightGray");
510 _rnxSamplSpinBox->setStyleSheet("background-color: lightGray");
511 _rnxIntrComboBox->setEnabled(false);
512 _rnxSamplSpinBox->setEnabled(false);
513 }
514
515 // SP3 Orbits Tab
516 // --------------
517 QWidget* tab_sp3 = new QWidget();
518 tabs->addTab(tab_sp3, "SP3 Orbits");
519
520 QGridLayout* layout_sp3 = new QGridLayout;
521
522 layout_sp3->setColumnMinimumWidth(0, 9*ww);
523 _sp3IntrComboBox->setMaximumWidth(9*ww);
524
525 layout_sp3->addWidget(new QLabel("Directory"), 0, 0);
526 layout_sp3->addWidget(_sp3PathLineEdit, 0, 1, 1, 27);
527 layout_sp3->addWidget(new QLabel("Interval"), 1, 0);
528 layout_sp3->addWidget(_sp3IntrComboBox, 1, 1);
529 layout_sp3->addWidget(new QLabel("Sampling"), 2, 0);
530 layout_sp3->addWidget(_sp3SamplSpinBox, 2, 1);
531 layout_sp3->addWidget(new QLabel("Save orbit corrections in SP3 file format."), 3, 0, 1, 50, Qt::AlignLeft);
532 layout_sp3->addWidget(new QLabel(" "), 3, 0);
533
534 tab_sp3->setLayout(layout_sp3);
535
536 connect(_sp3PathLineEdit, SIGNAL(textChanged(const QString &)),
537 this, SLOT(bnsText(const QString &)));
538 if (_sp3PathLineEdit->text().isEmpty()) {
539 _sp3IntrComboBox->setStyleSheet("background-color: lightGray");
540 _sp3SamplSpinBox->setStyleSheet("background-color: lightGray");
541 _sp3IntrComboBox->setEnabled(false);
542 _sp3SamplSpinBox->setEnabled(false);
543 }
544
545 tabs->setCurrentIndex(settings.value("startTab").toInt());
546
547 // Log
548 // ---
549 _log = new QTextBrowser();
550 _log->setReadOnly(true);
551 _log->setWhatsThis(tr("Records of BNS's activities are shown in the Log section."));
552
553 // Status
554 // ------
555 _status = new QGroupBox(tr("Status"));
556 QGridLayout* layout_status = new QGridLayout;
557
558 _statusLbl[0] = new QLabel("0 byte(s)"); _statusCnt[0] = 0;
559 _statusLbl[1] = new QLabel("0 byte(s)"); _statusCnt[1] = 0;
560 _statusLbl[2] = new QLabel("0 byte(s)"); _statusCnt[2] = 0;
561 _statusLbl[7] = new QLabel("RINEX Ephemeris:");
562 _statusLbl[4] = new QLabel("Clocks & Orbits:");
563 _statusLbl[5] = new QLabel("Broadcast Corrections I:");
564 _statusLbl[6] = new QLabel("Broadcast Corrections II:");
565 _statusLbl[3] = new QLabel("0 byte(s)"); _statusCnt[3] = 0;
566
567 _statusLbl[0]->setWhatsThis(tr("Status of incoming broadcast ephemeris."));
568 _statusLbl[1]->setWhatsThis(tr("Status of incoming stream of clocks and orbits."));
569 _statusLbl[2]->setWhatsThis(tr("Status of outgoing stream to NTRIP broadcaster."));
570 _statusLbl[7]->setWhatsThis(tr("Status of incoming broadcast ephemeris."));
571 _statusLbl[4]->setWhatsThis(tr("Status of incoming stream of clocks and orbits I."));
572 _statusLbl[5]->setWhatsThis(tr("Status of outgoing stream to NTRIP broadcaster I."));
573 _statusLbl[6]->setWhatsThis(tr("Status of outgoing stream to NTRIP broadcaster II."));
574 _statusLbl[3]->setWhatsThis(tr("Status of outgoing stream to NTRIP broadcaster II."));
575
576 layout_status->addWidget(_statusLbl[7], 0, 0);
577 layout_status->addWidget(_statusLbl[0], 0, 1);
578 layout_status->addWidget(_statusLbl[4], 1, 0);
579 layout_status->addWidget(_statusLbl[1], 1, 1);
580 layout_status->addWidget(_statusLbl[5], 0, 2);
581 layout_status->addWidget(_statusLbl[2], 0, 3);
582 layout_status->addWidget(_statusLbl[6], 1, 2);
583 layout_status->addWidget(_statusLbl[3], 1, 3);
584 _status->setLayout(layout_status);
585
586 // Main Layout
587 // -----------
588 QVBoxLayout* mainLayout = new QVBoxLayout;
589 mainLayout->addWidget(tabs);
590 mainLayout->addWidget(_log);
591 mainLayout->addWidget(_status);
592
593 _canvas->setLayout(mainLayout);
594
595 // Auto start
596 // ----------
597 if ( Qt::CheckState(settings.value("autoStart").toInt()) == Qt::Checked) {
598 slotStart();
599 }
600
601}
602
603// Destructor
604////////////////////////////////////////////////////////////////////////////
605bnsWindow::~bnsWindow() {
606}
607
608// Close Application gracefully
609////////////////////////////////////////////////////////////////////////////
610void bnsWindow::closeEvent(QCloseEvent* event) {
611
612int iRet = QMessageBox::question(this, "Close", "Save Options?",
613 QMessageBox::Yes, QMessageBox::No,
614 QMessageBox::Cancel);
615
616 if (iRet == QMessageBox::Cancel) {
617 event->ignore();
618 return;
619 }
620 else if (iRet == QMessageBox::Yes) {
621 slotSaveOptions();
622 }
623
624 QMainWindow::closeEvent(event);
625}
626
627// About Message
628////////////////////////////////////////////////////////////////////////////
629void bnsWindow::slotAbout() {
630 new bnsAboutDlg(0);
631}
632
633// Flowchart
634////////////////////////////////////////////////////////////////////////////
635void bnsWindow::slotFlowchart() {
636 new bnsFlowchartDlg(0);
637}
638
639// Help Window
640////////////////////////////////////////////////////////////////////////////
641void bnsWindow::slotHelp() {
642 QUrl url;
643 url.setPath(":bnshelp.html");
644 new bnsHlpDlg(0, url);
645}
646
647// Select Fonts
648////////////////////////////////////////////////////////////////////////////
649void bnsWindow::slotFontSel() {
650 bool ok;
651 QFont newFont = QFontDialog::getFont(&ok, this->font(), this);
652 if (ok) {
653 bnsSettings settings;
654 settings.setValue("font", newFont.toString());
655 QApplication::setFont(newFont);
656 int ww = QFontMetrics(newFont).width('w');
657 setMinimumSize(77*ww, 65*ww);
658 }
659}
660
661// Whats This Help
662////////////////////////////////////////////////////////////////////////////
663void bnsWindow::slotWhatsThis() {
664QWhatsThis::enterWhatsThisMode();
665}
666
667// Create Menus
668////////////////////////////////////////////////////////////////////////////
669void bnsWindow::CreateMenu() {
670 _menuFile = menuBar()->addMenu(tr("&File"));
671 _menuFile->addAction(_actFontSel);
672 _menuFile->addSeparator();
673 _menuFile->addAction(_actSaveOpt);
674 _menuFile->addSeparator();
675 _menuFile->addAction(_actQuit);
676
677 _menuHlp = menuBar()->addMenu(tr("&Help"));
678 _menuHlp->addAction(_actHelp);
679 _menuHlp->addAction(_actFlowchart);
680 _menuHlp->addAction(_actAbout);
681}
682
683// Tool (Command) Bar
684////////////////////////////////////////////////////////////////////////////
685void bnsWindow::AddToolbar() {
686 QToolBar* toolBar = new QToolBar;
687 addToolBar(Qt::BottomToolBarArea, toolBar);
688 toolBar->setMovable(false);
689 toolBar->addAction(_actStart);
690 toolBar->addAction(_actStop);
691 toolBar->addWidget(new QLabel(" "));
692 toolBar->addAction(_actWhatsThis);
693}
694
695// Save Options
696////////////////////////////////////////////////////////////////////////////
697void bnsWindow::slotSaveOptions() {
698 bnsSettings settings;
699 settings.setValue("proxyHost", _proxyHostLineEdit->text());
700 settings.setValue("proxyPort", _proxyPortLineEdit->text());
701 settings.setValue("logFile", _logFileLineEdit->text());
702 settings.setValue("fileAppend", _fileAppendCheckBox->checkState());
703 settings.setValue("autoStart", _autoStartCheckBox->checkState());
704 settings.setValue("refSys_1", _refSys_1_ComboBox->currentText());
705 settings.setValue("refSys_2", _refSys_2_ComboBox->currentText());
706 settings.setValue("inpEcho", _inpEchoLineEdit->text());
707 settings.setValue("ephHost", _ephHostLineEdit->text());
708 settings.setValue("ephPort", _ephPortLineEdit->text());
709 settings.setValue("ephEcho", _ephEchoLineEdit->text());
710 settings.setValue("clkPort", _clkPortLineEdit->text());
711 settings.setValue("outHost1", _outHost_1_LineEdit->text());
712 settings.setValue("outPort1", _outPort_1_LineEdit->text());
713 settings.setValue("outHost2", _outHost_2_LineEdit->text());
714 settings.setValue("outPort2", _outPort_2_LineEdit->text());
715 settings.setValue("mountpoint_1",_mountpoint_1_LineEdit->text());
716 settings.setValue("mountpoint_2",_mountpoint_2_LineEdit->text());
717 settings.setValue("outFile_1", _outFile_1_LineEdit->text());
718 settings.setValue("outFile_2", _outFile_2_LineEdit->text());
719 settings.setValue("password1", _password_1_LineEdit->text());
720 settings.setValue("password2", _password_2_LineEdit->text());
721 settings.setValue("rnxPath", _rnxPathLineEdit->text());
722 settings.setValue("rnxIntr", _rnxIntrComboBox->currentText());
723 settings.setValue("rnxSampl", _rnxSamplSpinBox->value());
724 settings.setValue("sp3Path", _sp3PathLineEdit->text());
725 settings.setValue("sp3Intr", _sp3IntrComboBox->currentText());
726 settings.setValue("sp3Sampl", _sp3SamplSpinBox->value());
727 settings.setValue("startTab", tabs->currentIndex());
728 settings.setValue("beClocks1", _beClocks1CheckBox->checkState());
729 settings.setValue("beClocks2", _beClocks2CheckBox->checkState());
730}
731
732// Display Program Messages
733////////////////////////////////////////////////////////////////////////////
734void bnsWindow::slotMessage(const QByteArray msg) {
735
736 const int maxBufferSize = 10000;
737
738 QString txt = _log->toPlainText() + "\n" +
739 QDateTime::currentDateTime().toUTC().toString("yy-MM-dd hh:mm:ss ") + msg;
740 _log->clear();
741 _log->append(txt.right(maxBufferSize));
742}
743
744// Delete bns
745////////////////////////////////////////////////////////////////////////////
746void bnsWindow::deleteBns() {
747 _actStart->setEnabled(true);
748 _actStop->setEnabled(false);
749 _bns->terminate();
750 _bns->wait(100);
751 delete _bns;
752 _bns = 0;
753}
754
755// Error in bns
756////////////////////////////////////////////////////////////////////////////
757void bnsWindow::slotError(const QByteArray msg) {
758 slotMessage(msg);
759 deleteBns();
760}
761
762// Stop
763////////////////////////////////////////////////////////////////////////////
764void bnsWindow::slotStop() {
765 int iRet = QMessageBox::question(this, "Stop", "Do you want to stop?",
766 QMessageBox::Yes, QMessageBox::No,
767 QMessageBox::NoButton);
768 if (iRet == QMessageBox::Yes) {
769 deleteBns();
770 }
771}
772
773// Start
774////////////////////////////////////////////////////////////////////////////
775void bnsWindow::slotStart() {
776 slotSaveOptions();
777
778 _actStart->setEnabled(false);
779 _actStop->setEnabled(true);
780
781 _bns = new t_bns(0);
782
783 connect(_bns, SIGNAL(newMessage(QByteArray)),
784 this, SLOT(slotMessage(const QByteArray)));
785
786 connect(_bns, SIGNAL(error(QByteArray)),
787 this, SLOT(slotError(const QByteArray)));
788
789 connect(_bns, SIGNAL(newEphBytes(int)), this, SLOT(slotEphBytes(int)));
790 connect(_bns, SIGNAL(newClkBytes(int)), this, SLOT(slotClkBytes(int)));
791 connect(_bns, SIGNAL(newOutBytes1(int)), this, SLOT(slotOutBytes1(int)));
792 connect(_bns, SIGNAL(newOutBytes2(int)), this, SLOT(slotOutBytes2(int)));
793
794 _bns->start();
795}
796
797// Input and output bytes statistics
798////////////////////////////////////////////////////////////////////////////
799void bnsWindow::slotEphBytes(int nBytes) {
800 updateStatus(0, nBytes);
801}
802void bnsWindow::slotClkBytes(int nBytes) {
803 updateStatus(1, nBytes);
804}
805void bnsWindow::slotOutBytes1(int nBytes) {
806 updateStatus(2, nBytes);
807}
808void bnsWindow::slotOutBytes2(int nBytes) {
809 updateStatus(3, nBytes);
810}
811
812void bnsWindow::updateStatus(int ii, int nBytes) {
813 QMutexLocker locker(&_mutex);
814
815 _statusCnt[ii] += nBytes;
816
817 if (_statusCnt[ii] < 1e3) {
818 _statusLbl[ii]->setText(QString("%1 byte(s)").arg((int)_statusCnt[ii]));
819 }
820 else if (_statusCnt[ii] < 1e6) {
821 _statusLbl[ii]->setText(QString("%1 kb").arg(_statusCnt[ii]/1.e3, 5));
822 }
823 else {
824 _statusLbl[ii]->setText(QString("%1 Mb").arg(_statusCnt[ii]/1.e6, 5));
825 }
826}
827
828// Bns Text
829////////////////////////////////////////////////////////////////////////////
830void bnsWindow::bnsText(const QString &text){
831
832 bool isEmpty = text.isEmpty();
833
834 QPalette palette;
835 QColor lightGray(230, 230, 230);
836 QColor white(255, 255, 255);
837
838 // Enable/disable Proxy Options
839 // ----------------------------
840 if (tabs->currentIndex() == 0) {
841 if (!isEmpty) {
842 _proxyPortLineEdit->setStyleSheet("background-color: white");
843 _proxyPortLineEdit->setEnabled(true);
844 } else {
845 _proxyPortLineEdit->setStyleSheet("background-color: lightGray");
846 _proxyPortLineEdit->setEnabled(false);
847 }
848 }
849
850 // Enable/disable RINEX Ephemeris Options
851 // --------------------------------------
852 if (tabs->currentIndex() == 2) {
853 if (!isEmpty) {
854 _ephPortLineEdit->setStyleSheet("background-color: white");
855 _ephEchoLineEdit->setStyleSheet("background-color: white");
856 _ephEchoLineEdit->setEnabled(true);
857 } else {
858 _ephPortLineEdit->setStyleSheet("background-color: lightGray");
859 _ephEchoLineEdit->setStyleSheet("background-color: lightGray");
860 _ephEchoLineEdit->setEnabled(false);
861 }
862 }
863
864 // Enable/disable Clocks & Orbits Options
865 // --------------------------------------
866 if (tabs->currentIndex() == 3) {
867 if (!isEmpty) {
868 _inpEchoLineEdit->setStyleSheet("background-color: white");
869 _inpEchoLineEdit->setEnabled(true);
870 } else {
871 _inpEchoLineEdit->setStyleSheet("background-color: lightGray");
872 _inpEchoLineEdit->setEnabled(false);
873 }
874 }
875
876 // Enable/disable Broadcast Corrections I Options
877 // -----------------------------------------------
878 if (tabs->currentIndex() == 4) {
879 if (!isEmpty) {
880 _outPort_1_LineEdit->setStyleSheet("background-color: white");
881 _mountpoint_1_LineEdit->setStyleSheet("background-color: white");
882 _password_1_LineEdit->setStyleSheet("background-color: white");
883 _outFile_1_LineEdit->setStyleSheet("background-color: white");
884 _refSys_1_ComboBox->setStyleSheet("background-color: white");
885 palette.setColor(_beClocks1CheckBox->backgroundRole(), white);
886 _beClocks1CheckBox->setPalette(palette);
887 _outPort_1_LineEdit->setEnabled(true);
888 _mountpoint_1_LineEdit->setEnabled(true);
889 _password_1_LineEdit->setEnabled(true);
890 _outFile_1_LineEdit->setEnabled(true);
891 _refSys_1_ComboBox->setEnabled(true);
892 _beClocks1CheckBox->setEnabled(true);
893 } else {
894 _outPort_1_LineEdit->setStyleSheet("background-color: lightGray");
895 _mountpoint_1_LineEdit->setStyleSheet("background-color: lightGray");
896 _password_1_LineEdit->setStyleSheet("background-color: lightGray");
897 _outFile_1_LineEdit->setStyleSheet("background-color: lightGray");
898 _refSys_1_ComboBox->setStyleSheet("background-color: lightGray");
899 palette.setColor(_beClocks1CheckBox->backgroundRole(), lightGray);
900 _beClocks1CheckBox->setPalette(palette);
901 _outPort_1_LineEdit->setEnabled(false);
902 _mountpoint_1_LineEdit->setEnabled(false);
903 _password_1_LineEdit->setEnabled(false);
904 _outFile_1_LineEdit->setEnabled(false);
905 _refSys_1_ComboBox->setEnabled(false);
906 _beClocks1CheckBox->setEnabled(false);
907 }
908 }
909
910 // Enable/disable Broadcast Corrections II Options
911 // -----------------------------------------------
912 if (tabs->currentIndex() == 5) {
913 if (!isEmpty) {
914 _outPort_2_LineEdit->setStyleSheet("background-color: white");
915 _mountpoint_2_LineEdit->setStyleSheet("background-color: white");
916 _password_2_LineEdit->setStyleSheet("background-color: white");
917 _outFile_2_LineEdit->setStyleSheet("background-color: white");
918 _refSys_2_ComboBox->setStyleSheet("background-color: white");
919 palette.setColor(_beClocks2CheckBox->backgroundRole(), white);
920 _beClocks2CheckBox->setPalette(palette);
921 _outPort_2_LineEdit->setEnabled(true);
922 _mountpoint_2_LineEdit->setEnabled(true);
923 _password_2_LineEdit->setEnabled(true);
924 _outFile_2_LineEdit->setEnabled(true);
925 _refSys_2_ComboBox->setEnabled(true);
926 _beClocks2CheckBox->setEnabled(true);
927 } else {
928 _outPort_2_LineEdit->setStyleSheet("background-color: lightGray");
929 _mountpoint_2_LineEdit->setStyleSheet("background-color: lightGray");
930 _password_2_LineEdit->setStyleSheet("background-color: lightGray");
931 _outFile_2_LineEdit->setStyleSheet("background-color: lightGray");
932 _refSys_2_ComboBox->setStyleSheet("background-color: lightGray");
933 palette.setColor(_beClocks2CheckBox->backgroundRole(), lightGray);
934 _beClocks2CheckBox->setPalette(palette);
935 _outPort_2_LineEdit->setEnabled(false);
936 _mountpoint_2_LineEdit->setEnabled(false);
937 _password_2_LineEdit->setEnabled(false);
938 _outFile_2_LineEdit->setEnabled(false);
939 _refSys_2_ComboBox->setEnabled(false);
940 _beClocks2CheckBox->setEnabled(false);
941 }
942 }
943
944 // Enable/disable RINEX Clocks Options
945 // -----------------------------------
946 if (tabs->currentIndex() == 6) {
947 if (!isEmpty) {
948 _rnxIntrComboBox->setStyleSheet("background-color: white");
949 _rnxSamplSpinBox->setStyleSheet("background-color: white");
950 _rnxIntrComboBox->setEnabled(true);
951 _rnxSamplSpinBox->setEnabled(true);
952 } else {
953 _rnxIntrComboBox->setStyleSheet("background-color: lightGray");
954 _rnxSamplSpinBox->setStyleSheet("background-color: lightGray");
955 _rnxIntrComboBox->setEnabled(false);
956 _rnxSamplSpinBox->setEnabled(false);
957 }
958 }
959
960 // Enable/disable SP3 Orbits Options
961 // ---------------------------------
962 if (tabs->currentIndex() == 7) {
963 if (!isEmpty) {
964 _sp3IntrComboBox->setStyleSheet("background-color: white");
965 _sp3SamplSpinBox->setStyleSheet("background-color: white");
966 _sp3IntrComboBox->setEnabled(true);
967 _sp3SamplSpinBox->setEnabled(true);
968 } else {
969 _sp3IntrComboBox->setStyleSheet("background-color: lightGray");
970 _sp3SamplSpinBox->setStyleSheet("background-color: lightGray");
971 _sp3IntrComboBox->setEnabled(false);
972 _sp3SamplSpinBox->setEnabled(false);
973 }
974 }
975
976}
Note: See TracBrowser for help on using the repository browser.