Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9642 in orxonox.OLD


Ignore:
Timestamp:
Jul 31, 2006, 10:32:46 AM (18 years ago)
Author:
bensch
Message:

node-widget

Location:
branches/proxy/src/lib/network
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/network/monitor/network_stats_widget.cc

    r9640 r9642  
    1818#include "network_stats_widget.h"
    1919#include "network_monitor.h"
     20#include "peer_info.h"
    2021
    2122#include "multi_type.h"
     
    3334    : GLGuiBox(OrxGui::Horizontal)
    3435{
     36  this->init();
     37
    3538  this->setName(name);
    3639  this->setIP(ip);
    3740
     41}
     42
     43HostWidget::HostWidget(const PeerInfo* peerInfo)
     44    : GLGuiBox(OrxGui::Horizontal)
     45{
     46  this->init();
     47  this->setName(peerInfo->getNodeTypeString() + "ID: " + MultiType(peerInfo->userId).getString());
     48  this->setIP(peerInfo->ip);
     49}
     50
     51void HostWidget::init()
     52{
    3853  if(_font == NULL)
    3954    _font = new Font(ResourceManager::getInstance()->getDataDir() + "/fonts/arial.ttf", 20);
    4055
    41   this->_name.setFont(*_font);
     56  //this->_name.setFont(*_font);
    4257  this->_name.setTextSize(15);
    43   this->_ip.setFont(*_font);
     58  //this->_ip.setFont(*_font);
    4459  this->_ip.setTextSize(15);
    4560
     
    6277Font* HostWidget::_font = NULL;
    6378
     79
     80
     81
    6482//======================================================//
    6583
     
    7391
    7492NodeWidget::NodeWidget(const NetworkNode* node)
    75     : _proxyWidget("node", node->getPeerInfo()->ip)
     93    : _proxyWidget(node->getPeerInfo())// "node", node->getPeerInfo()->ip)
    7694{
    7795  this->_clientNameWidth = 100.0f;
     
    169187{
    170188  this->_monitor = monitor;
     189  this->_passedTime = 0.0f;
    171190
    172191  /*
     
    272291{}
    273292
    274 void clearProxies();
     293void NetworkStatsWidget::clearProxies()
     294{
     295}
    275296
    276297
     
    298319void NetworkStatsWidget::tick(float dt)
    299320{
     321
     322  if ((_passedTime+= dt) > 1.0f)
     323  {
     324    this->_passedTime = 0.0f;
     325    this->rebuild();
     326  }
     327
    300328  assert (this->_monitor->getLocalNode() != NULL);
    301329  assert(this->_monitor->getLocalNode()->getPeerInfo() != NULL);
  • branches/proxy/src/lib/network/monitor/network_stats_widget.h

    r9640 r9642  
    1616class NetworkMonitor;
    1717class NetworkNode;
    18 
     18class PeerInfo;
    1919
    2020class HostWidget : public OrxGui::GLGuiBox
     
    2222  public:
    2323    HostWidget(const std::string& name, const IP& ip);
     24    HostWidget(const PeerInfo* peerInfo);
    2425
    2526    void setName(const std::string& name) { this->_name.setText(name); };
    26     void setIP(const IP& ip) { this->_ip.setText(ip.ipString()); this->_storedIP = ip; };
     27    void setIP(const IP& ip) { this->_ip.setText(std::string("at ") + ip.ipString()); this->_storedIP = ip; };
    2728
    2829    void setNameWidth(float width) { this->_name.setLineWidth(width); };
     
    3536    virtual void hiding();
    3637
     38  private:
     39    void init();
    3740  private:
    3841    OrxGui::GLGuiText _name;           //!< The Name of the Proxy server to be displayed.
     
    127130    static NetworkStatsWidget*    _statsWidget;
    128131
     132
     133    float                   _passedTime;
    129134    //OrxGui::GLGuiText       _valueText;
    130135    //OrxGui::GLGuiBar        _bar;
  • branches/proxy/src/lib/network/peer_info.cc

    r9584 r9642  
    7070{
    7171
    72   "maser server",
     72  "master server",
    7373  "proxy server active",
    7474  "proxy server passive",
Note: See TracChangeset for help on using the changeset viewer.