Added a graphframe to Bandwidth Control Window and Turtle Router Statistics Dialog

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7500 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2014-08-29 14:18:50 +00:00
parent 6085ccd43f
commit 29a11b021e
10 changed files with 751 additions and 117 deletions

View file

@ -239,6 +239,7 @@ void TurtleRouterStatistics::updateDisplay()
//updateTunnelRequests(hashes_info,tunnels_info,search_reqs_info,tunnel_reqs_info) ;
_tst_CW->updateTunnelStatistics(hashes_info,tunnels_info,search_reqs_info,tunnel_reqs_info) ;
_tst_CW->update();
updateTunnelGraph();
}
QString TurtleRouterStatistics::getPeerName(const RsPeerId &peer_id)
@ -306,8 +307,8 @@ void TurtleRouterStatisticsWidget::updateTunnelStatistics(const std::vector<std:
oy += celly ;
painter.drawText(ox,oy+celly,tr("Turtle router traffic")+":") ; oy += celly*2 ;
painter.drawText(ox+2*cellx,oy+celly,tr("Tunnel requests Up")+"\t: " + speedString(info.tr_up_Bps) ) ; oy += celly ;
painter.drawText(ox+2*cellx,oy+celly,tr("Tunnel requests Dn")+"\t: " + speedString(info.tr_dn_Bps) ) ; oy += celly ;
painter.drawText(ox+2*cellx,oy+celly,tr("Tunnel requests Up")+"\t: " + speedString(info.tr_up_Bps) ) ; oy += celly ;
painter.drawText(ox+2*cellx,oy+celly,tr("Incoming file data")+"\t: " + speedString(info.data_dn_Bps) ) ; oy += celly ;
painter.drawText(ox+2*cellx,oy+celly,tr("Outgoing file data")+"\t: " + speedString(info.data_up_Bps) ) ; oy += celly ;
painter.drawText(ox+2*cellx,oy+celly,tr("Forwarded data ")+"\t: " + speedString(info.unknown_updn_Bps) ) ; oy += celly ;
@ -351,3 +352,17 @@ void TurtleRouterStatisticsWidget::resizeEvent(QResizeEvent *event)
QWidget::resizeEvent(event);
update();
}
void TurtleRouterStatistics::updateTunnelGraph()
{
TurtleTrafficStatisticsInfo info ;
rsTurtle->getTrafficStatistics(info) ;
updateGraph(info.tr_up_Bps,info.tr_dn_Bps,info.data_dn_Bps,info.data_up_Bps,info.unknown_updn_Bps);
}
void TurtleRouterStatistics::updateGraph(qreal bytesTrup, qreal bytesTrdown, qreal bytesDatadown, qreal bytesDataup, qreal bytesunknownupdn)
{
/* Graph only cares about kilobytes */
frmGraph->addPoints(bytesTrup/1024.0, bytesTrdown/1024.0, bytesDatadown/1024.0, bytesDataup/1024.0, bytesunknownupdn/1024.0 );
}

View file

@ -39,6 +39,11 @@ class TurtleRouterStatistics: public RsAutoUpdatePage, public Ui::TurtleRouterSt
// Cache for peer names.
static QString getPeerName(const RsPeerId& peer_id) ;
public slots:
void updateTunnelGraph();
void updateGraph(qreal bytesTrup, qreal bytesTrdown, qreal bytesDatadown, qreal bytesDataup, qreal bytesunknownupdn);
private:

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>611</width>
<height>408</height>
<height>513</height>
</rect>
</property>
<property name="windowTitle">
@ -20,6 +20,9 @@
<enum>Qt::Vertical</enum>
</property>
<widget class="QScrollArea" name="_tunnel_statistics_F">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
@ -35,15 +38,50 @@
<x>0</x>
<y>0</y>
<width>593</width>
<height>390</height>
<height>289</height>
</rect>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
</widget>
</widget>
</widget>
</item>
<item row="1" column="0">
<widget class="GraphFrameTunnel" name="frmGraph">
<property name="minimumSize">
<size>
<width>120</width>
<height>200</height>
</size>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>GraphFrameTunnel</class>
<extends>QFrame</extends>
<header>gui/graphframetunnel.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>