Loading src/gui/bwgraph/graphframe.cpp +13 −30 Changes for src/gui/bwgraph/graphframe.cpp: 13 added lines, 30 removed lines. Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ #include "graphframe.h" /** Default contructor */ GraphFrame::GraphFrame(QWidget *parent) : QFrame(parent) Loading Loading @@ -55,10 +56,8 @@ GraphFrame::~GraphFrame() delete _sendData; } /** Gets the width of the desktop, which is the maximum number of points we can plot in the graph */ /** Gets the width of the desktop, which is the maximum number of points * we can plot in the graph. */ int GraphFrame::getNumPoints() { Loading @@ -67,9 +66,7 @@ GraphFrame::getNumPoints() return width; } /** Adds new data points to the graph */ /** Adds new data points to the graph. */ void GraphFrame::addPoints(qreal recv, qreal send) { Loading @@ -94,9 +91,7 @@ GraphFrame::addPoints(qreal recv, qreal send) this->update(); } /** Clears the graph */ /** Clears the graph. */ void GraphFrame::resetGraph() { Loading @@ -110,9 +105,7 @@ GraphFrame::resetGraph() this->update(); } /** Toggles display of respective graph lines and counters */ /** Toggles display of respective graph lines and counters. */ void GraphFrame::setShowCounters(bool showRecv, bool showSend) { Loading @@ -121,10 +114,8 @@ GraphFrame::setShowCounters(bool showRecv, bool showSend) this->update(); } /** Overloads default QWidget::paintEvent Draws the actual bandwidth graph */ /** Overloads default QWidget::paintEvent. Draws the actual * bandwidth graph. */ void GraphFrame::paintEvent(QPaintEvent *event) { Loading Loading @@ -216,9 +207,8 @@ GraphFrame::paintIntegral(QList<qreal>* list, QColor color, qreal alpha) _painter->setBrush(oldBrush); } /** Iterates the input list and draws a line on the graph in the appropriate color */ /** Iterates the input list and draws a line on the graph in the appropriate * color. */ void GraphFrame::paintLine(QList<qreal>* list, QColor color, Qt::PenStyle lineStyle) { Loading Loading @@ -252,9 +242,7 @@ GraphFrame::paintLine(QList<qreal>* list, QColor color, Qt::PenStyle lineStyle) _painter->setPen(oldPen); } /** Paints selected total indicators on the graph */ /** Paints selected total indicators on the graph. */ void GraphFrame::paintTotals() { Loading @@ -277,10 +265,7 @@ GraphFrame::paintTotals() } } /** Returns a formatted string with the correct size suffix */ /** Returns a formatted string with the correct size suffix. */ QString GraphFrame::totalToStr(qreal total) { Loading @@ -297,9 +282,7 @@ GraphFrame::totalToStr(qreal total) } } /** Paints the scale on the graph */ /** Paints the scale on the graph. */ void GraphFrame::paintScale() { Loading src/gui/bwgraph/graphframe.h +19 −19 Changes for src/gui/bwgraph/graphframe.h: 19 added lines, 19 removed lines. Original line number Diff line number Diff line Loading @@ -52,56 +52,56 @@ class GraphFrame : public QFrame Q_OBJECT public: /** Default Constructor **/ /** Default Constructor */ GraphFrame(QWidget *parent = 0); /** Default Destructor **/ /** Default Destructor */ ~GraphFrame(); /** Add data points **/ /** Add data points. */ void addPoints(qreal recv, qreal send); /** Clears the graph **/ /** Clears the graph. */ void resetGraph(); /** Toggles display of data counters **/ /** Toggles display of data counters. */ void setShowCounters(bool showRecv, bool showSend); protected: /** Overloaded QWidget::paintEvent() **/ /** Overloaded QWidget::paintEvent() */ void paintEvent(QPaintEvent *event); private: /** Gets the width of the desktop, the max # of points **/ /** Gets the width of the desktop, the max # of points. */ int getNumPoints(); /** Paints an integral and an outline of that integral for each data set * (send and/or receive) that is to be displayed. */ void paintData(); /** Paints the send/receive totals **/ /** Paints the send/receive totals. */ void paintTotals(); /** Paints the scale in the graph **/ /** Paints the scale in the graph. */ void paintScale(); /** Returns a formatted string representation of total **/ /** Returns a formatted string representation of total. */ QString totalToStr(qreal total); /** Paints a line with the data in list **/ /** Paints a line with the data in list. */ void paintLine(QList<qreal>* list, QColor color, Qt::PenStyle lineStyle = Qt::SolidLine); /** Paints an integral using the supplied data. */ void paintIntegral(QList<qreal>* list, QColor color, qreal alpha = 1.0); /** A QPainter object that handles drawing the various graph elements */ /** A QPainter object that handles drawing the various graph elements. */ QPainter* _painter; /** Holds the received data points **/ /** Holds the received data points. */ QList<qreal> *_recvData; /** Holds the sent data points **/ /** Holds the sent data points. */ QList<qreal> *_sendData; /** The current dimensions of the graph */ /** The current dimensions of the graph. */ QRect _rec; /** The maximum data value plotted **/ /** The maximum data value plotted. */ qreal _maxValue; /** The maximum number of points to store **/ /** The maximum number of points to store. */ int _maxPoints; /** The total data sent/recv **/ /** The total data sent/recv. */ qreal _totalSend; qreal _totalRecv; /** Show the respective lines and counters **/ /** Show the respective lines and counters. */ bool _showRecv; bool _showSend; }; Loading Loading
src/gui/bwgraph/graphframe.cpp +13 −30 Changes for src/gui/bwgraph/graphframe.cpp: 13 added lines, 30 removed lines. Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ #include "graphframe.h" /** Default contructor */ GraphFrame::GraphFrame(QWidget *parent) : QFrame(parent) Loading Loading @@ -55,10 +56,8 @@ GraphFrame::~GraphFrame() delete _sendData; } /** Gets the width of the desktop, which is the maximum number of points we can plot in the graph */ /** Gets the width of the desktop, which is the maximum number of points * we can plot in the graph. */ int GraphFrame::getNumPoints() { Loading @@ -67,9 +66,7 @@ GraphFrame::getNumPoints() return width; } /** Adds new data points to the graph */ /** Adds new data points to the graph. */ void GraphFrame::addPoints(qreal recv, qreal send) { Loading @@ -94,9 +91,7 @@ GraphFrame::addPoints(qreal recv, qreal send) this->update(); } /** Clears the graph */ /** Clears the graph. */ void GraphFrame::resetGraph() { Loading @@ -110,9 +105,7 @@ GraphFrame::resetGraph() this->update(); } /** Toggles display of respective graph lines and counters */ /** Toggles display of respective graph lines and counters. */ void GraphFrame::setShowCounters(bool showRecv, bool showSend) { Loading @@ -121,10 +114,8 @@ GraphFrame::setShowCounters(bool showRecv, bool showSend) this->update(); } /** Overloads default QWidget::paintEvent Draws the actual bandwidth graph */ /** Overloads default QWidget::paintEvent. Draws the actual * bandwidth graph. */ void GraphFrame::paintEvent(QPaintEvent *event) { Loading Loading @@ -216,9 +207,8 @@ GraphFrame::paintIntegral(QList<qreal>* list, QColor color, qreal alpha) _painter->setBrush(oldBrush); } /** Iterates the input list and draws a line on the graph in the appropriate color */ /** Iterates the input list and draws a line on the graph in the appropriate * color. */ void GraphFrame::paintLine(QList<qreal>* list, QColor color, Qt::PenStyle lineStyle) { Loading Loading @@ -252,9 +242,7 @@ GraphFrame::paintLine(QList<qreal>* list, QColor color, Qt::PenStyle lineStyle) _painter->setPen(oldPen); } /** Paints selected total indicators on the graph */ /** Paints selected total indicators on the graph. */ void GraphFrame::paintTotals() { Loading @@ -277,10 +265,7 @@ GraphFrame::paintTotals() } } /** Returns a formatted string with the correct size suffix */ /** Returns a formatted string with the correct size suffix. */ QString GraphFrame::totalToStr(qreal total) { Loading @@ -297,9 +282,7 @@ GraphFrame::totalToStr(qreal total) } } /** Paints the scale on the graph */ /** Paints the scale on the graph. */ void GraphFrame::paintScale() { Loading
src/gui/bwgraph/graphframe.h +19 −19 Changes for src/gui/bwgraph/graphframe.h: 19 added lines, 19 removed lines. Original line number Diff line number Diff line Loading @@ -52,56 +52,56 @@ class GraphFrame : public QFrame Q_OBJECT public: /** Default Constructor **/ /** Default Constructor */ GraphFrame(QWidget *parent = 0); /** Default Destructor **/ /** Default Destructor */ ~GraphFrame(); /** Add data points **/ /** Add data points. */ void addPoints(qreal recv, qreal send); /** Clears the graph **/ /** Clears the graph. */ void resetGraph(); /** Toggles display of data counters **/ /** Toggles display of data counters. */ void setShowCounters(bool showRecv, bool showSend); protected: /** Overloaded QWidget::paintEvent() **/ /** Overloaded QWidget::paintEvent() */ void paintEvent(QPaintEvent *event); private: /** Gets the width of the desktop, the max # of points **/ /** Gets the width of the desktop, the max # of points. */ int getNumPoints(); /** Paints an integral and an outline of that integral for each data set * (send and/or receive) that is to be displayed. */ void paintData(); /** Paints the send/receive totals **/ /** Paints the send/receive totals. */ void paintTotals(); /** Paints the scale in the graph **/ /** Paints the scale in the graph. */ void paintScale(); /** Returns a formatted string representation of total **/ /** Returns a formatted string representation of total. */ QString totalToStr(qreal total); /** Paints a line with the data in list **/ /** Paints a line with the data in list. */ void paintLine(QList<qreal>* list, QColor color, Qt::PenStyle lineStyle = Qt::SolidLine); /** Paints an integral using the supplied data. */ void paintIntegral(QList<qreal>* list, QColor color, qreal alpha = 1.0); /** A QPainter object that handles drawing the various graph elements */ /** A QPainter object that handles drawing the various graph elements. */ QPainter* _painter; /** Holds the received data points **/ /** Holds the received data points. */ QList<qreal> *_recvData; /** Holds the sent data points **/ /** Holds the sent data points. */ QList<qreal> *_sendData; /** The current dimensions of the graph */ /** The current dimensions of the graph. */ QRect _rec; /** The maximum data value plotted **/ /** The maximum data value plotted. */ qreal _maxValue; /** The maximum number of points to store **/ /** The maximum number of points to store. */ int _maxPoints; /** The total data sent/recv **/ /** The total data sent/recv. */ qreal _totalSend; qreal _totalRecv; /** Show the respective lines and counters **/ /** Show the respective lines and counters. */ bool _showRecv; bool _showSend; }; Loading