MainWindow

Main window of PPPLoad. More...

Publicly inherits QWidget.

Public Methods

MainWindow( QWidget* parent=???, const char* name=??? );

Public Slots

voidlinkDown( );
voidupdateStats( unsigned int rxDelta, unsigned int txDelta, unsigned int rxTotal, unsigned int txTotal );

Protected Methods

virtual voidpaintEvent( QPaintEvent* e );
virtual voidresizeEvent( QResizeEvent* e );

Private Methods

QStringbytesToString( int bytes );
voidredrawGraph( );

Private Data Members

int_dataSize; The size of the data arrays.
int_fontBaseline; Baseline for the font.
int_fontHeight; Height of one character.
int_fontWidth; Width of one character.
int_historySize; The size of the history arrays (basically the width of the window).
int_max; Current maximum transfer rate.
QPixmap_pixmap; Off-screen buffer for drawing and paint events.
int_rxAverage; Average receive rate.
int*_rxData; Array of receive data for computing average.
int*_rxHistory; Array of last n receive rates.
QString_rxStr; Last receive total string.
int_txAverage; Average transmit rate.
int*_txData; Array of transmit data for computing average.
int*_txHistory; Array of last n transmit rates.
QString_txStr; Last transmit total string.

Detailed Documentation

Main window of PPPLoad.

The MainWindow takes PPP stats updates from a PPPStats object, and draws a graph of the transmit and receive rates. Below the graph, the total number of bytes transmitted and received is displayed.

Public Methods Documentation

MainWindow ( QWidget* parent=???, const char* name=??? );

Create the main window.

Public Slots Documentation

void linkDown ( );

Process a link down indication.

void updateStats ( unsigned int rxDelta, unsigned int txDelta, unsigned int rxTotal, unsigned int txTotal );

Process the stats update from a PPPStats object.

Protected Methods Documentation

virtual void paintEvent ( QPaintEvent* e );

Redraw the contents of the window.

virtual void resizeEvent ( QResizeEvent* e );

Rescale the graph to fit in the new window size.

Private Methods Documentation

QString bytesToString ( int bytes );

Convert a number of bytes to a reasonable string.

void redrawGraph ( );

Redraw the graph using the stored data.


Return to Index.
Automatically generated on Oct 27 22:18