Changeset 9656 in orxonox.OLD for trunk/src/lib/network/monitor/network_stats_widget.h
- Timestamp:
- Aug 4, 2006, 11:01:28 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/network/monitor/network_stats_widget.h
r9494 r9656 2 2 * @file network_stats_widget.h 3 3 * @brief Definition of an EnergyWidget, that displays a bar and a Text 4 */4 */ 5 5 6 6 #ifndef _NETWORK_STATS_WIDGET_H 7 7 #define _NETWORK_STATS_WIDGET_H 8 8 9 #include "glgui_ box.h"9 #include "glgui_fixedposition_box.h" 10 10 #include "glgui_bar.h" 11 11 #include "glgui_text.h" 12 #include "glgui_pushbutton.h" 12 13 13 14 #include "network/ip.h" 14 15 15 16 class NetworkMonitor; 16 17 class NetworkNode; 18 class PeerInfo; 17 19 18 20 class HostWidget : public OrxGui::GLGuiBox … … 20 22 public: 21 23 HostWidget(const std::string& name, const IP& ip); 22 ~HostWidget() {};24 HostWidget(const PeerInfo* peerInfo); 23 25 24 26 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; }; 26 28 27 29 void setNameWidth(float width) { this->_name.setLineWidth(width); }; … … 35 37 36 38 private: 39 void init(); 40 private: 37 41 OrxGui::GLGuiText _name; //!< The Name of the Proxy server to be displayed. 38 42 OrxGui::GLGuiText _ip; //!< The IP of the proxy server. 39 43 IP _storedIP; //!< The ip to compare. 44 45 static Font* _font; 40 46 }; 41 47 42 48 43 class ProxyWidget : public OrxGui::GLGuiBox49 class NodeWidget : public OrxGui::GLGuiBox 44 50 { 45 51 public: 46 ProxyWidget(const std::string& proxyName, const IP& ip); 52 NodeWidget(const std::string& proxyName, const IP& ip); 53 NodeWidget(const NetworkNode* node); 47 54 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); 49 57 50 bool remove Client(const IP& ip);51 bool remove Client(const std::string& name);52 bool remove Client(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); 53 61 54 void set ClientNameWidths(float width);62 void setNodeNameWidths(float width); 55 63 56 64 … … 63 71 HostWidget _proxyWidget; 64 72 65 std::vector< HostWidget*> _clients;66 float _ clientNameWidth;73 std::vector<NodeWidget*> _nodes; 74 float _nodeNameWidth; 67 75 }; 68 76 … … 71 79 72 80 //! A class to display network Statistics. 73 class NetworkStatsWidget : public OrxGui::GLGui Box81 class NetworkStatsWidget : public OrxGui::GLGuiFixedpositionBox 74 82 { 75 83 public: 84 static void toggleGUI(); 85 76 86 NetworkStatsWidget(const NetworkMonitor* monitor); 77 87 virtual ~NetworkStatsWidget(); … … 84 94 85 95 void addProxy(const std::string& name, const IP& proxy); 96 void addNode(const NetworkNode* node); 86 97 98 void clearProxies(); 99 100 void rebuild(); 87 101 88 102 //void rebuildConnectedHosts(std::vector<hosts> hosts); … … 101 115 const NetworkMonitor* _monitor; 102 116 117 OrxGui::GLGuiText _thisHostIs; 103 118 HostWidget _thisHost; 104 119 … … 106 121 OrxGui::GLGuiText _downstreamText; 107 122 108 std::vector<HostWidget*>_connectedProxies;123 OrxGui::GLGuiBox _serverBox; 109 124 110 OrxGui::GLGuiText _serverIP;125 std::vector<NodeWidget*> _proxies; 111 126 112 127 128 static NetworkStatsWidget* _statsWidget; 129 130 131 float _passedTime; 113 132 //OrxGui::GLGuiText _valueText; 114 133 //OrxGui::GLGuiBar _bar;
Note: See TracChangeset
for help on using the changeset viewer.