Changeset 1178 in ntrip
- Timestamp:
- Oct 27, 2008, 5:54:25 PM (16 years ago)
- Location:
- trunk/BNC
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bnccaster.cpp
r1177 r1178 193 193 194 194 getThread->start(); 195 196 emit newGetThread(getThread);197 195 } 198 196 … … 387 385 388 386 if (!existFlg) { 389 emit deleteGetThread(thread);390 387 disconnect(thread, 0, 0, 0); 391 388 _staIDs.removeAll(thread->staID()); … … 397 394 } 398 395 396 emit mountPointsRead(); 399 397 emit( newMessage(QString("Table of Mountpoints (re-)read: new number = %1") 400 398 .arg(_threads.count()).toAscii()) ); -
trunk/BNC/bnccaster.h
r1177 r1178 48 48 49 49 signals: 50 void newGetThread(bncGetThread* thread); 51 void deleteGetThread(bncGetThread* thread); 50 void mountPointsRead(); 52 51 void getThreadErrors(); 53 52 void newMessage(QByteArray msg); -
trunk/BNC/bncwindow.cpp
r1177 r1178 249 249 _mountPointsTable->setSelectionMode(QAbstractItemView::ExtendedSelection); 250 250 _mountPointsTable->setSelectionBehavior(QAbstractItemView::SelectRows); 251 QListIterator<QString> it(settings.value("mountPoints").toStringList());252 if (!it.hasNext()) {253 _actGetData->setEnabled(false);254 }255 int iRow = 0;256 while (it.hasNext()) {257 QStringList hlp = it.next().split(" ");258 if (hlp.size() < 5) continue;259 _mountPointsTable->insertRow(iRow);260 261 QUrl url(hlp[0]);262 263 QString fullPath = url.host() + QString(":%1").arg(url.port()) + url.path();264 QString format(hlp[1]); QString latitude(hlp[2]); QString longitude(hlp[3]);265 QString nmea(hlp[4]);266 267 QTableWidgetItem* it;268 it = new QTableWidgetItem(url.userInfo());269 it->setFlags(it->flags() & ~Qt::ItemIsEditable);270 _mountPointsTable->setItem(iRow, 0, it);271 272 it = new QTableWidgetItem(fullPath);273 it->setFlags(it->flags() & ~Qt::ItemIsEditable);274 _mountPointsTable->setItem(iRow, 1, it);275 276 it = new QTableWidgetItem(format);277 _mountPointsTable->setItem(iRow, 2, it);278 279 if (nmea == "yes") {280 it = new QTableWidgetItem(latitude);281 _mountPointsTable->setItem(iRow, 3, it);282 it = new QTableWidgetItem(longitude);283 _mountPointsTable->setItem(iRow, 4, it);284 } else {285 it = new QTableWidgetItem(latitude);286 it->setFlags(it->flags() & ~Qt::ItemIsEditable);287 _mountPointsTable->setItem(iRow, 3, it);288 it = new QTableWidgetItem(longitude);289 it->setFlags(it->flags() & ~Qt::ItemIsEditable);290 _mountPointsTable->setItem(iRow, 4, it);291 }292 293 it = new QTableWidgetItem(nmea);294 it->setFlags(it->flags() & ~Qt::ItemIsEditable);295 _mountPointsTable->setItem(iRow, 5, it);296 297 bncTableItem* bncIt = new bncTableItem();298 bncIt->setFlags(bncIt->flags() & ~Qt::ItemIsEditable);299 _mountPointsTable->setItem(iRow, 6, bncIt);300 301 iRow++;302 }303 251 _mountPointsTable->hideColumn(0); 304 _mountPointsTable->sortItems(1);305 306 252 connect(_mountPointsTable, SIGNAL(itemSelectionChanged()), 307 253 SLOT(slotSelectionChanged())); 254 populateMountPointsTable(); 308 255 309 256 _log = new QTextBrowser(); … … 493 440 bncWindow::~bncWindow() { 494 441 delete _caster; 442 } 443 444 // 445 //////////////////////////////////////////////////////////////////////////// 446 void bncWindow::populateMountPointsTable() { 447 448 for (int iRow = _mountPointsTable->rowCount()-1; iRow >=0; iRow--) { 449 _mountPointsTable->removeRow(iRow); 450 } 451 452 QSettings settings; 453 454 QListIterator<QString> it(settings.value("mountPoints").toStringList()); 455 if (!it.hasNext()) { 456 _actGetData->setEnabled(false); 457 } 458 int iRow = 0; 459 while (it.hasNext()) { 460 QStringList hlp = it.next().split(" "); 461 if (hlp.size() < 5) continue; 462 _mountPointsTable->insertRow(iRow); 463 464 QUrl url(hlp[0]); 465 466 QString fullPath = url.host() + QString(":%1").arg(url.port()) + url.path(); 467 QString format(hlp[1]); QString latitude(hlp[2]); QString longitude(hlp[3]); 468 QString nmea(hlp[4]); 469 470 QTableWidgetItem* it; 471 it = new QTableWidgetItem(url.userInfo()); 472 it->setFlags(it->flags() & ~Qt::ItemIsEditable); 473 _mountPointsTable->setItem(iRow, 0, it); 474 475 it = new QTableWidgetItem(fullPath); 476 it->setFlags(it->flags() & ~Qt::ItemIsEditable); 477 _mountPointsTable->setItem(iRow, 1, it); 478 479 it = new QTableWidgetItem(format); 480 _mountPointsTable->setItem(iRow, 2, it); 481 482 if (nmea == "yes") { 483 it = new QTableWidgetItem(latitude); 484 _mountPointsTable->setItem(iRow, 3, it); 485 it = new QTableWidgetItem(longitude); 486 _mountPointsTable->setItem(iRow, 4, it); 487 } else { 488 it = new QTableWidgetItem(latitude); 489 it->setFlags(it->flags() & ~Qt::ItemIsEditable); 490 _mountPointsTable->setItem(iRow, 3, it); 491 it = new QTableWidgetItem(longitude); 492 it->setFlags(it->flags() & ~Qt::ItemIsEditable); 493 _mountPointsTable->setItem(iRow, 4, it); 494 } 495 496 it = new QTableWidgetItem(nmea); 497 it->setFlags(it->flags() & ~Qt::ItemIsEditable); 498 _mountPointsTable->setItem(iRow, 5, it); 499 500 bncTableItem* bncIt = new bncTableItem(); 501 bncIt->setFlags(bncIt->flags() & ~Qt::ItemIsEditable); 502 _mountPointsTable->setItem(iRow, 6, bncIt); 503 504 iRow++; 505 } 506 507 _mountPointsTable->sortItems(1); 495 508 } 496 509 … … 683 696 this, SLOT(slotGetThreadErrors())); 684 697 685 connect (_caster, SIGNAL(newGetThread(bncGetThread*)), 686 this, SLOT(slotNewGetThread(bncGetThread*))); 687 688 connect (_caster, SIGNAL(deleteGetThread(bncGetThread*)), 689 this, SLOT(slotDeleteGetThread(bncGetThread*))); 698 connect (_caster, SIGNAL(mountPointsRead()), 699 this, SLOT(slotMountPointsRead())); 690 700 691 701 _caster->slotReadMountpoints(); … … 792 802 // 793 803 //////////////////////////////////////////////////////////////////////////// 794 void bncWindow::slotNewGetThread(bncGetThread* thread) { 795 for (int iRow = 0; iRow < _mountPointsTable->rowCount(); iRow++) { 796 QUrl url( "//" + _mountPointsTable->item(iRow, 0)->text() + 797 "@" + _mountPointsTable->item(iRow, 1)->text() ); 798 if (url == thread->mountPoint() && 799 _mountPointsTable->item(iRow, 3)->text() == thread->latitude() && 800 _mountPointsTable->item(iRow, 4)->text() == thread->longitude() ) { 801 802 connect(thread, SIGNAL(newBytes(QByteArray, double)), 803 (bncTableItem*) _mountPointsTable->item(iRow, 6), 804 SLOT(slotNewBytes(QByteArray, double))); 805 break; 806 } 807 } 808 } 809 810 // 811 //////////////////////////////////////////////////////////////////////////// 812 void bncWindow::slotDeleteGetThread(bncGetThread* thread) { 804 void bncWindow::slotMountPointsRead() { 805 populateMountPointsTable(); 813 806 } 814 807 -
trunk/BNC/bncwindow.h
r1177 r1178 58 58 59 59 public slots: 60 void slotNewGetThread(bncGetThread* thread); 61 void slotDeleteGetThread(bncGetThread* thread); 60 void slotMountPointsRead(); 62 61 63 62 private slots: … … 81 80 82 81 private: 82 void populateMountPointsTable(); 83 83 84 QMenu* _menuHlp; 84 85 QMenu* _menuFile;
Note:
See TracChangeset
for help on using the changeset viewer.