mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-25 06:40:58 -04:00
added display of the various GxsTrans groups and their respective sizes
This commit is contained in:
parent
7c439983de
commit
4fef4d63bc
3 changed files with 252 additions and 196 deletions
|
@ -45,14 +45,18 @@
|
||||||
#include "gui/common/UIStateHelper.h"
|
#include "gui/common/UIStateHelper.h"
|
||||||
#include "util/misc.h"
|
#include "util/misc.h"
|
||||||
|
|
||||||
#define COL_ID 0
|
#define COL_PENDING_ID 0
|
||||||
#define COL_DESTINATION 1
|
#define COL_PENDING_DESTINATION 1
|
||||||
#define COL_NICKNAME 2
|
#define COL_PENDING_NICKNAME 2
|
||||||
#define COL_DATASTATUS 3
|
#define COL_PENDING_DATASTATUS 3
|
||||||
#define COL_DATASIZE 4
|
#define COL_PENDING_DATASIZE 4
|
||||||
#define COL_DATAHASH 5
|
#define COL_PENDING_DATAHASH 5
|
||||||
#define COL_SEND 6
|
#define COL_PENDING_SEND 6
|
||||||
#define COL_GROUP_ID 7
|
#define COL_PENDING_GROUP_ID 7
|
||||||
|
|
||||||
|
#define COL_GROUP_GRP_ID 0
|
||||||
|
#define COL_GROUP_NUM_MSGS 1
|
||||||
|
#define COL_GROUP_SIZE_MSGS 2
|
||||||
|
|
||||||
static const int PARTIAL_VIEW_SIZE = 9 ;
|
static const int PARTIAL_VIEW_SIZE = 9 ;
|
||||||
static const int MAX_TUNNEL_REQUESTS_DISPLAY = 10 ;
|
static const int MAX_TUNNEL_REQUESTS_DISPLAY = 10 ;
|
||||||
|
@ -60,6 +64,7 @@ static const int GXSTRANS_STATISTICS_DELAY_BETWEEN_GROUP_REQ = 30 ; // never req
|
||||||
|
|
||||||
#define GXSTRANS_GROUP_META 0x01
|
#define GXSTRANS_GROUP_META 0x01
|
||||||
#define GXSTRANS_GROUP_DATA 0x02
|
#define GXSTRANS_GROUP_DATA 0x02
|
||||||
|
#define GXSTRANS_GROUP_STAT 0x03
|
||||||
|
|
||||||
// static QColor colorScale(float f)
|
// static QColor colorScale(float f)
|
||||||
// {
|
// {
|
||||||
|
@ -201,7 +206,9 @@ void GxsTransportStatistics::updateContent()
|
||||||
treeWidget->clear();
|
treeWidget->clear();
|
||||||
time_t now = time(NULL) ;
|
time_t now = time(NULL) ;
|
||||||
|
|
||||||
groupBox->setTitle(tr("Pending packets")+": " + QString::number(transinfo.outgoing_records.size()) );
|
// 1 - fill the table for pending packets
|
||||||
|
|
||||||
|
groupBox->setTitle(tr("Pending data items")+": " + QString::number(transinfo.outgoing_records.size()) );
|
||||||
|
|
||||||
for(uint32_t i=0;i<transinfo.outgoing_records.size();++i)
|
for(uint32_t i=0;i<transinfo.outgoing_records.size();++i)
|
||||||
{
|
{
|
||||||
|
@ -217,21 +224,37 @@ void GxsTransportStatistics::updateContent()
|
||||||
if(nickname.isEmpty())
|
if(nickname.isEmpty())
|
||||||
nickname = tr("Unknown");
|
nickname = tr("Unknown");
|
||||||
|
|
||||||
item -> setData(COL_ID, Qt::DisplayRole, QString::number(rec.trans_id,16).rightJustified(8,'0'));
|
item -> setData(COL_PENDING_ID, Qt::DisplayRole, QString::number(rec.trans_id,16).rightJustified(8,'0'));
|
||||||
item -> setData(COL_NICKNAME, Qt::DisplayRole, nickname ) ;
|
item -> setData(COL_PENDING_NICKNAME, Qt::DisplayRole, nickname ) ;
|
||||||
item -> setData(COL_DESTINATION, Qt::DisplayRole, QString::fromStdString(rec.recipient.toStdString()));
|
item -> setData(COL_PENDING_DESTINATION, Qt::DisplayRole, QString::fromStdString(rec.recipient.toStdString()));
|
||||||
item -> setData(COL_DATASTATUS, Qt::DisplayRole, getStatusString(rec.status));
|
item -> setData(COL_PENDING_DATASTATUS, Qt::DisplayRole, getStatusString(rec.status));
|
||||||
item -> setData(COL_DATASIZE, Qt::DisplayRole, misc::friendlyUnit(rec.data_size));
|
item -> setData(COL_PENDING_DATASIZE, Qt::DisplayRole, misc::friendlyUnit(rec.data_size));
|
||||||
item -> setData(COL_DATAHASH, Qt::DisplayRole, QString::fromStdString(rec.data_hash.toStdString()));
|
item -> setData(COL_PENDING_DATAHASH, Qt::DisplayRole, QString::fromStdString(rec.data_hash.toStdString()));
|
||||||
item -> setData(COL_SEND, Qt::DisplayRole, QString::number(now - rec.send_TS));
|
item -> setData(COL_PENDING_SEND, Qt::DisplayRole, QString::number(now - rec.send_TS));
|
||||||
item -> setData(COL_GROUP_ID, Qt::DisplayRole, QString::fromStdString(rec.group_id.toStdString()));
|
item -> setData(COL_PENDING_GROUP_ID, Qt::DisplayRole, QString::fromStdString(rec.group_id.toStdString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2 - fill the table for pending group data
|
||||||
|
|
||||||
|
groupTreeWidget->clear();
|
||||||
|
|
||||||
|
for(std::map<RsGxsGroupId,GxsGroupStatistic>::const_iterator it(mGroupStats.begin());it!=mGroupStats.end();++it)
|
||||||
|
{
|
||||||
|
const GxsGroupStatistic& stat(it->second) ;
|
||||||
|
|
||||||
|
QTreeWidgetItem *item = new QTreeWidgetItem();
|
||||||
|
groupTreeWidget->addTopLevelItem(item);
|
||||||
|
|
||||||
|
item->setData(COL_GROUP_GRP_ID, Qt::DisplayRole, QString::fromStdString(stat.mGrpId.toStdString())) ;
|
||||||
|
item->setData(COL_GROUP_NUM_MSGS, Qt::DisplayRole, QString::number(stat.mNumMsgs)) ;
|
||||||
|
item->setData(COL_GROUP_SIZE_MSGS,Qt::DisplayRole, QString::number(stat.mTotalSizeOfMsgs)) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsTransportStatistics::personDetails()
|
void GxsTransportStatistics::personDetails()
|
||||||
{
|
{
|
||||||
QTreeWidgetItem *item = treeWidget->currentItem();
|
QTreeWidgetItem *item = treeWidget->currentItem();
|
||||||
std::string id = item->text(COL_DESTINATION).toStdString();
|
std::string id = item->text(COL_PENDING_DESTINATION).toStdString();
|
||||||
|
|
||||||
if (id.empty()) {
|
if (id.empty()) {
|
||||||
return;
|
return;
|
||||||
|
@ -239,116 +262,118 @@ void GxsTransportStatistics::personDetails()
|
||||||
|
|
||||||
IdDetailsDialog *dialog = new IdDetailsDialog(RsGxsGroupId(id));
|
IdDetailsDialog *dialog = new IdDetailsDialog(RsGxsGroupId(id));
|
||||||
dialog->show();
|
dialog->show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GxsTransportStatisticsWidget::GxsTransportStatisticsWidget(QWidget *parent)
|
// GxsTransportStatisticsWidget::GxsTransportStatisticsWidget(QWidget *parent)
|
||||||
: QWidget(parent)
|
// : QWidget(parent)
|
||||||
{
|
// {
|
||||||
float size = QFontMetricsF(font()).height() ;
|
// float size = QFontMetricsF(font()).height() ;
|
||||||
float fact = size/14.0 ;
|
// float fact = size/14.0 ;
|
||||||
|
|
||||||
maxWidth = 400*fact ;
|
|
||||||
maxHeight = 0 ;
|
|
||||||
mCurrentN = PARTIAL_VIEW_SIZE/2+1 ;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GxsTransportStatisticsWidget::updateContent()
|
|
||||||
{
|
|
||||||
RsGxsTrans::GxsTransStatistics transinfo ;
|
|
||||||
|
|
||||||
rsGxsTrans->getStatistics(transinfo) ;
|
|
||||||
|
|
||||||
float size = QFontMetricsF(font()).height() ;
|
|
||||||
float fact = size/14.0 ;
|
|
||||||
|
|
||||||
// What do we need to draw?
|
|
||||||
//
|
//
|
||||||
// Statistics about GxsTransport
|
// maxWidth = 400*fact ;
|
||||||
// - prefered group ID
|
// maxHeight = 0 ;
|
||||||
|
// mCurrentN = PARTIAL_VIEW_SIZE/2+1 ;
|
||||||
|
// }
|
||||||
//
|
//
|
||||||
// Own key ids
|
// void GxsTransportStatisticsWidget::updateContent()
|
||||||
// key service id description
|
// {
|
||||||
|
// RsGxsTrans::GxsTransStatistics transinfo ;
|
||||||
//
|
//
|
||||||
// Data items
|
// rsGxsTrans->getStatistics(transinfo) ;
|
||||||
// Msg id Local origin Destination Time Status
|
|
||||||
//
|
//
|
||||||
QPixmap tmppixmap(maxWidth, maxHeight);
|
// float size = QFontMetricsF(font()).height() ;
|
||||||
|
// float fact = size/14.0 ;
|
||||||
tmppixmap.fill(Qt::transparent);
|
|
||||||
setFixedHeight(maxHeight);
|
|
||||||
|
|
||||||
QPainter painter(&tmppixmap);
|
|
||||||
painter.initFrom(this);
|
|
||||||
painter.setPen(QColor::fromRgb(0,0,0)) ;
|
|
||||||
|
|
||||||
QFont times_f(font());//"Times") ;
|
|
||||||
QFont monospace_f("Monospace") ;
|
|
||||||
|
|
||||||
monospace_f.setStyleHint(QFont::TypeWriter) ;
|
|
||||||
monospace_f.setPointSize(font().pointSize()) ;
|
|
||||||
|
|
||||||
QFontMetricsF fm_monospace(monospace_f) ;
|
|
||||||
QFontMetricsF fm_times(times_f) ;
|
|
||||||
|
|
||||||
static const int cellx = fm_monospace.width(QString(" ")) ;
|
|
||||||
static const int celly = fm_monospace.height() ;
|
|
||||||
|
|
||||||
maxHeight = 500*fact ;
|
|
||||||
|
|
||||||
// std::cerr << "Drawing into pixmap of size " << maxWidth << "x" << maxHeight << std::endl;
|
|
||||||
// draw...
|
|
||||||
int ox=5*fact,oy=5*fact ;
|
|
||||||
|
|
||||||
painter.setFont(times_f) ;
|
|
||||||
|
|
||||||
painter.drawText(ox,oy+celly,tr("Preferred group Id")+":" + QString::fromStdString(transinfo.prefered_group_id.toStdString())) ; oy += celly*2 ;
|
|
||||||
|
|
||||||
oy += celly ;
|
|
||||||
oy += celly ;
|
|
||||||
|
|
||||||
// update the pixmap
|
|
||||||
//
|
//
|
||||||
pixmap = tmppixmap;
|
// // What do we need to draw?
|
||||||
maxHeight = oy ;
|
// //
|
||||||
}
|
// // Statistics about GxsTransport
|
||||||
|
// // - prefered group ID
|
||||||
void GxsTransportStatisticsWidget::wheelEvent(QWheelEvent *e)
|
// //
|
||||||
{
|
// // Own key ids
|
||||||
}
|
// // key service id description
|
||||||
|
// //
|
||||||
QString GxsTransportStatisticsWidget::speedString(float f)
|
// // Data items
|
||||||
{
|
// // Msg id Local origin Destination Time Status
|
||||||
if(f < 1.0f)
|
// //
|
||||||
return QString("0 B/s") ;
|
// QPixmap tmppixmap(maxWidth, maxHeight);
|
||||||
if(f < 1024.0f)
|
//
|
||||||
return QString::number((int)f)+" B/s" ;
|
// tmppixmap.fill(Qt::transparent);
|
||||||
|
// setFixedHeight(maxHeight);
|
||||||
return QString::number(f/1024.0,'f',2) + " KB/s";
|
//
|
||||||
}
|
// QPainter painter(&tmppixmap);
|
||||||
|
// painter.initFrom(this);
|
||||||
void GxsTransportStatisticsWidget::paintEvent(QPaintEvent */*event*/)
|
// painter.setPen(QColor::fromRgb(0,0,0)) ;
|
||||||
{
|
//
|
||||||
QStylePainter(this).drawPixmap(0, 0, pixmap);
|
// QFont times_f(font());//"Times") ;
|
||||||
}
|
// QFont monospace_f("Monospace") ;
|
||||||
|
//
|
||||||
void GxsTransportStatisticsWidget::resizeEvent(QResizeEvent *event)
|
// monospace_f.setStyleHint(QFont::TypeWriter) ;
|
||||||
{
|
// monospace_f.setPointSize(font().pointSize()) ;
|
||||||
QRect TaskGraphRect = geometry();
|
//
|
||||||
maxWidth = TaskGraphRect.width();
|
// QFontMetricsF fm_monospace(monospace_f) ;
|
||||||
maxHeight = TaskGraphRect.height() ;
|
// QFontMetricsF fm_times(times_f) ;
|
||||||
|
//
|
||||||
QWidget::resizeEvent(event);
|
// static const int cellx = fm_monospace.width(QString(" ")) ;
|
||||||
updateContent();
|
// static const int celly = fm_monospace.height() ;
|
||||||
}
|
//
|
||||||
|
// maxHeight = 500*fact ;
|
||||||
|
//
|
||||||
|
// // std::cerr << "Drawing into pixmap of size " << maxWidth << "x" << maxHeight << std::endl;
|
||||||
|
// // draw...
|
||||||
|
// int ox=5*fact,oy=5*fact ;
|
||||||
|
//
|
||||||
|
// painter.setFont(times_f) ;
|
||||||
|
//
|
||||||
|
// painter.drawText(ox,oy+celly,tr("Preferred group Id")+":" + QString::fromStdString(transinfo.prefered_group_id.toStdString())) ; oy += celly*2 ;
|
||||||
|
//
|
||||||
|
// oy += celly ;
|
||||||
|
// oy += celly ;
|
||||||
|
//
|
||||||
|
// // update the pixmap
|
||||||
|
// //
|
||||||
|
// pixmap = tmppixmap;
|
||||||
|
// maxHeight = oy ;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// void GxsTransportStatisticsWidget::wheelEvent(QWheelEvent *e)
|
||||||
|
// {
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// QString GxsTransportStatisticsWidget::speedString(float f)
|
||||||
|
// {
|
||||||
|
// if(f < 1.0f)
|
||||||
|
// return QString("0 B/s") ;
|
||||||
|
// if(f < 1024.0f)
|
||||||
|
// return QString::number((int)f)+" B/s" ;
|
||||||
|
//
|
||||||
|
// return QString::number(f/1024.0,'f',2) + " KB/s";
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// void GxsTransportStatisticsWidget::paintEvent(QPaintEvent */*event*/)
|
||||||
|
// {
|
||||||
|
// QStylePainter(this).drawPixmap(0, 0, pixmap);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// void GxsTransportStatisticsWidget::resizeEvent(QResizeEvent *event)
|
||||||
|
// {
|
||||||
|
// QRect TaskGraphRect = geometry();
|
||||||
|
// maxWidth = TaskGraphRect.width();
|
||||||
|
// maxHeight = TaskGraphRect.height() ;
|
||||||
|
//
|
||||||
|
// QWidget::resizeEvent(event);
|
||||||
|
// updateContent();
|
||||||
|
// }
|
||||||
|
|
||||||
void GxsTransportStatistics::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
void GxsTransportStatistics::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||||
{
|
{
|
||||||
std::cerr << "GxsTransportStatistics::loadRequest() UserType: " << req.mUserType;
|
std::cerr << "GxsTransportStatistics::loadRequest() UserType: " << req.mUserType << std::endl;
|
||||||
std::cerr << std::endl;
|
|
||||||
|
|
||||||
if (queue != mTransQueue)
|
if (queue != mTransQueue)
|
||||||
{
|
{
|
||||||
|
std::cerr << "Wrong queue!" << std::endl;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
/* now switch on req */
|
/* now switch on req */
|
||||||
switch(req.mUserType)
|
switch(req.mUserType)
|
||||||
{
|
{
|
||||||
|
@ -358,13 +383,15 @@ void GxsTransportStatistics::loadRequest(const TokenQueue *queue, const TokenReq
|
||||||
case GXSTRANS_GROUP_DATA: loadGroupData(req.mToken);
|
case GXSTRANS_GROUP_DATA: loadGroupData(req.mToken);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GXSTRANS_GROUP_STAT: loadGroupStat(req.mToken);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
std::cerr << "GxsTransportStatistics::loadRequest() ERROR: INVALID TYPE";
|
std::cerr << "GxsTransportStatistics::loadRequest() ERROR: INVALID TYPE";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void GxsTransportStatistics::requestGroupMeta()
|
void GxsTransportStatistics::requestGroupMeta()
|
||||||
{
|
{
|
||||||
|
@ -381,6 +408,23 @@ void GxsTransportStatistics::requestGroupMeta()
|
||||||
uint32_t token;
|
uint32_t token;
|
||||||
mTransQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_SUMMARY, opts, GXSTRANS_GROUP_META);
|
mTransQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_SUMMARY, opts, GXSTRANS_GROUP_META);
|
||||||
}
|
}
|
||||||
|
void GxsTransportStatistics::requestGroupStat(const RsGxsGroupId &groupId)
|
||||||
|
{
|
||||||
|
mTransQueue->cancelActiveRequestTokens(GXSTRANS_GROUP_STAT);
|
||||||
|
uint32_t token;
|
||||||
|
rsGxsTrans->getTokenService()->requestGroupStatistic(token, groupId);
|
||||||
|
mTransQueue->queueRequest(token, 0, RS_TOKREQ_ANSTYPE_ACK, GXSTRANS_GROUP_STAT);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GxsTransportStatistics::loadGroupStat(const uint32_t &token)
|
||||||
|
{
|
||||||
|
std::cerr << "GxsTransportStatistics::loadGroupStat." << std::endl;
|
||||||
|
GxsGroupStatistic stats;
|
||||||
|
rsGxsTrans->getGroupStatistic(token, stats);
|
||||||
|
|
||||||
|
mGroupStats[stats.mGrpId] = stats ;
|
||||||
|
}
|
||||||
|
|
||||||
void GxsTransportStatistics::loadGroupMeta(const uint32_t& token)
|
void GxsTransportStatistics::loadGroupMeta(const uint32_t& token)
|
||||||
{
|
{
|
||||||
mStateHelper->setLoading(GXSTRANS_GROUP_META, false);
|
mStateHelper->setLoading(GXSTRANS_GROUP_META, false);
|
||||||
|
@ -420,28 +464,27 @@ void GxsTransportStatistics::loadGroupMeta(const uint32_t& token)
|
||||||
// externalOtherCirclesItem->setText(0, tr("External Circles (Other)"));
|
// externalOtherCirclesItem->setText(0, tr("External Circles (Other)"));
|
||||||
// ui.treeWidget_membership->addTopLevelItem(externalOtherCirclesItem);
|
// ui.treeWidget_membership->addTopLevelItem(externalOtherCirclesItem);
|
||||||
|
|
||||||
|
std::set<RsGxsGroupId> existing_groups ;
|
||||||
|
|
||||||
for(vit = groupInfo.begin(); vit != groupInfo.end(); ++vit)
|
for(vit = groupInfo.begin(); vit != groupInfo.end(); ++vit)
|
||||||
{
|
{
|
||||||
|
existing_groups.insert(vit->mGroupId) ;
|
||||||
|
|
||||||
/* Add Widget, and request Pages */
|
/* Add Widget, and request Pages */
|
||||||
std::cerr << "GxsTransportStatisticsWidget::loadGroupMeta() GroupId: " << vit->mGroupId << " Group: " << vit->mGroupName << std::endl;
|
std::cerr << "GxsTransportStatisticsWidget::loadGroupMeta() GroupId: " << vit->mGroupId << " Group: " << vit->mGroupName << std::endl;
|
||||||
|
|
||||||
// QTreeWidgetItem *groupItem = new QTreeWidgetItem();
|
requestGroupStat(vit->mGroupId) ;
|
||||||
// groupItem->setText(CIRCLEGROUP_CIRCLE_COL_GROUPNAME, QString::fromUtf8(vit->mGroupName.c_str()));
|
}
|
||||||
// groupItem->setText(CIRCLEGROUP_CIRCLE_COL_GROUPID, QString::fromStdString(vit->mGroupId.toStdString()));
|
|
||||||
|
|
||||||
// if (vit->mCircleType == GXS_CIRCLE_TYPE_LOCAL)
|
// remove group stats for group that do not exist anymore
|
||||||
// personalCirclesItem->addChild(groupItem);
|
|
||||||
// else
|
for(std::map<RsGxsGroupId,GxsGroupStatistic>::iterator it(mGroupStats.begin());it!=mGroupStats.end();)
|
||||||
// {
|
if(existing_groups.find(it->first) == existing_groups.end())
|
||||||
// if (vit->mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN)
|
it = mGroupStats.erase(it);
|
||||||
// externalAdminCirclesItem->addChild(groupItem);
|
else
|
||||||
// else if (vit->mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED)
|
++it;
|
||||||
// externalSubCirclesItem->addChild(groupItem);
|
|
||||||
// else
|
|
||||||
// externalOtherCirclesItem->addChild(groupItem);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsTransportStatistics::loadGroupData(const uint32_t& token)
|
void GxsTransportStatistics::loadGroupData(const uint32_t& token)
|
||||||
{
|
{
|
||||||
std::cerr << __PRETTY_FUNCTION__ << ": not implemented." << std::endl;
|
std::cerr << __PRETTY_FUNCTION__ << ": not implemented." << std::endl;
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
|
||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
#include <retroshare/rsgrouter.h>
|
#include <retroshare/rsgrouter.h>
|
||||||
#include <retroshare/rstypes.h>
|
#include <retroshare/rstypes.h>
|
||||||
|
@ -55,43 +57,49 @@ private slots:
|
||||||
private:
|
private:
|
||||||
void loadGroupData(const uint32_t& token);
|
void loadGroupData(const uint32_t& token);
|
||||||
void loadGroupMeta(const uint32_t& token);
|
void loadGroupMeta(const uint32_t& token);
|
||||||
|
void loadGroupStat(const uint32_t& token);
|
||||||
|
|
||||||
void requestGroupData();
|
void requestGroupData();
|
||||||
void requestGroupMeta();
|
void requestGroupMeta();
|
||||||
|
void requestGroupStat(const RsGxsGroupId &groupId);
|
||||||
|
|
||||||
void processSettings(bool bLoad);
|
void processSettings(bool bLoad);
|
||||||
bool m_bProcessSettings;
|
bool m_bProcessSettings;
|
||||||
|
|
||||||
virtual void updateDisplay() ;
|
virtual void updateDisplay() ;
|
||||||
|
|
||||||
|
|
||||||
GxsTransportStatisticsWidget *_tst_CW ;
|
GxsTransportStatisticsWidget *_tst_CW ;
|
||||||
TokenQueue *mTransQueue ;
|
TokenQueue *mTransQueue ;
|
||||||
UIStateHelper *mStateHelper;
|
UIStateHelper *mStateHelper;
|
||||||
uint32_t mLastGroupReqTS ;
|
uint32_t mLastGroupReqTS ;
|
||||||
|
|
||||||
|
// temporary storage of retrieved data, for display (useful because this is obtained from the async token system)
|
||||||
|
|
||||||
|
std::map<RsGxsGroupId,GxsGroupStatistic> mGroupStats ; // stores the list of active groups and statistics about each of them.
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
class GxsTransportStatisticsWidget: public QWidget
|
// class GxsTransportStatisticsWidget: public QWidget
|
||||||
{
|
// {
|
||||||
Q_OBJECT
|
// Q_OBJECT
|
||||||
|
//
|
||||||
public:
|
// public:
|
||||||
GxsTransportStatisticsWidget(QWidget *parent = NULL) ;
|
// GxsTransportStatisticsWidget(QWidget *parent = NULL) ;
|
||||||
|
//
|
||||||
virtual void paintEvent(QPaintEvent *event) ;
|
// virtual void paintEvent(QPaintEvent *event) ;
|
||||||
virtual void resizeEvent(QResizeEvent *event);
|
// virtual void resizeEvent(QResizeEvent *event);
|
||||||
virtual void wheelEvent(QWheelEvent *event);
|
// virtual void wheelEvent(QWheelEvent *event);
|
||||||
|
//
|
||||||
void updateContent() ;
|
// void updateContent() ;
|
||||||
private:
|
// private:
|
||||||
static QString speedString(float f) ;
|
// static QString speedString(float f) ;
|
||||||
|
//
|
||||||
QPixmap pixmap ;
|
// QPixmap pixmap ;
|
||||||
int maxWidth,maxHeight ;
|
// int maxWidth,maxHeight ;
|
||||||
int mCurrentN ;
|
// int mCurrentN ;
|
||||||
int mNumberOfKnownKeys ;
|
// int mNumberOfKnownKeys ;
|
||||||
int mMinWheelZoneX ;
|
// int mMinWheelZoneX ;
|
||||||
int mMinWheelZoneY ;
|
// int mMinWheelZoneY ;
|
||||||
int mMaxWheelZoneX ;
|
// int mMaxWheelZoneX ;
|
||||||
int mMaxWheelZoneY ;
|
// int mMaxWheelZoneY ;
|
||||||
};
|
// };
|
||||||
|
|
||||||
|
|
|
@ -15,31 +15,36 @@
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
|
<property name="title">
|
||||||
|
<string>Gxs Transport Groups:</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
<widget class="QSplitter" name="splitter">
|
<widget class="QSplitter" name="splitter">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QScrollArea" name="_router_F">
|
<widget class="QTreeWidget" name="groupTreeWidget">
|
||||||
<property name="frameShape">
|
<column>
|
||||||
<enum>QFrame::NoFrame</enum>
|
<property name="text">
|
||||||
|
<string>Group ID</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="horizontalScrollBarPolicy">
|
</column>
|
||||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Number of messages</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="widgetResizable">
|
</column>
|
||||||
<bool>true</bool>
|
<column>
|
||||||
</property>
|
<property name="text">
|
||||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
<string>Total size of messages</string>
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>1432</width>
|
|
||||||
<height>305</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
|
</column>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue