Changeset 30 in flair-src for trunk/tools/FlairGCS/src/Manager.cpp


Ignore:
Timestamp:
Jun 21, 2016, 3:48:18 PM (5 years ago)
Author:
Sanahuja Guillaume
Message:

show rx rate in GCS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/FlairGCS/src/Manager.cpp

    r15 r30  
    3838
    3939  setWindowTitle(name);
    40 
     40//statusBar()->showMessage(tr("Ready to serve"));
    4141  // manager layout
    4242  managerLayout = new QVBoxLayout;
     
    6969  connect(save_button, SIGNAL(clicked(bool)), this, SLOT(save()));
    7070
     71  status=new QStatusBar();
     72  status->setSizeGripEnabled(false);
     73  button_layout->addWidget(status, 1,0);
     74
    7175  UDT::startup();
    7276  serv = UDT::socket(AF_INET, SOCK_DGRAM, 0);
     
    155159  connect(newLayout, SIGNAL(setRemoteName(QString)), this,
    156160          SLOT(tabName(QString)));
     161  connect(newLayout, SIGNAL(computedRxRate(float)), this,
     162          SLOT(printRxRates(float)));
    157163  connect(socket, SIGNAL(dataReady(char *, int)), newLayout,
    158164          SLOT(receive(char *, int)));
     
    172178  } else { // add a tab for the new connection
    173179    tabBar->addTab("unknown");
     180  }
     181}
     182
     183void Manager::printRxRates(float rxRate) {
     184  int index = connectionsLayout.indexOf((ConnectionLayout *)sender());
     185
     186  if (tabBar->count() == 0) {
     187    status->showMessage(tr("rx rate %1 kB/s").arg(rxRate,0,'f',3));
     188  } else if (index==tabBar->currentIndex()) {
     189    status->showMessage(tr("%1 rx rate %2 kB/s").arg(tabBar->tabText(index)).arg(rxRate,0,'f',3));
    174190  }
    175191}
     
    209225    hiddenTabName = tabBar->tabText(0);
    210226    tabBar->removeTab(0);
     227  }
     228
     229  if (connectionsLayout.count() == 0) {
     230    status->showMessage("");
    211231  }
    212232}
Note: See TracChangeset for help on using the changeset viewer.