Changeset 9642 in orxonox.OLD for branches/proxy
- Timestamp:
- Jul 31, 2006, 10:32:46 AM (18 years ago)
- 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 18 18 #include "network_stats_widget.h" 19 19 #include "network_monitor.h" 20 #include "peer_info.h" 20 21 21 22 #include "multi_type.h" … … 33 34 : GLGuiBox(OrxGui::Horizontal) 34 35 { 36 this->init(); 37 35 38 this->setName(name); 36 39 this->setIP(ip); 37 40 41 } 42 43 HostWidget::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 51 void HostWidget::init() 52 { 38 53 if(_font == NULL) 39 54 _font = new Font(ResourceManager::getInstance()->getDataDir() + "/fonts/arial.ttf", 20); 40 55 41 this->_name.setFont(*_font);56 //this->_name.setFont(*_font); 42 57 this->_name.setTextSize(15); 43 this->_ip.setFont(*_font);58 //this->_ip.setFont(*_font); 44 59 this->_ip.setTextSize(15); 45 60 … … 62 77 Font* HostWidget::_font = NULL; 63 78 79 80 81 64 82 //======================================================// 65 83 … … 73 91 74 92 NodeWidget::NodeWidget(const NetworkNode* node) 75 : _proxyWidget( "node", node->getPeerInfo()->ip)93 : _proxyWidget(node->getPeerInfo())// "node", node->getPeerInfo()->ip) 76 94 { 77 95 this->_clientNameWidth = 100.0f; … … 169 187 { 170 188 this->_monitor = monitor; 189 this->_passedTime = 0.0f; 171 190 172 191 /* … … 272 291 {} 273 292 274 void clearProxies(); 293 void NetworkStatsWidget::clearProxies() 294 { 295 } 275 296 276 297 … … 298 319 void NetworkStatsWidget::tick(float dt) 299 320 { 321 322 if ((_passedTime+= dt) > 1.0f) 323 { 324 this->_passedTime = 0.0f; 325 this->rebuild(); 326 } 327 300 328 assert (this->_monitor->getLocalNode() != NULL); 301 329 assert(this->_monitor->getLocalNode()->getPeerInfo() != NULL); -
branches/proxy/src/lib/network/monitor/network_stats_widget.h
r9640 r9642 16 16 class NetworkMonitor; 17 17 class NetworkNode; 18 18 class PeerInfo; 19 19 20 20 class HostWidget : public OrxGui::GLGuiBox … … 22 22 public: 23 23 HostWidget(const std::string& name, const IP& ip); 24 HostWidget(const PeerInfo* peerInfo); 24 25 25 26 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; }; 27 28 28 29 void setNameWidth(float width) { this->_name.setLineWidth(width); }; … … 35 36 virtual void hiding(); 36 37 38 private: 39 void init(); 37 40 private: 38 41 OrxGui::GLGuiText _name; //!< The Name of the Proxy server to be displayed. … … 127 130 static NetworkStatsWidget* _statsWidget; 128 131 132 133 float _passedTime; 129 134 //OrxGui::GLGuiText _valueText; 130 135 //OrxGui::GLGuiBar _bar; -
branches/proxy/src/lib/network/peer_info.cc
r9584 r9642 70 70 { 71 71 72 "mas er server",72 "master server", 73 73 "proxy server active", 74 74 "proxy server passive",
Note: See TracChangeset
for help on using the changeset viewer.