Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

LedBar.h

Go to the documentation of this file.
00001 #ifndef QLEDBAR_HPP 00002 #define QLEDBAR_HPP 00003 00004 #include <qcolor.h> 00005 #include <qevent.h> 00006 #include <qpixmap.h> 00007 #ifdef QT_THREAD_SUPPORT 00008 #include <qthread.h> 00009 #endif 00010 #include <qwidget.h> 00011 00012 class CLedBar: public QWidget 00013 { 00014 Q_OBJECT 00015 public: 00016 enum Orientation { // orientation, like a compass; the bars grow from the centre 00017 North, 00018 West, 00019 South, 00020 East 00021 }; 00022 00023 enum BarMode { 00024 SolidBar, 00025 SegmentBar, 00026 00027 }; 00028 00029 private: 00030 #ifdef QT_THREAD_SUPPORT 00031 QMutex Busy; 00032 #endif 00033 int Minimum, Maximum, Range, Value; 00034 Orientation BarOrientation; 00035 int BarLength; // in pixels 00036 int BarWidth; // in pixels 00037 BarMode m_BarMode; 00038 00039 int Segments; 00040 int Margin; 00041 00042 int StartOfSegment[21]; // start of segment in pixels from beginning 00043 int ValueForSegment[20]; // start of segment in value 00044 QColor ColorOfSegment[20]; 00045 00046 QPixmap DrawingArea; 00047 00048 void BusyLock(); 00049 void BusyUnlock(); 00050 00051 void CalcBoundaries(); 00052 00053 protected: 00054 void resizeEvent(QResizeEvent *); 00055 void paintEvent(QPaintEvent *); 00056 00057 public: 00058 CLedBar(Orientation orientation, int min_range, int max_range, BarMode bar_mode = SolidBar, QWidget *parent = 0, const char *name = 0); 00059 00060 void SetBarMode(BarMode bar_mode); 00061 void SetSegments(int segments, const QColor *colors); 00062 void SetMargin(int width); 00063 00064 // SetPeakHold(int value, int time_ms); 00065 00066 public slots: 00067 void setValue(int value); 00068 }; 00069 00070 #endif

Generated on Wed Dec 13 23:38:46 2006 for CamStream by doxygen 1.3.7