orca-robotics


INTRODUCTION
Overview
Download and Install
Quick Start
Documentation
Publications

REPOSITORY
Interfaces
Components
Libraries
Utilities
Software Map

DEVELOPER
Tutorials
Examples
Dev Guide
Dashboard
Wiki
login/pass: orca/orca

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

wifielement.h

00001 /*
00002  * Orca-Robotics Project: Components for robotics 
00003  *               http://orca-robotics.sf.net/
00004  * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp, Ben Upcroft
00005  *
00006  * This copy of Orca is licensed to you under the terms described in
00007  * the LICENSE file included in this distribution.
00008  *
00009  */
00010 
00011 #ifndef ORCAGUI_WIFI_ELEMENT_H
00012 #define ORCAGUI_WIFI_ELEMENT_H
00013 
00014 #include <QVector>
00015 #include <orca/wifi.h>
00016 #include <orcaqguielementutil/icestormelement.h>
00017 #include <orcaqgui2dfactory/wifipainter.h>
00018 
00019 class QProgressBar;
00020 class QLCDNumber;
00021 class QLabel;
00022 
00023 namespace orcaqgui2d {
00024 
00025 // Widget to display wifi data, number of interfaces is fixed
00026 // after the first data is received
00027 // Author: Tobias Kaupp
00028 class WifiWidget : public QWidget
00029 {
00030     public:
00031         WifiWidget( unsigned int numInterfaces, std::string proxyString );
00032         ~WifiWidget() {};
00033         void refresh( orca::WifiData &data );
00034         
00035     private:
00036         QVector<QProgressBar*> progressBars_;
00037         QVector<QLCDNumber*> lcdsSignal_;
00038         QVector<QLCDNumber*> lcdsMaxSignal_;
00039         QVector<QLCDNumber*> lcdsNoise_;
00040         QVector<QLCDNumber*> lcdsMaxNoise_;
00041         QVector<QLCDNumber*> lcdsLink_;
00042         QVector<QLCDNumber*> lcdsMaxLink_;
00043         QVector<QLCDNumber*> lcdsBitrate_;
00044         QVector<QLabel*> interfaceLabels_;
00045         QVector<QLabel*> accessPointLabels_;
00046         QVector<QLabel*> overallSigLabels_;
00047         
00048         void setupDisplay();
00049         unsigned int numInterfaces_;
00050         QVector<int> signalThreshholds_;
00051         QString getSignalLabel( int snr );
00052 
00053 };
00054 
00055 class WifiElement
00056     : public orcaqguielementutil::IceStormElement<WifiPainter,
00057                              orca::WifiData,
00058                              orca::WifiPrx,
00059                              orca::WifiConsumer,
00060                              orca::WifiConsumerPrx>
00061 {
00062 public:
00063     WifiElement( const orcaice::Context  &context,
00064                  const std::string       &proxyString,
00065                  int                      timeoutMs=30000 );
00066     ~WifiElement();
00067 
00068     virtual bool isInGlobalCS() { return true; };
00069     virtual void update();
00070     virtual void actionOnConnection() {};
00071 
00072 private:
00073     WifiPainter painter_;
00074     WifiWidget *wifiWidget_;
00075     std::string proxyString_;
00076 };
00077 
00078 }
00079 
00080 #endif
 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5