Diffstat (limited to 'noncore/net/wellenreiter/gui/graphwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/graphwindow.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/net/wellenreiter/gui/graphwindow.cpp b/noncore/net/wellenreiter/gui/graphwindow.cpp index c620fe2..7e1f378 100644 --- a/noncore/net/wellenreiter/gui/graphwindow.cpp +++ b/noncore/net/wellenreiter/gui/graphwindow.cpp @@ -38,31 +38,31 @@ void MFrequencySpectrum::drawLine( QPainter* p, int x, int y, int width, const Q { p->setPen( c.light() ); p->drawPoint( x++, y ); p->setPen( c ); p->drawLine( x, y, x+width-2, y ); p->setPen( c.dark() ); p->drawPoint( x+width-1, y ); } void MFrequencySpectrum::drawBar( QPainter* p, int x, int y, int width, int height, int maxheight ) { -/* int h1 = 133; int h2 = 0; + int h1 = 133; int h2 = 0; int s1 = 200; int s2 = 255; - int v1 = 140; int v2 = 255; */ + int v1 = 140; int v2 = 255; - int h1 = 196; int h2 = 194; + /*int h1 = 196; int h2 = 194; int s1 = 85; int s2 = 15; - int v1 = 95; int v2 = 237; + int v1 = 95; int v2 = 237;*/ QColor c( 120, 60, 200 ); for ( int i = 0; i < height; ++i ) { int h = (h2-h1)*i/maxheight + h1; int s = (s2-s1)*i/maxheight + s1; int v = (v2-v1)*i/maxheight + v1; drawLine( p, x, y-i, width, QColor( h,s,v, QColor::Hsv ) ); } /*for ( int i = height; i < maxheight; ++i ) drawLine( p, x, y-i, width, QColor( 47, 68, 76 ) );*/ @@ -116,44 +116,44 @@ void Legende::drawContents( QPainter* p ) int width = ( contentsRect().width() - 2 * xmargin ) / _channels; for ( int i = 0; i < _channels; ++i ) p->drawText( xmargin + (width*i), 12, QString().sprintf( "%02d", i+1 ) ); } MGraphWindow::MGraphWindow( QWidget* parent, const char* name, WFlags f ) :QVBox( parent, name, f ) { spectrum = new MFrequencySpectrum( 14, this ); legende = new Legende( 14, this ); - startTimer( 50 ); + startTimer( 50 ); //FIXME: tweak //testGraph(); }; void MGraphWindow::testGraph() { static int i = 0; spectrum->setValue( i++, 100 ); if ( i == 14 ) i = 0; QTimer::singleShot( 2000, this, SLOT( testGraph() ) ); } void MGraphWindow::timerEvent( QTimerEvent* e ) { for ( int i = 0; i < 14; i++ ) { - spectrum->decrease( i, 4 ); + spectrum->decrease( i, 1 ); //TODO: make this customizable? } spectrum->repaint(); } void MGraphWindow::traffic( int channel, int signal ) { spectrum->setValue( channel-1, signal ); } |