forked from tomojitakasu/RTKLIB
-
Notifications
You must be signed in to change notification settings - Fork 371
Expand file tree
/
Copy pathbrowsmain.cpp
More file actions
630 lines (522 loc) · 22.3 KB
/
Copy pathbrowsmain.cpp
File metadata and controls
630 lines (522 loc) · 22.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
//---------------------------------------------------------------------------
// Ported to Qt by Jens Reimann
#include <clocale>
#include <QCloseEvent>
#include <QShowEvent>
#include <QSettings>
#include <QFileDialog>
#include <QTimer>
#include <QCommandLineParser>
#include <QtConcurrent>
#include <QFutureWatcher>
#include <QMetaObject>
#include <QLineEdit>
#include "rtklib.h"
#include "aboutdlg.h"
#include "mapview.h"
#include "browsmain.h"
#include "staoptdlg.h"
#include "mntpoptdlg.h"
//---------------------------------------------------------------------------
#define PRGNAME "NTRIP Browser Qt"
#define PRGVERSION "1.0"
#define NTRIP_HOME "rtcm-ntrip.org:2101" // caster list home
#define NTRIP_TIMEOUT 10000 // response timeout (ms)
#define MAXSRCTBL 512000 // max source table size (bytes)
#define ENDSRCTBL "ENDSOURCETABLE" // end marker of table
#define ADDRESS_WIDTH 184 // width of Address (px)
static char buff[MAXSRCTBL]; // source table buffer
MainForm *mainForm;
extern "C" {
int showmsg(const char *, ...) {return 0;}
void settime(gtime_t) {}
void settspan(gtime_t, gtime_t) {}
}
/* get source table -------------------------------------------------------*/
static char *getsrctbl(const QString addr)
{
static int lock = 0;
stream_t str;
char *p = buff, msg[MAXSTRMSG];
unsigned int tick = tickget();
if (lock) return NULL;
else lock = 1;
strinit(&str);
if (!stropen(&str, STR_NTRIPCLI, STR_MODE_R, qPrintable(addr))) {
lock = 0;
QMetaObject::invokeMethod(mainForm, "showMsg", Qt::QueuedConnection, Q_ARG(QString, qApp->translate("MainForm", "stream open error")));
return NULL;
}
QMetaObject::invokeMethod(mainForm, "showMsg", Qt::QueuedConnection, Q_ARG(QString, qApp->translate("MainForm", "connecting...")));
while (p < buff + MAXSRCTBL - 1) {
int ns = strread(&str, (uint8_t *)p, (buff + MAXSRCTBL - p - 1));
p += ns; *p='\0';
qApp->processEvents();
int stat = strstat(&str, msg);
QMetaObject::invokeMethod(mainForm, "showMsg", Qt::QueuedConnection, Q_ARG(QString, msg));
if (stat <= 0) break;
if (strstr(buff, ENDSRCTBL)) break;
if ((int)(tickget() - tick) > NTRIP_TIMEOUT) {
QMetaObject::invokeMethod(mainForm, "showMsg", Qt::QueuedConnection, Q_ARG(QString, qApp->translate("MainForm", "response timeout")));
break;
}
}
strclose(&str);
lock = 0;
return buff;
}
//---------------------------------------------------------------------------
MainForm::MainForm(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainForm)
{
mainForm = this;
ui->setupUi(this);
ui->cBFilterFormat->setVisible(false); // TODO: not yet implemented
QCoreApplication::setApplicationName(PRGNAME);
QCoreApplication::setApplicationVersion(PRGVERSION);
setWindowTitle(QStringLiteral("%1 ver.%2 %3").arg(PRGNAME).arg(VER_RTKLIB, PATCH_LEVEL));
setWindowIcon(QIcon(":/icons/srctblbrows"));
// retrieve config file name
QString prg_filename = QApplication::applicationFilePath();
QFileInfo prg_fileinfo(prg_filename);
iniFile = prg_fileinfo.absoluteDir().filePath(prg_fileinfo.baseName() + ".ini");
mapView = new MapView(this);
staListDialog = new StaListDialog(this);
loadTimer = new QTimer(this);
mountPointDialog = new MntpOptDialog(this);
ui->btnTypeCas->setDefaultAction(ui->actMenuViewCas);
ui->btnTypeNet->setDefaultAction(ui->actMenuViewNet);
ui->btnTypeSrc->setDefaultAction(ui->actMenuViewSrc);
ui->btnTypeStr->setDefaultAction(ui->actMenuViewStr);
connect(ui->cBAddress, &QComboBox::textActivated, this, &MainForm::getTable);
connect(ui->btnUpdate, &QPushButton::clicked, this, &MainForm::getTable);
connect(ui->btnMap, &QPushButton::clicked, this, &MainForm::showMap);
connect(ui->btnList, &QPushButton::clicked, this, &MainForm::getCaster);
connect(ui->btnSta, &QPushButton::clicked, this, &MainForm::showStationDialog);
connect(ui->cBStatationMask, &QCheckBox::clicked, this, &MainForm::updateEnable);
connect(ui->actMenuOpen, &QAction::triggered, this, &MainForm::openSourceTable);
connect(ui->actMenuSave, &QAction::triggered, this, &MainForm::saveSourceTable);
connect(ui->actMenuQuit, &QAction::triggered, this, &MainForm::close);
connect(ui->actMenuUpdateCaster, &QAction::triggered, this, &MainForm::getTable);
connect(ui->actMenuUpdateTable, &QAction::triggered, this, &MainForm::getTable);
connect(ui->actMenuViewCas, &QAction::triggered, this, &MainForm::viewCasterTable);
connect(ui->actMenuViewNet, &QAction::triggered, this, &MainForm::viewNetTable);
connect(ui->actMenuViewSrc, &QAction::triggered, this, &MainForm::viewSourceTable);
connect(ui->actMenuViewStr, &QAction::triggered, this, &MainForm::viewStreamTable);
connect(ui->actMenuAbout, &QAction::triggered, this, &MainForm::showAboutDialog);
connect(loadTimer, &QTimer::timeout, this, &MainForm::loadTimerExpired);
connect(ui->tWTableStr, &QTableWidget::cellClicked, this, &MainForm::streamTableSelectItem);
connect(ui->tWTableStr, &QTableWidget::cellDoubleClicked, this, &MainForm::streamTableShowMountpoint);
connect(ui->tWTableCas, &QTableWidget::cellDoubleClicked, this, &MainForm::casterTableSelectItem);
ui->btnMap->setEnabled(false);
#ifdef QWEBENGINE
ui->btnMap->setEnabled(true);
#endif
ui->tWTableStr->setSortingEnabled(true);
ui->tWTableCas->setSortingEnabled(true);
ui->tWTableNet->setSortingEnabled(true);
ui->cBAddress->lineEdit()->setPlaceholderText(NTRIP_HOME);
ui->statusbar->addWidget(ui->lblMessage);
strinitcom();
loadTimer->setInterval(100);
}
//---------------------------------------------------------------------------
void MainForm::showEvent(QShowEvent *event)
{
if (event->spontaneous()) return;
const QString default_column_width0 = "30,74,116,56,244,18,52,62,28,50,50,18,18,120,28,18,18,40,600,";
const QString default_column_width1 = "30,112,40,96,126,18,28,50,50,160,40,600,0,0,0,0,0,0,0,";
const QString default_column_width2 = "30,80,126,18,18,300,300,300,600,0,0,0,0,0,0,0,0,0,0,";
QSettings settings(iniFile, QSettings::IniFormat);
QString list, url;
QStringList colw, stas;
int i;
QCommandLineParser parser;
parser.setApplicationDescription(PRGNAME);
parser.addHelpOption();
parser.addVersionOption();
parser.addPositionalArgument("URL", QCoreApplication::translate("main", "file with list of Ntrip sources"));
parser.process(*QApplication::instance());
const QStringList &args = parser.positionalArguments();
if (args.count() >= 1) url = args.at(0);
list = settings.value("srctbl/addrlist", "").toString();
QStringList items = list.split("@");
foreach(QString item, items){
ui->cBAddress->addItem(item);
}
if (!url.isEmpty()) {
ui->cBAddress->setCurrentText(url);
getTable();
} else {
QString url = settings.value("srctbl/address", "").toString();
if (!url.isEmpty())
ui->cBAddress->setCurrentText(url);
else
ui->cBAddress->setCurrentIndex(-1);
}
fontScale = QFontMetrics(ui->tWTableStr->font()).height() * 4;
colw = settings.value("srctbl/colwidth0", default_column_width0).toString().split(',');
i = 0;
foreach(QString width, colw){
ui->tWTableStr->setColumnWidth(i++, width.toDouble() * fontScale / 96);
}
colw = settings.value("srctbl/colwidth1", default_column_width1).toString().split(',');
i = 0;
foreach(QString width, colw){
ui->tWTableCas->setColumnWidth(i++, width.toDouble() * fontScale / 96);
}
colw = settings.value("srctbl/colwidth2", default_column_width2).toString().split(',');
i = 0;
foreach(QString width, colw){
ui->tWTableNet->setColumnWidth(i++, width.toDouble() * fontScale / 96);
}
stationList.clear();
stas = settings.value("sta/stations", "").toString().split(',');
foreach(QString sta, stas){
stationList.append(sta);
}
mapView->loadOptions(settings);
showTable();
updateEnable();
getTable();
QTimer::singleShot(0, this, &MainForm::updateTable);
}
//---------------------------------------------------------------------------
void MainForm::closeEvent(QCloseEvent *)
{
QSettings settings(iniFile, QSettings::IniFormat);
QString list, colw;
// save table layout
settings.setValue("srctbl/address", ui->cBAddress->currentText());
for (int i = 0; i < ui->cBAddress->count(); i++)
list = list + ui->cBAddress->itemText(i) + "@";
settings.setValue("srctbl/addrlist", list);
colw = "";
for (int i = 0; i < ui->tWTableStr->columnCount(); i++)
colw = colw + QString::number(ui->tWTableStr->columnWidth(i) * 96 / fontScale);
settings.setValue("srctbl/colwidth0", colw);
colw = "";
for (int i = 0; i < ui->tWTableCas->columnCount(); i++)
colw = colw + QString::number(ui->tWTableCas->columnWidth(i) * 96 / fontScale);
settings.setValue("srctbl/colwidth1", colw);
colw = "";
for (int i = 0; i < ui->tWTableNet->columnCount(); i++)
colw = colw + QString::number(ui->tWTableNet->columnWidth(i) * 96 / fontScale);
settings.setValue("srctbl/colwidth2", colw);
settings.setValue("sta/stations", stationList.join(','));
mapView->saveOptions(settings);
}
//---------------------------------------------------------------------------
void MainForm::openSourceTable()
{
QString fileName = QDir::toNativeSeparators(QFileDialog::getOpenFileName(this, tr("Open"), QString(), tr("All File (*.*)")));
QFile file(fileName);
sourceTable = "";
if (!file.open(QIODevice::ReadOnly)) return;
sourceTable = file.readAll();
addressCaster = ui->cBAddress->currentText();
showTable();
showMsg(tr("Source table loaded"));
}
//---------------------------------------------------------------------------
void MainForm::saveSourceTable()
{
QString fileName = QDir::toNativeSeparators(QFileDialog::getSaveFileName(this, tr("Save File"), QString(), tr("All File (*.*)")));
QFile file(fileName);
if (!file.open(QIODevice::WriteOnly)) return;
file.write(sourceTable.toLatin1());
showMsg(tr("Source table saved"));
}
//---------------------------------------------------------------------------
void MainForm::viewStreamTable()
{
ui->actMenuViewCas->setChecked(false);
ui->actMenuViewNet->setChecked(false);
ui->actMenuViewSrc->setChecked(false);
showTable();
updateEnable();
}
//---------------------------------------------------------------------------
void MainForm::viewCasterTable()
{
ui->actMenuViewStr->setChecked(false);
ui->actMenuViewNet->setChecked(false);
ui->actMenuViewSrc->setChecked(false);
showTable();
updateEnable();
}
//---------------------------------------------------------------------------
void MainForm::viewNetTable()
{
ui->actMenuViewStr->setChecked(false);
ui->actMenuViewCas->setChecked(false);
ui->actMenuViewSrc->setChecked(false);
showTable();
updateEnable();
}
//---------------------------------------------------------------------------
void MainForm::viewSourceTable()
{
ui->actMenuViewStr->setChecked(false);
ui->actMenuViewCas->setChecked(false);
ui->actMenuViewNet->setChecked(false);
showTable();
updateEnable();
}
//---------------------------------------------------------------------------
void MainForm::showAboutDialog()
{
AboutDialog *aboutDialog = new AboutDialog(this, QPixmap(":/icons/srctblbrows"), PRGNAME);
aboutDialog->exec();
delete aboutDialog;
}
//---------------------------------------------------------------------------
void MainForm::showMap()
{
int num = 0;
float mean_lat = 0, mean_lon = 0, min_lat = 180, max_lat = -180, min_lon = 90, max_lon = -90;
bool okay;
updateMap();
if (ui->tWTableStr->columnCount() < 11) return;
for (int i = 0; i < ui->tWTableStr->rowCount(); i++) {
QString latitudeText = ui->tWTableStr->item(i, 9)->text();
QString longitudeText = ui->tWTableStr->item(i, 10)->text();
float lat = latitudeText.toDouble(&okay); if (!okay) continue;
float lon = longitudeText.toDouble(&okay); if (!okay) continue;
if ((lat == 0) && (lon == 0)) // skip unknown positions
continue;
mean_lat += lat;
mean_lon += lon;
if (lat < min_lat) min_lat = lat;
if (lat > max_lat) max_lat = lat;
if (lon < min_lon) min_lon = lon;
if (lon > max_lon) max_lon = lon;
num++;
}
if (num > 0)
{
mean_lat /= num;
mean_lon /= num;
mapView->setCenter(mean_lat, mean_lon); // fallback until setViewBounds() is implemented for Google Maps
mapView->setViewBounds(min_lat, min_lon, max_lat, max_lon);
}
mapView->show();
}
//---------------------------------------------------------------------------
void MainForm::streamTableSelectItem(int row, int col)
{
Q_UNUSED(col);
QString title;
if (ui->tWTableStr->columnCount() < 2) return;
if (0 <= row && row < ui->tWTableStr->rowCount()) {
title = ui->tWTableStr->item(row, 1)->text();
mapView->highlightMark(row);
mapView->setWindowTitle(tr("NTRIP Data Stream Map: %1/%2").arg(ui->cBAddress->currentText(), title));
}
}
//---------------------------------------------------------------------------
void MainForm::streamTableShowMountpoint(int row, int col)
{
Q_UNUSED(col);
if (ui->tWTableStr->columnCount() < 2) return;
if (0 <= row && row < ui->tWTableStr->rowCount()) {
mountPointDialog->setOption(0);
mountPointDialog->setMountPoint(ui->tWTableStr->item(row, 1)->text());
QString mntpStr;
for (int i = 0; i < ui->tWTableStr->columnCount(); i++)
mntpStr += ui->tWTableStr->item(row, i)->text() + ";" ;
mountPointDialog->setMountPointString(mntpStr);
mountPointDialog->show();
}
}
//---------------------------------------------------------------------------
void MainForm::casterTableSelectItem(int row, int col)
{
Q_UNUSED(col);
if (ui->tWTableStr->columnCount() < 3) return;
if (0 <= row && row < ui->tWTableCas->rowCount()) {
QString address = ui->tWTableCas->item(row, 1)->text();
QString port = ui->tWTableCas->item(row, 2)->text();
ui->cBAddress->setCurrentText(QStringLiteral("%1:%2").arg(address, port));
getTable();
}
}
//---------------------------------------------------------------------------
void MainForm::loadTimerExpired()
{
if (!mapView->isLoaded()) return;
updateMap();
loadTimer->stop();
}
//---------------------------------------------------------------------------
void MainForm::getCaster()
{
if (casterWatcher.isRunning()) return;
QString addressText = ui->cBAddress->currentText();
QString addr = NTRIP_HOME;
if (!addressText.isEmpty()) addr = addressText;
ui->btnList->setEnabled(false);
ui->actMenuUpdateCaster->setEnabled(false);
// update source table in background and call updateCaster() when finished
QFuture<char *> tblFuture = QtConcurrent::run(getsrctbl, addr);
connect(&casterWatcher, &QFutureWatcher<char*>::finished, this, &MainForm::updateCaster);
casterWatcher.setFuture(tblFuture);
}
//---------------------------------------------------------------------------
void MainForm::updateCaster()
{
QString currentAddress;
QString srctbl;
ui->btnList->setEnabled(true);
ui->actMenuUpdateCaster->setEnabled(true);
if ((srctbl = casterWatcher.result()).isEmpty()) return;
currentAddress = ui->cBAddress->currentText();
ui->cBAddress->clear();
ui->cBAddress->setCurrentText(currentAddress);
ui->cBAddress->addItem("");
QStringList tokens;
QStringList lines = srctbl.split('\n');
foreach(const QString &line, lines) {
if (!line.contains("CAS")) continue;
tokens = line.split(";");
if (tokens.size() < 3) continue;
ui->cBAddress->addItem(tokens.at(1) + ":" + tokens.at(2), QString(line));
}
if (ui->cBAddress->count() > 1) ui->cBAddress->setCurrentIndex(0);
}
//---------------------------------------------------------------------------
void MainForm::getTable()
{
if (tableWatcher.isRunning()) return;
QString addressText = ui->cBAddress->currentText();
QString addr = NTRIP_HOME;
if (!addressText.isEmpty()) addr = addressText;
ui->btnUpdate->setEnabled(false);
ui->cBAddress->setEnabled(false);
ui->actMenuUpdateTable->setEnabled(false);
// retrieve data in background and call updateTable() when finished
QFuture<char *> tblFuture = QtConcurrent::run(getsrctbl, addr);
connect(&tableWatcher, &QFutureWatcher<char*>::finished, this, &MainForm::updateTable);
tableWatcher.setFuture(tblFuture);
}
//---------------------------------------------------------------------------
void MainForm::updateTable()
{
QString srctbl;
ui->btnUpdate->setEnabled(true);
ui->cBAddress->setEnabled(true);
ui->actMenuUpdateTable->setEnabled(true);
srctbl = tableWatcher.result();
if (!srctbl.isEmpty()) {
sourceTable = srctbl;
addressCaster = ui->cBAddress->currentText();
}
showTable();
}
//---------------------------------------------------------------------------
void MainForm::showTable()
{
const QString ti[3][19] =
{{tr("No"), tr("Mountpoint"), tr("ID"), tr("Format"), tr("Format-Details"), tr("Carrier"), tr("Nav-System"),
tr("Network"), tr("Country"), tr("Latitude"), tr("Longitude"), tr("NMEA"), tr("Solution"),
tr("Generator"), tr("Compr-Encrp"), tr("Authentication"), tr("Fee"), tr("Bitrate"), ""},
{tr("No"), tr("Host"), tr("Port"), tr("ID"), tr("Operator"), tr("NMEA"), tr("Country"), tr("Latitude"), tr("Longitude"),
tr("Fallback Host"), tr("Fallback Port"), "", "", "", "", "", "", ""},
{tr("No"), tr("ID"), tr("Operator"), tr("Authentication"), tr("Fee"), tr("Web-Net"), tr("Web-Str"), tr("Web-Reg"), "", "", "", "",
"", "", "", "", "", ""}};
QTableWidget *table[] = {ui->tWTableStr, ui->tWTableCas, ui->tWTableNet};
QAction *action[] = {ui->actMenuViewStr, ui->actMenuViewCas, ui->actMenuViewNet, ui->actMenuViewSrc};
int i, j, numStations, type;
ui->tETableSrc->setVisible(false);
for (i = 0; i < 3; i++)
table[i]->setVisible(false);
type = ui->actMenuViewStr->isChecked() ? 0 : (ui->actMenuViewCas->isChecked() ? 1 : (ui->actMenuViewNet->isChecked() ? 2 : 3));
for (i = 0; i < 4; i++)
action[i]->setChecked(i == type);
if (type == 3) {
ui->tETableSrc->setVisible(true);
ui->tETableSrc->setPlainText("");
} else {
table[type]->setVisible(true);
table[type]->setColumnCount(18);
for (i = 0; i < 18; i++) {
table[type]->setHorizontalHeaderItem(i, new QTableWidgetItem(ti[type][i]));
}
}
if (addressCaster != ui->cBAddress->currentText()) return;
if (type == 3) {
ui->tETableSrc->setPlainText(sourceTable);
return;
}
QStringList lines = sourceTable.split("\n");
numStations = 0;
foreach(QString line, lines) {
switch (type) {
case 0: if (line.startsWith("STR")) numStations++; break;
case 1: if (line.startsWith("CAS")) numStations++; break;
case 2: if (line.startsWith("NET")) numStations++; break;
}
}
if (numStations <= 0) return;
table[type]->setRowCount(numStations);
j = 0;
foreach(QString line, lines) {
switch (type) {
case 0: if (line.startsWith("STR")) break; else continue;
case 1: if (line.startsWith("CAS")) break; else continue;
case 2: if (line.startsWith("NET")) break; else continue;
}
table[type]->setItem(j, 0, new QTableWidgetItem(QString::number(j)));
QStringList tokens = line.split(";");
for (int i = 0; i < table[type]->columnCount() && i < tokens.size(); i++)
table[type]->setItem(j, i, new QTableWidgetItem(tokens.at(i)));
j++;
}
updateMap();
}
//---------------------------------------------------------------------------
void MainForm::showMsg(const QString &msg)
{
ui->lblMessage->setText(tr(qPrintable(msg)));
}
//---------------------------------------------------------------------------
void MainForm::updateMap()
{
QString title, msg, latitudeText, longitudeText;
double latitude, longitude;
bool okay;
if (ui->cBAddress->currentText().isEmpty())
mapView->setWindowTitle(tr("NTRIP Data Stream Map"));
else
mapView->setWindowTitle(tr("NTRIP Data Stream Map: %1").arg(ui->cBAddress->currentText()));
mapView->clearMark();
if (ui->tWTableStr->columnCount() < 14) return;
for (int i = 0; i < ui->tWTableStr->rowCount(); i++) {
latitudeText = ui->tWTableStr->item(i, 9)->text();
longitudeText = ui->tWTableStr->item(i, 10)->text();
latitude = latitudeText.toDouble(&okay); if (!okay) continue;
longitude = longitudeText.toDouble(&okay); if (!okay) continue;
title = ui->tWTableStr->item(i, 1)->text();
msg = "<b>" + ui->tWTableStr->item(i, 1)->text() + "</b>: " + ui->tWTableStr->item(i, 2)->text() + " (" + ui->tWTableStr->item(i,8)->text() + ")<br>" +
"Format: " + ui->tWTableStr->item(i, 3)->text() + ", " + ui->tWTableStr->item(i, 4)->text() + ", <br> " +
"Nav-Sys: " + ui->tWTableStr->item(i, 6)->text() + "<br>" +
"Network: " + ui->tWTableStr->item(i, 7)->text() + "<br>" +
"Latitude/Longitude: " + ui->tWTableStr->item(i, 9)->text() + ", " + ui->tWTableStr->item(i, 10)->text() + "<br>" +
"Generator: " + ui->tWTableStr->item(i, 13)->text();
mapView->addMark(0, i, latitude, longitude, title, msg);
}
}
//---------------------------------------------------------------------------
void MainForm::showStationDialog()
{
staListDialog->setStationList(stationList);
staListDialog->exec();
stationList = staListDialog->getStationList();
}
//---------------------------------------------------------------------------
void MainForm::updateEnable()
{
ui->btnSta->setEnabled(ui->cBStatationMask->isChecked());
ui->btnMap->setEnabled(ui->actMenuViewStr->isChecked());
}
//---------------------------------------------------------------------------