summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Mathieson <martin.r.mathieson@googlemail.com>2015-10-15 05:19:33 -0700
committerMartin Mathieson <martin.r.mathieson@googlemail.com>2015-10-16 08:31:00 +0000
commitb92caedf91f7711ad6e7add42957435ddd482eba (patch)
tree572e256d3abadb19bc8f47cd41482385f4e298bb
parent12fa38774ae6ee3acfe894c3f5057e72c4fbb096 (diff)
downloadwireshark-b92caedf91f7711ad6e7add42957435ddd482eba.tar.gz
RLC statistics window can now launch UL or DL graphs
Change-Id: I9eb1ceacaee6aab510c5a005d40334867cafc8a4 Reviewed-on: https://code.wireshark.org/review/11059 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
-rw-r--r--ui/qt/conversation_dialog.cpp2
-rw-r--r--ui/qt/lte_mac_statistics_dialog.h5
-rw-r--r--ui/qt/lte_rlc_graph_dialog.cpp40
-rw-r--r--ui/qt/lte_rlc_graph_dialog.h7
-rw-r--r--ui/qt/lte_rlc_statistics_dialog.cpp91
-rw-r--r--ui/qt/lte_rlc_statistics_dialog.h13
-rw-r--r--ui/qt/main_window_slots.cpp2
7 files changed, 139 insertions, 21 deletions
diff --git a/ui/qt/conversation_dialog.cpp b/ui/qt/conversation_dialog.cpp
index 8f034e641a..efbc383e7a 100644
--- a/ui/qt/conversation_dialog.cpp
+++ b/ui/qt/conversation_dialog.cpp
@@ -244,7 +244,9 @@ void ConversationDialog::graphTcp()
return;
}
+ // Apply the filter for this conversation.
emit filterAction(filter, FilterAction::ActionApply, FilterAction::ActionTypePlain);
+ // This action will now find a packet from the intended conversation/stream.
openTcpStreamGraph(GRAPH_TSEQ_TCPTRACE);
}
diff --git a/ui/qt/lte_mac_statistics_dialog.h b/ui/qt/lte_mac_statistics_dialog.h
index d6fd762b42..6c371e1a51 100644
--- a/ui/qt/lte_mac_statistics_dialog.h
+++ b/ui/qt/lte_mac_statistics_dialog.h
@@ -53,13 +53,14 @@ public:
LteMacStatisticsDialog(QWidget &parent, CaptureFile &cf, const char *filter);
~LteMacStatisticsDialog();
+protected:
+
+private:
// Extra controls needed for this dialog.
QLabel *commonStatsLabel_;
QCheckBox *showSRFilterCheckBox_;
QCheckBox *showRACHFilterCheckBox_;
-protected:
-private:
mac_lte_common_stats commonStats_;
bool commonStatsCurrent_;
diff --git a/ui/qt/lte_rlc_graph_dialog.cpp b/ui/qt/lte_rlc_graph_dialog.cpp
index c419985039..a60a506017 100644
--- a/ui/qt/lte_rlc_graph_dialog.cpp
+++ b/ui/qt/lte_rlc_graph_dialog.cpp
@@ -60,7 +60,7 @@ const double pkt_point_size_ = 3.0;
// Constructor.
-LteRlcGraphDialog::LteRlcGraphDialog(QWidget &parent, CaptureFile &cf) :
+LteRlcGraphDialog::LteRlcGraphDialog(QWidget &parent, CaptureFile &cf, bool channelKnown) :
WiresharkDialog(parent, cf),
ui(new Ui::LteRlcGraphDialog),
mouse_drags_(true),
@@ -101,6 +101,38 @@ LteRlcGraphDialog::LteRlcGraphDialog(QWidget &parent, CaptureFile &cf) :
// Zero out this struct.
memset(&graph_, 0, sizeof(graph_));
+ // If channel is known, details will be supplied by setChannelInfo().
+ if (!channelKnown) {
+ completeGraph();
+ }
+
+}
+
+// Destructor
+LteRlcGraphDialog::~LteRlcGraphDialog()
+{
+ delete ui;
+}
+
+// Set the channel information that this graph should show.
+void LteRlcGraphDialog::setChannelInfo(guint16 ueid, guint8 rlcMode,
+ guint16 channelType, guint16 channelId, guint8 direction)
+{
+ graph_.ueid = ueid;
+ graph_.rlcMode = rlcMode;
+ graph_.channelType = channelType;
+ graph_.channelId = channelId;
+ graph_.channelSet = TRUE;
+ graph_.direction = direction;
+
+ completeGraph();
+}
+
+// Once channel details are known, complete the graph with details that depend upon the channel.
+void LteRlcGraphDialog::completeGraph()
+{
+ QCustomPlot *rp = ui->rlcPlot;
+
// If no channel chosen already, try to use currently selected frame.
findChannel();
@@ -140,12 +172,6 @@ LteRlcGraphDialog::LteRlcGraphDialog(QWidget &parent, CaptureFile &cf) :
fillGraph();
}
-// Destructor
-LteRlcGraphDialog::~LteRlcGraphDialog()
-{
- delete ui;
-}
-
// See if the given segment matches the channel this graph is plotting.
bool LteRlcGraphDialog::compareHeaders(rlc_segment *seg)
{
diff --git a/ui/qt/lte_rlc_graph_dialog.h b/ui/qt/lte_rlc_graph_dialog.h
index 28755f873c..ba602f2c4e 100644
--- a/ui/qt/lte_rlc_graph_dialog.h
+++ b/ui/qt/lte_rlc_graph_dialog.h
@@ -42,9 +42,12 @@ public:
// TODO: will need to add another constructor option to give channel explicitly,
// rather than find in currently selected packet, for when launch graph from
// RLC statistics dialog.
- explicit LteRlcGraphDialog(QWidget &parent, CaptureFile &cf);
+ explicit LteRlcGraphDialog(QWidget &parent, CaptureFile &cf, bool channelKnown);
~LteRlcGraphDialog();
+ void setChannelInfo(guint16 ueid, guint8 rlcMode,
+ guint16 channelType, guint16 channelId, guint8 direction);
+
protected:
void showEvent(QShowEvent *event);
void keyPressEvent(QKeyEvent *event);
@@ -68,6 +71,8 @@ private:
QCPGraph *acks_graph_;
QCPGraph *nacks_graph_;
+ void completeGraph();
+
bool compareHeaders(rlc_segment *seg);
void findChannel();
diff --git a/ui/qt/lte_rlc_statistics_dialog.cpp b/ui/qt/lte_rlc_statistics_dialog.cpp
index 4761cee33c..92f21e4505 100644
--- a/ui/qt/lte_rlc_statistics_dialog.cpp
+++ b/ui/qt/lte_rlc_statistics_dialog.cpp
@@ -27,9 +27,12 @@
#include <epan/dissectors/packet-rlc-lte.h>
+#include <QFormLayout>
#include <QTreeWidget>
#include <QTreeWidgetItem>
+#include <QPushButton>
+#include "lte_rlc_graph_dialog.h"
#include "qt_ui_utils.h"
#include "wireshark_application.h"
@@ -123,10 +126,12 @@ typedef struct rlc_channel_stats {
class RlcChannelTreeWidgetItem : public QTreeWidgetItem
{
public:
- RlcChannelTreeWidgetItem(QTreeWidgetItem *parent, unsigned ueid,
+ RlcChannelTreeWidgetItem(QTreeWidgetItem *parent, QWidget &dialog,
+ unsigned ueid,
unsigned mode,
unsigned channelType, unsigned channelId) :
- QTreeWidgetItem (parent, rlc_channel_row_type_),
+ QTreeWidgetItem(parent, rlc_channel_row_type_),
+ dialog_(dialog),
ueid_(ueid),
channelType_(channelType),
channelId_(channelId),
@@ -280,7 +285,17 @@ public:
return filter_expr;
}
+ // Create an RLC Graph and populate it with this channel's details.
+ void launchGraph(guint8 direction, CaptureFile &cf)
+ {
+ LteRlcGraphDialog *graph_dialog = new LteRlcGraphDialog(dialog_, cf, true);
+ graph_dialog->setChannelInfo(ueid_, mode_, channelType_, channelId_, direction);
+ graph_dialog->show();
+ }
+
private:
+ QWidget &dialog_;
+
unsigned ueid_;
unsigned channelType_;
unsigned channelId_;
@@ -333,8 +348,9 @@ typedef struct rlc_ue_stats {
class RlcUeTreeWidgetItem : public QTreeWidgetItem
{
public:
- RlcUeTreeWidgetItem(QTreeWidget *parent, const rlc_lte_tap_info *rlt_info) :
+ RlcUeTreeWidgetItem(QTreeWidget *parent, QWidget *dialog, const rlc_lte_tap_info *rlt_info) :
QTreeWidgetItem (parent, rlc_ue_row_type_),
+ dialog_(dialog),
ueid_(0)
{
ueid_ = rlt_info->ueid;
@@ -423,7 +439,7 @@ public:
channel_item = CCCH_stats_;
if (channel_item == NULL) {
channel_item = CCCH_stats_ =
- new RlcChannelTreeWidgetItem(this, tap_info->ueid, RLC_TM_MODE,
+ new RlcChannelTreeWidgetItem(this, *dialog_, tap_info->ueid, RLC_TM_MODE,
tap_info->channelType, tap_info->channelId);
}
break;
@@ -432,7 +448,7 @@ public:
channel_item = srb_stats_[tap_info->channelId-1];
if (channel_item == NULL) {
channel_item = srb_stats_[tap_info->channelId-1] =
- new RlcChannelTreeWidgetItem(this, tap_info->ueid, RLC_AM_MODE,
+ new RlcChannelTreeWidgetItem(this, *dialog_, tap_info->ueid, RLC_AM_MODE,
tap_info->channelType, tap_info->channelId);
}
break;
@@ -441,7 +457,7 @@ public:
channel_item = drb_stats_[tap_info->channelId-1];
if (channel_item == NULL) {
channel_item = drb_stats_[tap_info->channelId-1] =
- new RlcChannelTreeWidgetItem(this, tap_info->ueid, tap_info->rlcMode,
+ new RlcChannelTreeWidgetItem(this, *dialog_, tap_info->ueid, tap_info->rlcMode,
tap_info->channelType, tap_info->channelId);
}
break;
@@ -522,6 +538,8 @@ public:
}
private:
+ QWidget *dialog_;
+
unsigned ueid_;
rlc_ue_stats stats_;
@@ -545,6 +563,7 @@ static const QString channel_col_2_title_ = QObject::tr("Priority");
// Constructor.
LteRlcStatisticsDialog::LteRlcStatisticsDialog(QWidget &parent, CaptureFile &cf, const char *filter) :
TapParameterDialog(parent, cf, HELP_STATS_LTE_MAC_TRAFFIC_DIALOG),
+ cf_(cf),
packet_count_(0)
{
setWindowSubtitle(tr("LTE RLC Statistics"));
@@ -552,6 +571,27 @@ LteRlcStatisticsDialog::LteRlcStatisticsDialog(QWidget &parent, CaptureFile &cf,
// XXX Use recent settings instead
resize((parent.width() * 5) / 5, (parent.height() * 3) / 4);
+ // Create a grid for filtering-related widgetsto also appear in layout.
+ int filter_controls_layout_idx = verticalLayout()->indexOf(filterLayout()->widget());
+ QGridLayout *filter_controls_grid = new QGridLayout();
+ // Insert into the vertical layout
+ verticalLayout()->insertLayout(filter_controls_layout_idx, filter_controls_grid);
+ int one_em = fontMetrics().height();
+ filter_controls_grid->setColumnMinimumWidth(2, one_em * 2);
+ filter_controls_grid->setColumnStretch(2, 1);
+ filter_controls_grid->setColumnMinimumWidth(5, one_em * 2);
+ filter_controls_grid->setColumnStretch(5, 1);
+
+ // Add individual controls into the grid
+ launchULGraph_ = new QPushButton(QString("Launch UL Graph"));
+ launchULGraph_->setEnabled(false);
+ filter_controls_grid->addWidget(launchULGraph_);
+ connect(launchULGraph_, SIGNAL(pressed()), this, SLOT(launchULGraphButtonClicked()));
+ launchDLGraph_ = new QPushButton(QString("Launch DL Graph"));
+ launchDLGraph_->setEnabled(false);
+ filter_controls_grid->addWidget(launchDLGraph_);
+ connect(launchDLGraph_, SIGNAL(pressed()), this, SLOT(launchDLGraphButtonClicked()));
+
QStringList header_labels = QStringList()
<< "" << "" << ""
<< tr("UL Frames") << tr("UL Bytes") << tr("UL MB/s")
@@ -564,7 +604,6 @@ LteRlcStatisticsDialog::LteRlcStatisticsDialog(QWidget &parent, CaptureFile &cf,
statsTreeWidget()->sortByColumn(col_ueid_, Qt::AscendingOrder);
// resizeColumnToContents doesn't work well here, so set sizes manually.
- int one_em = fontMetrics().height();
for (int col = 0; col < statsTreeWidget()->columnCount() - 1; col++) {
switch (col) {
case col_ueid_:
@@ -606,7 +645,7 @@ LteRlcStatisticsDialog::LteRlcStatisticsDialog(QWidget &parent, CaptureFile &cf,
// Set handler for when the tree item changes to set the appropriate labels.
connect(statsTreeWidget(), SIGNAL(itemSelectionChanged()),
- this, SLOT(updateHeaderLabels()));
+ this, SLOT(updateItemSelectionChanged()));
}
// Destructor.
@@ -650,7 +689,7 @@ gboolean LteRlcStatisticsDialog::tapPacket(void *ws_dlg_ptr, struct _packet_info
if (!ue_ti) {
// Existing UE wasn't found so create a new one.
- ue_ti = new RlcUeTreeWidgetItem(ws_dlg->statsTreeWidget(), rlt_info);
+ ue_ti = new RlcUeTreeWidgetItem(ws_dlg->statsTreeWidget(), ws_dlg, rlt_info);
for (int col = 0; col < ws_dlg->statsTreeWidget()->columnCount(); col++) {
ue_ti->setTextAlignment(col, ws_dlg->statsTreeWidget()->headerItem()->textAlignment(col));
}
@@ -719,6 +758,20 @@ void LteRlcStatisticsDialog::fillTree()
}
+void LteRlcStatisticsDialog::updateItemSelectionChanged()
+{
+ updateHeaderLabels();
+
+ bool enableGraphButtons = false;
+ if (statsTreeWidget()->selectedItems().count() > 0 && statsTreeWidget()->selectedItems()[0]->type() == rlc_channel_row_type_) {
+ enableGraphButtons = true;
+ }
+
+ // Only enable graph buttons for channel entries.
+ launchULGraph_->setEnabled(enableGraphButtons);
+ launchDLGraph_->setEnabled(enableGraphButtons);
+}
+
void LteRlcStatisticsDialog::updateHeaderLabels()
{
if (statsTreeWidget()->selectedItems().count() > 0 && statsTreeWidget()->selectedItems()[0]->type() == rlc_channel_row_type_) {
@@ -738,6 +791,26 @@ void LteRlcStatisticsDialog::captureFileClosing()
updateWidgets();
}
+// Launch a UL graph for the currently-selected channel.
+void LteRlcStatisticsDialog::launchULGraphButtonClicked()
+{
+ if (statsTreeWidget()->selectedItems().count() > 0 && statsTreeWidget()->selectedItems()[0]->type() == rlc_channel_row_type_) {
+ QTreeWidgetItem *ti = statsTreeWidget()->selectedItems()[0];
+ RlcChannelTreeWidgetItem *rc_ti = static_cast<RlcChannelTreeWidgetItem*>(ti);
+ rc_ti->launchGraph(DIRECTION_UPLINK, cf_);
+ }
+}
+
+// Launch a DL graph for the currently-selected channel.
+void LteRlcStatisticsDialog::launchDLGraphButtonClicked()
+{
+ if (statsTreeWidget()->selectedItems().count() > 0 && statsTreeWidget()->selectedItems()[0]->type() == rlc_channel_row_type_) {
+ QTreeWidgetItem *ti = statsTreeWidget()->selectedItems()[0];
+ RlcChannelTreeWidgetItem *rc_ti = static_cast<RlcChannelTreeWidgetItem*>(ti);
+ rc_ti->launchGraph(DIRECTION_DOWNLINK, cf_);
+ }
+}
+
// Stat command + args
static void
diff --git a/ui/qt/lte_rlc_statistics_dialog.h b/ui/qt/lte_rlc_statistics_dialog.h
index 1bcd813ca0..7739e6a95d 100644
--- a/ui/qt/lte_rlc_statistics_dialog.h
+++ b/ui/qt/lte_rlc_statistics_dialog.h
@@ -35,9 +35,14 @@ public:
unsigned getFrameCount() { return packet_count_; }
void incFrameCount() { ++packet_count_; }
+ // Extra controls needed for this dialog.
+ QPushButton *launchULGraph_;
+ QPushButton *launchDLGraph_;
+
protected:
private:
+ CaptureFile &cf_;
int packet_count_;
// Callbacks for register_tap_listener
@@ -45,12 +50,18 @@ private:
static gboolean tapPacket(void *ws_dlg_ptr, struct _packet_info *, struct epan_dissect *, const void *rlc_lte_tap_info_ptr);
static void tapDraw(void *ws_dlg_ptr);
+ void updateHeaderLabels();
+
virtual const QString filterExpression();
private slots:
virtual void fillTree();
- void updateHeaderLabels();
+ void updateItemSelectionChanged();
+
void captureFileClosing();
+
+ void launchULGraphButtonClicked();
+ void launchDLGraphButtonClicked();
};
#endif // __LTE_RLC_STATISTICS_DIALOG_H__
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp
index f0b3cf0a25..c3d5165789 100644
--- a/ui/qt/main_window_slots.cpp
+++ b/ui/qt/main_window_slots.cpp
@@ -3034,7 +3034,7 @@ void MainWindow::on_actionTelephonyLteRlcStatistics_triggered()
void MainWindow::on_actionTelephonyLteRlcGraph_triggered()
{
- LteRlcGraphDialog *lrg_dialog = new LteRlcGraphDialog(*this, capture_file_);
+ LteRlcGraphDialog *lrg_dialog = new LteRlcGraphDialog(*this, capture_file_, false);
lrg_dialog->show();
}