Main window of PPPLoad. More...
Publicly inherits QWidget.
MainWindow | ( QWidget* parent=???, const char* name=??? ); |
void | linkDown | ( ); |
void | updateStats | ( unsigned int rxDelta, unsigned int txDelta, unsigned int rxTotal, unsigned int txTotal ); |
virtual void | paintEvent | ( QPaintEvent* e ); |
virtual void | resizeEvent | ( QResizeEvent* e ); |
QString | bytesToString | ( int bytes ); |
void | redrawGraph | ( ); |
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. |
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.Create the main window.
Process a link down indication.
Process the stats update from a PPPStats object.
Redraw the contents of the window.
Rescale the graph to fit in the new window size.
Convert a number of bytes to a reasonable string.
Redraw the graph using the stored data.