Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 4, 2006, 11:01:28 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the proxy bache back with no conflicts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/network/monitor/network_stats_widget.h

    r9494 r9656  
    22 * @file network_stats_widget.h
    33 * @brief Definition of an EnergyWidget, that displays a bar and a Text
    4 */
     4 */
    55
    66#ifndef _NETWORK_STATS_WIDGET_H
    77#define _NETWORK_STATS_WIDGET_H
    88
    9 #include "glgui_box.h"
     9#include "glgui_fixedposition_box.h"
    1010#include "glgui_bar.h"
    1111#include "glgui_text.h"
     12#include "glgui_pushbutton.h"
    1213
    1314#include "network/ip.h"
    1415
    1516class NetworkMonitor;
    16 
     17class NetworkNode;
     18class PeerInfo;
    1719
    1820class HostWidget : public OrxGui::GLGuiBox
     
    2022  public:
    2123    HostWidget(const std::string& name, const IP& ip);
    22     ~HostWidget() {};
     24    HostWidget(const PeerInfo* peerInfo);
    2325
    2426    void setName(const std::string& name) { this->_name.setText(name); };
    25     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; };
    2628
    2729    void setNameWidth(float width) { this->_name.setLineWidth(width); };
     
    3537
    3638  private:
     39    void init();
     40  private:
    3741    OrxGui::GLGuiText _name;           //!< The Name of the Proxy server to be displayed.
    3842    OrxGui::GLGuiText _ip;             //!< The IP of the proxy server.
    3943    IP                _storedIP;       //!< The ip to compare.
     44
     45    static Font*      _font;
    4046};
    4147
    4248
    43 class ProxyWidget : public OrxGui::GLGuiBox
     49class NodeWidget : public OrxGui::GLGuiBox
    4450{
    4551  public:
    46     ProxyWidget(const std::string& proxyName, const IP& ip);
     52    NodeWidget(const std::string& proxyName, const IP& ip);
     53    NodeWidget(const NetworkNode* node);
    4754
    48     void addClient(const std::string& name, const IP& ip);
     55    void addNode(const NetworkNode* node);
     56    void addNode(const std::string& name, const IP& ip);
    4957
    50     bool removeClient(const IP& ip);
    51     bool removeClient(const std::string& name);
    52     bool removeClient(const std::string& name, const IP& ip);
     58    bool removeNode(const IP& ip);
     59    bool removeNode(const std::string& name);
     60    bool removeNode(const std::string& name, const IP& ip);
    5361
    54     void setClientNameWidths(float width);
     62    void setNodeNameWidths(float width);
    5563
    5664
     
    6371    HostWidget                _proxyWidget;
    6472
    65     std::vector<HostWidget*>  _clients;
    66     float                     _clientNameWidth;
     73    std::vector<NodeWidget*>  _nodes;
     74    float                     _nodeNameWidth;
    6775};
    6876
     
    7179
    7280//! A class to display network Statistics.
    73 class NetworkStatsWidget : public OrxGui::GLGuiBox
     81class NetworkStatsWidget : public OrxGui::GLGuiFixedpositionBox
    7482{
    7583  public:
     84    static void toggleGUI();
     85
    7686    NetworkStatsWidget(const NetworkMonitor* monitor);
    7787    virtual ~NetworkStatsWidget();
     
    8494
    8595    void addProxy(const std::string& name, const IP& proxy);
     96    void addNode(const NetworkNode* node);
    8697
     98    void clearProxies();
     99
     100    void rebuild();
    87101
    88102    //void rebuildConnectedHosts(std::vector<hosts> hosts);
     
    101115    const NetworkMonitor*  _monitor;
    102116
     117    OrxGui::GLGuiText      _thisHostIs;
    103118    HostWidget             _thisHost;
    104119
     
    106121    OrxGui::GLGuiText      _downstreamText;
    107122
    108     std::vector<HostWidget*>_connectedProxies;
     123    OrxGui::GLGuiBox       _serverBox;
    109124
    110     OrxGui::GLGuiText       _serverIP;
     125    std::vector<NodeWidget*> _proxies;
    111126
    112127
     128    static NetworkStatsWidget*    _statsWidget;
     129
     130
     131    float                   _passedTime;
    113132    //OrxGui::GLGuiText       _valueText;
    114133    //OrxGui::GLGuiBar        _bar;
Note: See TracChangeset for help on using the changeset viewer.