aboutsummaryrefslogtreecommitdiffstats
path: root/stats/statstranslations.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-01-01 01:37:56 +0100
committerGravatar bstoeger <32835590+bstoeger@users.noreply.github.com>2021-01-01 21:10:10 +0100
commit93ba2219ee06abe27573deeb4cfdf39f60d41087 (patch)
treee0d0a99ece03902fd49ae84c2c015e3312d4027e /stats/statstranslations.h
parentb02847de53439820b8ac62f24c4b7457e284d8c4 (diff)
downloadsubsurface-93ba2219ee06abe27573deeb4cfdf39f60d41087.tar.gz
statistics: add statistic variables
The StatisticVariable class hierarchy encapsulates the concept of a dive-variable, which can be plotted in charts either as dependend or independend variable. There are three types of these variables: 1) discrete: For example dive buddies or suit type. 2) continuous: Has a notion of linear metric - can be used as histogram or scatter plot axis. 3) numeric: Like continuous, but allows for operations such as calculating the mean or the sum over numerous dives. All variables support binning. The bins are defined per variable. Continuous variables can be converted into an arbitrary double value, which is used to be plotted on a continuous axis. Moreover, numeric variables support a number of operations, which depend on the variable. Since binning is based on different types, the code is rather template-heavy. Of course, this could be solved with unions/variants and runtime-polymorphism, but using templates was just much quicker. Notably, this uses the CRTP (curiously recurring template pattern) where a subclass passes itself as argument to the baseclass. This is a weird kind of "reverse inheritance". The StatsTranslations class is a dummy class which will be used to collect all translations of the statistics module. This includes changes by Dirk to fix compilation of the downloader. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'stats/statstranslations.h')
-rw-r--r--stats/statstranslations.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/stats/statstranslations.h b/stats/statstranslations.h
new file mode 100644
index 000000000..dadfc83af
--- /dev/null
+++ b/stats/statstranslations.h
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0
+// Dummy object for stats-module related translations
+
+#ifndef STATS_TRANSLATIONS_H
+#define STATS_TRANSLATIONS_H
+
+#include <QObject>
+
+class StatsTranslations : public QObject
+{
+ Q_OBJECT
+};
+
+#endif