diff options
author | Robert C. Helling <helling@atdotde.de> | 2018-12-16 20:52:34 +0100 |
---|---|---|
committer | bstoeger <32835590+bstoeger@users.noreply.github.com> | 2018-12-17 12:18:26 +0100 |
commit | ac8db01873c7caa2ac475d987269ee26c6daa46a (patch) | |
tree | 5aeec47ed5e02750b8a428076a8476519d22b498 /qt-models | |
parent | 99561484adfca7a00187127dc05cafdd46737cc2 (diff) | |
download | subsurface-ac8db01873c7caa2ac475d987269ee26c6daa46a.tar.gz |
Show average max depth in yearly statistics
this was requested in #1854 and I think this suggestion makes sense
Fixes #1854
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'qt-models')
-rw-r--r-- | qt-models/yearlystatisticsmodel.cpp | 8 | ||||
-rw-r--r-- | qt-models/yearlystatisticsmodel.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/qt-models/yearlystatisticsmodel.cpp b/qt-models/yearlystatisticsmodel.cpp index c8aa2639b..fa86cffbe 100644 --- a/qt-models/yearlystatisticsmodel.cpp +++ b/qt-models/yearlystatisticsmodel.cpp @@ -15,6 +15,7 @@ public: SHORTEST_TIME, LONGEST_TIME, AVG_DEPTH, + AVG_MAX_DEPTH, MIN_DEPTH, MAX_DEPTH, AVG_SAC, @@ -74,6 +75,10 @@ QVariant YearStatisticsItem::data(int column, int role) const case AVG_DEPTH: ret = get_depth_string(stats_interval.avg_depth); break; + case AVG_MAX_DEPTH: + if (stats_interval.selection_size) + ret = get_depth_string(stats_interval.combined_max_depth.mm / stats_interval.selection_size); + break; case MIN_DEPTH: ret = get_depth_string(stats_interval.min_depth); break; @@ -143,6 +148,9 @@ QVariant YearlyStatisticsModel::headerData(int section, Qt::Orientation orientat case AVG_DEPTH: val = QString(tr("Depth (%1)\n Average")).arg(get_depth_unit()); break; + case AVG_MAX_DEPTH: + val = tr("\nAverage maximum"); + break; case MIN_DEPTH: val = tr("\nMinimum"); break; diff --git a/qt-models/yearlystatisticsmodel.h b/qt-models/yearlystatisticsmodel.h index 77a5ae074..99e646388 100644 --- a/qt-models/yearlystatisticsmodel.h +++ b/qt-models/yearlystatisticsmodel.h @@ -15,6 +15,7 @@ public: SHORTEST_TIME, LONGEST_TIME, AVG_DEPTH, + AVG_MAX_DEPTH, MIN_DEPTH, MAX_DEPTH, AVG_SAC, |