Changeset 8177 in ntrip
- Timestamp:
- Oct 30, 2017, 1:17:02 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bnctabledlg.cpp
r8127 r8177 35 35 * Created: 24-Dec-2005 36 36 * 37 * Changes: 37 * Changes: 38 38 * 39 39 * -----------------------------------------------------------------------*/ … … 145 145 _buttonGet->setDefault(true); 146 146 connect(_buttonGet, SIGNAL(clicked()), this, SLOT(slotGetTable())); 147 147 148 148 _buttonMap = new QPushButton(tr("Map"), this); 149 149 _buttonMap->setEnabled(false); 150 150 connect(_buttonMap, SIGNAL(clicked()), this, SLOT(slotShowMap())); 151 151 152 152 _buttonClose = new QPushButton(tr("Close"), this); 153 153 connect(_buttonClose, SIGNAL(clicked()), this, SLOT(close())); … … 196 196 // Read full caster table (static) 197 197 //////////////////////////////////////////////////////////////////////////// 198 t_irc bncTableDlg::getFullTable(const QString& ntripVersion, 199 const QString& casterHost, 200 int casterPort, QStringList& allLines, 198 t_irc bncTableDlg::getFullTable(const QString& ntripVersion, 199 const QString& casterHost, 200 int casterPort, QStringList& allLines, 201 201 bool alwaysRead) { 202 202 … … 243 243 allLines.append(line); 244 244 line = in.readLine(); 245 } 245 } 246 246 allTables.insert(casterHost, allLines); 247 247 delete query; … … 260 260 _buttonGet->setEnabled(false); 261 261 _buttonMap->setEnabled(true); 262 _buttonCasterTable->setEnabled(false); 262 _buttonCasterTable->setEnabled(false); 263 263 264 264 if ( getFullTable(_ntripVersionComboBox->currentText(), … … 270 270 return; 271 271 } 272 272 273 273 static const QStringList labels = QString("mountpoint,identifier,format," 274 274 "format-details,carrier,system,network,country,lat,long," … … 297 297 for (int ic = 1; ic < columns.size(); ic++) { 298 298 if (ic == 11) { 299 if (columns[ic] == "0") { 300 columns[ic] = "no"; 301 } else { 302 columns[ic] = "yes"; 299 if (columns[ic] == "0") { 300 columns[ic] = "no"; 301 } else { 302 columns[ic] = "yes"; 303 303 } 304 304 } … … 413 413 //////////////////////////////////////////////////////////////////////////// 414 414 void bncTableDlg::slotCasterTable() { 415 415 416 416 _buttonCasterTable->setEnabled(false); 417 417 _casterHostComboBox->setEnabled(false); … … 425 425 _buttonSelect->setEnabled(false); 426 426 427 bncCasterTableDlg* dlg = 427 bncCasterTableDlg* dlg = 428 428 new bncCasterTableDlg(_ntripVersionComboBox->currentText(), this); 429 429 dlg->move(this->pos().x()+50, this->pos().y()+50); … … 468 468 url.setPort(newCasterPort.toInt()); 469 469 addUrl(url); 470 470 471 471 _casterHostComboBox->setCurrentIndex(0); 472 472 } … … 513 513 //////////////////////////////////////////////////////////////////////////// 514 514 bncCasterTableDlg::bncCasterTableDlg(const QString& ntripVersion, 515 QWidget* parent) : 515 QWidget* parent) : 516 516 QDialog(parent) { 517 517 518 static const QStringList labels = QString("host,port,identifier,operator,nmea,country,lat,long, link").split(",");518 static const QStringList labels = QString("host,port,identifier,operator,nmea,country,lat,long,fallback host, fallback port,link").split(","); 519 519 520 520 _casterTable = new QTableWidget(this); … … 574 574 QStringList columns = lines[nRow].split(";"); 575 575 for (int ic = 1; ic < columns.size(); ic++) { 576 if (ic == 5) { 577 if (columns[ic] == "0") { 578 columns[ic] = "no"; 579 } else { 580 columns[ic] = "yes"; 576 if (ic == 5) { 577 if (columns[ic] == "0") { 578 columns[ic] = "no"; 579 } else { 580 columns[ic] = "yes"; 581 581 } 582 582 } … … 586 586 } 587 587 } 588 } 588 } 589 589 _casterTable->setHorizontalHeaderLabels(labels); 590 590 _casterTable->setSortingEnabled(true); … … 624 624 dlgLayout->addWidget(_casterTable, 1, 0, 1, 3); 625 625 dlgLayout->addWidget(_whatsThisButton, 2, 0); 626 dlgLayout->addWidget(_closeButton, 2, 1, Qt::AlignRight); 626 dlgLayout->addWidget(_closeButton, 2, 1, Qt::AlignRight); 627 627 dlgLayout->addWidget(_okButton, 2, 2); 628 628 … … 631 631 setLayout(dlgLayout); 632 632 resize(68*ww, 50*ww); 633 _casterTable->hideColumn(8); 634 _casterTable->hideColumn(9); 633 635 show(); 634 636 } … … 655 657 for (int ir = _casterTable->rowCount() - 1; ir >= 0 ; ir--) { 656 658 if (_casterTable->isItemSelected(_casterTable->item(ir,0))) { 657 emit newCaster(_casterTable->item(ir,0)->text(), 659 emit newCaster(_casterTable->item(ir,0)->text(), 658 660 _casterTable->item(ir,1)->text()); 659 661 }
Note:
See TracChangeset
for help on using the changeset viewer.