Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9265 in orxonox.OLD for branches


Ignore:
Timestamp:
Jul 13, 2006, 10:32:22 AM (18 years ago)
Author:
patrick
Message:

network monitor gui

Location:
branches/proxy/src/lib/network
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/network/network_monitor.cc

    r9264 r9265  
    4242
    4343
     44/**
     45 * this displays the network monitor gui
     46 */
     47void NetworkMonitor::showGUI()
     48{
     49  if (this->box == NULL)
     50  {
     51    this->box = new OrxGui::GLGuiBox(OrxGui::Vertical);
     52    {
     53      OrxGui::GLGuiBox* waterColorBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
     54      {
     55        OrxGui::GLGuiText* waterColorText = new OrxGui::GLGuiText();
     56        waterColorText->setText("NetworkMonitor");
     57        waterColorBox->pack(waterColorText);
     58      }
     59      this->box->pack(waterColorBox);
     60    }
     61
     62    this->box->showAll();
     63    this->box->setAbsCoor2D(300, 40);
     64    OrxGui::GLGuiHandler::getInstance()->activate();
     65    OrxGui::GLGuiHandler::getInstance()->activateCursor();
     66  }
     67  else
     68  {
     69    OrxGui::GLGuiHandler::getInstance()->deactivate();
     70    OrxGui::GLGuiHandler::getInstance()->deactivateCursor();
     71    delete this->box;
     72    this->box = NULL;
     73  }
     74}
    4475
    4576
     77/**
     78 * processes the network monitor data
     79 */
     80void NetworkMonitor::process()
     81{
    4682
    47 #if 0
    48   if (this->box == NULL)
    49 {
    50   this->box = new OrxGui::GLGuiBox(OrxGui::Vertical);
    51   {
    52     OrxGui::GLGuiBox* waterColorBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
    53     {
    54       OrxGui::GLGuiText* waterColorText = new OrxGui::GLGuiText();
    55       waterColorText->setText("WaterColor");
    56       waterColorBox->pack(waterColorText);
     83}
    5784
    58       OrxGui::GLGuiSlider* waterColorR = new OrxGui::GLGuiSlider();
    59       waterColorR->setRange(0, 1.0f);
    60       waterColorR->setValue(this->waterColor.x);
    61       waterColorR->setStep(0.1f);
    62       waterColorR->connect(SIGNAL(waterColorR, valueChanged), this, SLOT(MappedWater, resetWaterColorR));
    63       waterColorBox->pack(waterColorR);
    64 
    65       OrxGui::GLGuiSlider* waterColorG = new OrxGui::GLGuiSlider();
    66       waterColorG->setRange(0, 1.0f);
    67       waterColorG->setStep(0.1f);
    68       waterColorG->setValue(this->waterColor.y);
    69       waterColorG->connect(SIGNAL(waterColorG, valueChanged), this, SLOT(MappedWater, resetWaterColorG));
    70       waterColorBox->pack(waterColorG);
    71 
    72       OrxGui::GLGuiSlider* waterColorB = new OrxGui::GLGuiSlider();
    73       waterColorB->setRange(0, 1.0f);
    74       waterColorB->setStep(0.1f);
    75       waterColorB->setValue(this->waterColor.z);
    76       waterColorB->connect(SIGNAL(waterColorB, valueChanged), this, SLOT(MappedWater, resetWaterColorB));
    77       waterColorBox->pack(waterColorB);
    78     }
    79     this->box->pack(waterColorBox);
    80 
    81     OrxGui::GLGuiBox* waterUVBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
    82     {
    83       OrxGui::GLGuiText* waterUVText = new OrxGui::GLGuiText();
    84       waterUVText->setText("WaterUV");
    85       waterUVBox->pack(waterUVText);
    86 
    87       OrxGui::GLGuiSlider* waterUV = new OrxGui::GLGuiSlider();
    88       waterUV->setRange(1, 20);
    89       waterUV->setValue(this->waterUV);
    90       waterUV->setStep(1);
    91       waterUV->connect(SIGNAL(waterUV, valueChanged), this, SLOT(MappedWater, setWaterUV));
    92       waterUVBox->pack(waterUV);
    93     }
    94     this->box->pack(waterUVBox);
    95 
    96     OrxGui::GLGuiBox* waterFlowBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
    97     {
    98       OrxGui::GLGuiText* waterFlowText = new OrxGui::GLGuiText();
    99       waterFlowText->setText("WaterFlow");
    100       waterFlowBox->pack(waterFlowText);
    101 
    102       OrxGui::GLGuiSlider* waterFlow = new OrxGui::GLGuiSlider();
    103       waterFlow->setRange(0.01f, 2);
    104       waterFlow->setValue(this->waterFlow);
    105       waterFlow->setStep(0.02f);
    106       waterFlow->connect(SIGNAL(waterFlow, valueChanged), this, SLOT(MappedWater, setWaterFlow));
    107       waterFlowBox->pack(waterFlow);
    108     }
    109     this->box->pack(waterFlowBox);
    110 
    111     OrxGui::GLGuiBox* shineSizeBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
    112     {
    113       OrxGui::GLGuiText* shineSizeText = new OrxGui::GLGuiText();
    114       shineSizeText->setText("ShineSize");
    115       shineSizeBox->pack(shineSizeText);
    116 
    117       OrxGui::GLGuiSlider* shineSize = new OrxGui::GLGuiSlider();
    118       shineSize->setRange(1, 128);
    119       shineSize->setValue(this->shineSize);
    120       shineSize->setStep(1);
    121       shineSize->connect(SIGNAL(shineSize, valueChanged), this, SLOT(MappedWater, resetShineSize));
    122       shineSizeBox->pack(shineSize);
    123     }
    124     this->box->pack(shineSizeBox);
    125 
    126     OrxGui::GLGuiBox* shineStrengthBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
    127     {
    128       OrxGui::GLGuiText* shineStrengthText = new OrxGui::GLGuiText();
    129       shineStrengthText->setText("ShineStrength");
    130       shineStrengthBox->pack(shineStrengthText);
    131 
    132       OrxGui::GLGuiSlider* shineStrength = new OrxGui::GLGuiSlider();
    133       shineStrength->setRange(0, 1);
    134       shineStrength->setValue(this->shineStrength);
    135       shineStrength->setStep(0.1f);
    136       shineStrength->connect(SIGNAL(shineStrength, valueChanged), this, SLOT(MappedWater, resetShineStrength));
    137       shineStrengthBox->pack(shineStrength);
    138     }
    139     this->box->pack(shineStrengthBox);
    140 
    141     OrxGui::GLGuiBox* reflStrengthBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
    142     {
    143       OrxGui::GLGuiText* reflStrengthText = new OrxGui::GLGuiText();
    144       reflStrengthText->setText("ReflStrength");
    145       reflStrengthBox->pack(reflStrengthText);
    146 
    147       OrxGui::GLGuiSlider* reflStrength = new OrxGui::GLGuiSlider();
    148       reflStrength->setRange(0, 1);
    149       reflStrength->setValue(this->reflStrength);
    150       reflStrength->setStep(0.1f);
    151       reflStrength->connect(SIGNAL(reflStrength, valueChanged), this, SLOT(MappedWater, resetReflStrength));
    152       reflStrengthBox->pack(reflStrength);
    153     }
    154     this->box->pack(reflStrengthBox);
    155 
    156     OrxGui::GLGuiBox* refractionBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
    157     {
    158       OrxGui::GLGuiText* refractionText = new OrxGui::GLGuiText();
    159       refractionText->setText("Refraction");
    160       refractionBox->pack(refractionText);
    161 
    162       OrxGui::GLGuiSlider* refraction = new OrxGui::GLGuiSlider();
    163       refraction->setRange(0.001f, 0.1f);
    164       refraction->setValue(this->refraction);
    165       refraction->setStep(0.004f);
    166       refraction->connect(SIGNAL(refraction, valueChanged), this, SLOT(MappedWater, resetRefraction));
    167       refractionBox->pack(refraction);
    168     }
    169     this->box->pack(refractionBox);
    170 
    171     OrxGui::GLGuiBox* lightPosBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
    172     {
    173       OrxGui::GLGuiText* lightPosText = new OrxGui::GLGuiText();
    174       lightPosText->setText("LightPos");
    175       lightPosBox->pack(lightPosText);
    176 
    177       OrxGui::GLGuiSlider* lightPosX = new OrxGui::GLGuiSlider();
    178       lightPosX->setRange(-4000, 4000);
    179       lightPosX->setValue(this->lightPos.x);
    180       lightPosX->setStep(15);
    181       lightPosX->connect(SIGNAL(lightPosX, valueChanged), this, SLOT(MappedWater, resetLightPosX));
    182       lightPosBox->pack(lightPosX);
    183 
    184       OrxGui::GLGuiSlider* lightPosY = new OrxGui::GLGuiSlider();
    185       lightPosY->setRange(-4000, 4000);
    186       lightPosY->setStep(15);
    187       lightPosY->setValue(this->lightPos.y);
    188       lightPosY->connect(SIGNAL(lightPosY, valueChanged), this, SLOT(MappedWater, resetLightPosY));
    189       lightPosBox->pack(lightPosY);
    190 
    191       OrxGui::GLGuiSlider* lightPosZ = new OrxGui::GLGuiSlider();
    192       lightPosZ->setRange(-4000, 4000);
    193       lightPosZ->setStep(15);
    194       lightPosZ->setValue(this->lightPos.z);
    195       lightPosZ->connect(SIGNAL(lightPosZ, valueChanged), this, SLOT(MappedWater, resetLightPosZ));
    196       lightPosBox->pack(lightPosZ);
    197     }
    198     this->box->pack(lightPosBox);
    199 
    200     OrxGui::GLGuiBox* waterHeightBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
    201     {
    202       OrxGui::GLGuiText* waterHeightText = new OrxGui::GLGuiText();
    203       waterHeightText->setText("WaterHeight");
    204       waterHeightBox->pack(waterHeightText);
    205 
    206       OrxGui::GLGuiSlider* waterHeight = new OrxGui::GLGuiSlider();
    207       waterHeight->setRange(100, 370);
    208       waterHeight->setValue(this->waterHeight);
    209       waterHeight->setStep(4);
    210       waterHeight->connect(SIGNAL(waterHeight, valueChanged), this, SLOT(MappedWater, setWaterHeight));
    211       waterHeightBox->pack(waterHeight);
    212     }
    213     this->box->pack(waterHeightBox);
    214   }
    215 
    216   this->box->showAll();
    217   this->box->setAbsCoor2D(300, 40);
    218   OrxGui::GLGuiHandler::getInstance()->activate();
    219   OrxGui::GLGuiHandler::getInstance()->activateCursor();
    220 }
    221   else
    222 {
    223   OrxGui::GLGuiHandler::getInstance()->deactivate();
    224   OrxGui::GLGuiHandler::getInstance()->deactivateCursor();
    225   delete this->box;
    226   this->box = NULL;
    227 }
    228 #endif
  • branches/proxy/src/lib/network/network_monitor.h

    r9264 r9265  
    1515class PeerInfo;
    1616
     17class OrxGui::GLGuiBox;
    1718
    1819class NetworkMonitor : public Synchronizeable
     
    2627    void addClient(PeerInfo* node);
    2728    void addProxyServer(PeerInfo* node);
    28     void addMasterServer(PeerInfor* node);
     29    void addMasterServer(PeerInfo* node);
    2930
    30     void removeClient(PeerInfor* node);
    31     void removeProxyServer(PeerInfor* node);
    32     void removeMasterServer(PeerInfor* node);
     31    void removeClient(PeerInfo* node);
     32    void removeProxyServer(PeerInfo* node);
     33    void removeMasterServer(PeerInfo* node);
    3334
     35    void showGUI();
    3436
    3537    void process();
     
    4042    std::list<PeerInfo*>         proxyServerList;              //!< list of all proxy servers in the network
    4143    std::list<PeerInfo*>         masterServerList;             //!< list of all master servers in the network (should be 1!! :D)
     44
     45    OrxGui::GLGuiBox*            box;
    4246};
    4347
Note: See TracChangeset for help on using the changeset viewer.