aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Mathieson <martin.r.mathieson@googlemail.com>2015-09-29 09:54:48 -0700
committerMartin Mathieson <martin.r.mathieson@googlemail.com>2015-09-29 18:25:31 +0000
commit8426b4b26bd2b9c1ba5c4bd418bb484dea9528cd (patch)
tree83958282dc05027557a8cc529636f6d8b1c03334
parenta225908574adb2e92d95e979ba38a387bcd0054d (diff)
lte_rlc_statistics: fix cosmetic issues with data in columns
Change-Id: I2bec8de3d5fe84f0a2287c750c9c9151906fe71e Reviewed-on: https://code.wireshark.org/review/10688 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/lte_rlc_statistics_dialog.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/ui/qt/lte_rlc_statistics_dialog.cpp b/ui/qt/lte_rlc_statistics_dialog.cpp
index 362d4da634..4761cee33c 100644
--- a/ui/qt/lte_rlc_statistics_dialog.cpp
+++ b/ui/qt/lte_rlc_statistics_dialog.cpp
@@ -73,7 +73,15 @@ static float calculate_bw(nstime_t *start_time, nstime_t *stop_time, guint32 byt
if (elapsed_ms < 2.0) {
return 0.0f;
}
- return ((bytes * 8) / elapsed_ms) / 1000;
+ float bw = ((bytes * 8) / elapsed_ms) / 1000;
+ if (bw < 0.0001) {
+ // Very small values aren't interesting/useful, and would rather see 0 than scientific notation.
+ return 0.0f;
+ }
+ else
+ {
+ return bw;
+ }
}
else {
return 0.0f;
@@ -226,7 +234,7 @@ public:
// Uplink.
setText(col_ul_frames_, QString::number(stats_.UL_frames));
setText(col_ul_bytes_, QString::number(stats_.UL_bytes));
- setText(col_ul_mb_s_, QString::number(UL_bw, 'g', 5));
+ setText(col_ul_mb_s_, bits_s_to_qstring(UL_bw));
setText(col_ul_acks_, QString::number(stats_.UL_acks));
setText(col_ul_nacks_, QString::number(stats_.UL_nacks));
setText(col_ul_missing_, QString::number(stats_.UL_missing));
@@ -234,7 +242,7 @@ public:
// Downlink.
setText(col_dl_frames_, QString::number(stats_.DL_frames));
setText(col_dl_bytes_, QString::number(stats_.DL_bytes));
- setText(col_ul_mb_s_, QString::number(DL_bw, 'g', 5));
+ setText(col_ul_mb_s_, bits_s_to_qstring(DL_bw));
setText(col_dl_acks_, QString::number(stats_.DL_acks));
setText(col_dl_nacks_, QString::number(stats_.DL_nacks));
setText(col_dl_missing_, QString::number(stats_.DL_missing));
@@ -464,7 +472,7 @@ public:
// Uplink.
setText(col_ul_frames_, QString::number(stats_.UL_frames));
setText(col_ul_bytes_, QString::number(stats_.UL_total_bytes));
- setText(col_ul_mb_s_, QString::number(UL_bw, 'g', 5));
+ setText(col_ul_mb_s_, bits_s_to_qstring(UL_bw));
setText(col_ul_acks_, QString::number(stats_.UL_total_acks));
setText(col_ul_nacks_, QString::number(stats_.UL_total_nacks));
setText(col_ul_missing_, QString::number(stats_.UL_total_missing));
@@ -472,7 +480,7 @@ public:
// Downlink.
setText(col_dl_frames_, QString::number(stats_.DL_frames));
setText(col_dl_bytes_, QString::number(stats_.DL_total_bytes));
- setText(col_dl_mb_s_, QString::number(DL_bw, 'g', 5));
+ setText(col_dl_mb_s_, bits_s_to_qstring(DL_bw));
setText(col_dl_acks_, QString::number(stats_.DL_total_acks));
setText(col_dl_nacks_, QString::number(stats_.DL_total_nacks));
setText(col_dl_missing_, QString::number(stats_.DL_total_missing));
@@ -584,9 +592,8 @@ LteRlcStatisticsDialog::LteRlcStatisticsDialog(QWidget &parent, CaptureFile &cf,
break;
default:
- // The rest are numeric
+ // The rest are numeric.
statsTreeWidget()->setColumnWidth(col, one_em * 4);
- statsTreeWidget()->headerItem()->setTextAlignment(col, Qt::AlignRight);
break;
}
}