# MainWindow

Main window of PPPLoad. More...

Publicly inherits QWidget.

## Public Methods

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

## Public Slots

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

## Protected Methods

virtual void | paintEvent | ( QPaintEvent* e );
virtual void | resizeEvent | ( QResizeEvent* e );

## Private Methods

QString | bytesToString | ( int bytes );
void | redrawGraph | ( );

## 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:19