Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9442 in orxonox.OLD for branches/proxy


Ignore:
Timestamp:
Jul 24, 2006, 5:42:16 PM (18 years ago)
Author:
bensch
Message:

better checks

Location:
branches/proxy/src/lib/network/monitor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/network/monitor/network_monitor.h

    r9438 r9442  
    5757    PeerInfo* getFirstChoiceProxy();
    5858    PeerInfo* getSecondChoiceProxy();
     59    /** @returns the local node */
     60    inline NetworkNode* getLocalNode() const { return this->localNode; };
    5961
    6062    /** @returns the active proxy server list of the localnode */
  • branches/proxy/src/lib/network/monitor/network_stats_widget.cc

    r9439 r9442  
    1717
    1818#include "network_stats_widget.h"
     19#include "network_monitor.h"
    1920
    2021#include "multi_type.h"
    2122
    2223HostWidget::HostWidget(const std::string& name, const IP& ip)
    23   : GLGuiBox(OrxGui::Horizontal)
     24    : GLGuiBox(OrxGui::Horizontal)
    2425{
    2526  this->setName(name);
     
    140141 */
    141142NetworkStatsWidget::NetworkStatsWidget(const NetworkMonitor* monitor)
    142   : GLGuiBox(OrxGui::Vertical), _thisHost("myName", IP(127, 0, 0 , 0))
     143    : GLGuiBox(OrxGui::Vertical), _thisHost("myName", IP(127, 0, 0 , 0))
    143144{
    144145  this->_monitor = monitor;
     
    180181void NetworkStatsWidget::setMaximum(float max)
    181182{
    182  // this->_bar.setMaximum(max);
     183  // this->_bar.setMaximum(max);
    183184}
    184185
     
    199200void NetworkStatsWidget::tick(float dt)
    200201{
    201 
    202 
     202  assert (this->_monitor->getLocalNode() != NULL);
     203  assert(this->_monitor->getLocalNode()->getPeerInfo() != NULL);
     204
     205  if(this->_monitor->getLocalNode()->getPeerInfo()->connectionMonitor != NULL)
     206  {
     207    ConnectionMonitor* mon = this->_monitor->getLocalNode()->getPeerInfo()->connectionMonitor;
     208
     209    this->_upstreamText.setText(MultiType(mon->getOutgoingZippedBandWidth()).getString());
     210    this->_downstreamText.setText(MultiType(mon->getIncomingZippedBandWidth()).getString());
     211  }
    203212}
    204213
     
    210219
    211220void NetworkStatsWidget::showing()
    212 {
    213 }
     221{}
    214222
    215223void NetworkStatsWidget::hiding()
    216 {
    217 }
     224{}
Note: See TracChangeset for help on using the changeset viewer.