Changeset 9383 in orxonox.OLD for branches/proxy/src/util/network_stats_widget.h
- Timestamp:
- Jul 21, 2006, 12:51:19 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/util/network_stats_widget.h
r9347 r9383 17 17 { 18 18 19 class HostWidget : public GLGuiBox 20 { 21 public: 22 HostWidget(const std::string& name, const IP& ip); 23 ~HostWidget() {}; 24 25 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 28 void setNameWidth(float width) { this->_name.setLineWidth(width); }; 29 30 bool operator==(const IP& ip) const { return (this->_storedIP == ip); }; 31 bool operator==(const std::string& name) const { return (this->_name == name); }; 32 33 protected: 34 virtual void showing(); 35 virtual void hiding(); 36 37 private: 38 GLGuiText _name; //!< The Name of the Proxy server to be displayed. 39 GLGuiText _ip; //!< The IP of the proxy server. 40 IP _storedIP; //!< The ip to compare. 41 }; 42 43 44 class ProxyWidget : public GLGuiBox 45 { 46 public: 47 ProxyWidget(const std::string& proxyName, const IP& ip); 48 49 void addClient(const std::string& name, const IP& ip); 50 51 bool removeClient(const IP& ip); 52 bool removeClient(const std::string& name); 53 bool removeClient(const std::string& name, const IP& ip); 54 55 56 protected: 57 virtual void hiding(); 58 virtual void showing(); 59 60 61 private: 62 HostWidget _proxyWidget; 63 64 std::vector<HostWidget*> _clients; 65 }; 66 67 68 69 19 70 //! A class to display network Statistics. 20 71 class NetworkStatsWidget : public GLGuiBox 21 72 { 73 public: 74 NetworkStatsWidget(); 75 virtual ~NetworkStatsWidget(); 22 76 23 public: 24 NetworkStatsWidget(); 25 virtual ~NetworkStatsWidget(); 26 27 void setUpstream(unsigned int upstream); 28 void setDownstream(unsigned int upstream); 29 void setIP(const IP& ip); 77 void setUpstream(unsigned int upstream); 78 void setDownstream(unsigned int upstream); 79 void setIP(const IP& ip); 30 80 31 81 32 82 33 //void rebuildConnectedHosts(std::vector<hosts> hosts);83 //void rebuildConnectedHosts(std::vector<hosts> hosts); 34 84 35 void setMaximum(float max);36 void setValue(float value);85 void setMaximum(float max); 86 void setValue(float value); 37 87 38 protected:39 virtual void resize();40 virtual void showing();41 virtual void hiding();88 protected: 89 virtual void resize(); 90 virtual void showing(); 91 virtual void hiding(); 42 92 43 private:44 IP _ip;45 GLGuiText _ipText;93 private: 94 IP _ip; 95 GLGuiText _ipText; 46 96 47 GLGuiText _upstreamText;48 GLGuiText _downstreamText;97 GLGuiText _upstreamText; 98 GLGuiText _downstreamText; 49 99 50 std::vector<GLGuiText> _connectedHosts;100 std::vector<GLGuiText> _connectedHosts; 51 101 52 GLGuiText _serverIP;102 GLGuiText _serverIP; 53 103 54 104 55 GLGuiText _valueText;56 GLGuiBar _bar;105 GLGuiText _valueText; 106 GLGuiBar _bar; 57 107 }; 58 108 }
Note: See TracChangeset
for help on using the changeset viewer.