Changeset 9438 in orxonox.OLD for branches/proxy/src/lib/network
- Timestamp:
- Jul 24, 2006, 5:07:55 PM (18 years ago)
- Location:
- branches/proxy/src/lib/network/monitor
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/monitor/network_monitor.cc
r9431 r9438 31 31 32 32 33 SHELL_COMMAND(showGUI, NetworkMonitor, showGUI); 34 SHELL_COMMAND(hideGUI, NetworkMonitor, hideGUI); 33 #include "network_stats_widget.h" 34 35 SHELL_COMMAND(gui, NetworkMonitor, toggleGUI); 35 36 SHELL_COMMAND(debug, NetworkMonitor, debug); 36 37 … … 72 73 } 73 74 } 75 this->box = NULL; 74 76 } 75 77 … … 196 198 * this displays the network monitor gui 197 199 */ 198 void NetworkMonitor:: showGUI()200 void NetworkMonitor::toggleGUI() 199 201 { 200 202 if (this->box == NULL) … … 202 204 this->box = new OrxGui::GLGuiBox(OrxGui::Vertical); 203 205 { 204 OrxGui::GLGuiBox* waterColorBox = new OrxGui::GLGuiBox(OrxGui::Horizontal); 205 { 206 OrxGui::GLGuiText* waterColorText = new OrxGui::GLGuiText(); 207 waterColorText->setText("NetworkMonitor"); 208 waterColorBox->pack(waterColorText); 209 } 210 this->box->pack(waterColorBox); 206 NetworkStatsWidget* netStats = new NetworkStatsWidget(); 207 this->box->pack(netStats); 208 211 209 } 212 210 213 211 this->box->showAll(); 214 212 this->box->setAbsCoor2D(300, 40); 215 OrxGui::GLGuiHandler::getInstance()->activate(); 216 // OrxGui::GLGuiHandler::getInstance()->activateCursor(); 217 } 218 } 219 220 221 /** 222 * hides the network monitor gui again 223 */ 224 void NetworkMonitor::hideGUI() 225 { 226 if( this->box == NULL) 227 return; 228 229 OrxGui::GLGuiHandler::getInstance()->deactivate(); 230 // OrxGui::GLGuiHandler::getInstance()->deactivateCursor(); 231 232 delete this->box; 233 this->box = NULL; 234 } 235 213 } 214 else 215 { 216 delete this->box; 217 this->box = NULL; 218 } 219 } 236 220 237 221 /** -
branches/proxy/src/lib/network/monitor/network_monitor.h
r9431 r9438 74 74 75 75 76 void showGUI(); 77 void hideGUI(); 76 void toggleGUI(); 78 77 79 78 void process(); -
branches/proxy/src/lib/network/monitor/network_stats_widget.cc
r9437 r9438 19 19 20 20 #include "multi_type.h" 21 22 #include "shell_command.h"23 //#include "network_monitor.h"24 25 SHELL_COMMAND(gui, NetworkStatsWidget, gui);26 27 21 28 22 HostWidget::HostWidget(const std::string& name, const IP& ip) … … 142 136 //======================================================// 143 137 144 145 void NetworkStatsWidget::gui()146 {147 printf("YEAH\n");148 }149 150 151 138 /** 152 139 * @brief standard constructor … … 157 144 // this->setClassID(CL_PROTO_ID, "NetworkStatsWidget"); 158 145 146 /* 159 147 this->_bar.setSize2D(100, 30); 160 148 this->pack(&this->_valueText); … … 173 161 this->_bar.setForegroundColor(Color(.5, .5, .5, 1)); 174 162 this->_bar.setChangedValueColor(Color::black); 163 */ 164 this->pack(&this->_thisHost); 165 166 this->pack(&this->_upstreamText); 167 this->pack(&this->_downstreamText); 168 169 this->pack(&this->_serverIP); 175 170 } 176 171 … … 185 180 void NetworkStatsWidget::setMaximum(float max) 186 181 { 187 this->_bar.setMaximum(max);182 // this->_bar.setMaximum(max); 188 183 } 189 184 … … 192 187 MultiType val(value); 193 188 val.setType(MT_INT); 194 189 /* 195 190 196 191 this->_bar.setValue(value); … … 198 193 this->_bar.setFrontColor(Color(1,1,1,1), true); 199 194 this->_valueText.setText(val.getString()); 195 */ 200 196 } 201 197 … … 208 204 void NetworkStatsWidget::showing() 209 205 { 210 this->_valueText.show();211 this->_bar.show();212 206 } 213 207 214 208 void NetworkStatsWidget::hiding() 215 209 { 216 this->_valueText.hide(); 217 this->_bar.hide(); 218 } 210 } -
branches/proxy/src/lib/network/monitor/network_stats_widget.h
r9437 r9438 73 73 { 74 74 public: 75 void gui();76 77 public:78 75 NetworkStatsWidget(); 79 76 virtual ~NetworkStatsWidget(); … … 109 106 110 107 111 OrxGui::GLGuiText _valueText;112 OrxGui::GLGuiBar _bar;108 //OrxGui::GLGuiText _valueText; 109 //OrxGui::GLGuiBar _bar; 113 110 }; 114 111
Note: See TracChangeset
for help on using the changeset viewer.