summaryrefslogtreecommitdiffstats
path: root/backend-shared/divesummary.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-01-29 11:26:22 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-01-30 07:45:25 +0200
commit08e39f9d2d293ac22e6174e7b723abb805650552 (patch)
treec669bf41f8e3df46e273367283abe1cf966bbabb /backend-shared/divesummary.h
parenta534f1a25c36e4dbd27cc7d341d0c0d1a92d7cc7 (diff)
downloadsubsurface-08e39f9d2d293ac22e6174e7b723abb805650552.tar.gz
mobile/dive summary: rewrite statistics code
There were quite a few issues with the code - clearly a complete failure of code review. - all values were '??' if a period contained no dives - imperial units were not calculated at all - significant truncation and data loss in the way totals were added as meters and minutes instead of the higher precision data that is available - several issues in striing conversion methodology, e.g. missing zero padding for minutes - missing maxSac - incorrectly calculated avgSac - incorrectly claculated number of EANx dives - hard to read code with most variables named 'temp' Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'backend-shared/divesummary.h')
-rw-r--r--backend-shared/divesummary.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/backend-shared/divesummary.h b/backend-shared/divesummary.h
index 986024b44..a477bb0a3 100644
--- a/backend-shared/divesummary.h
+++ b/backend-shared/divesummary.h
@@ -21,9 +21,9 @@ private:
static timestamp_t firstDive, lastDive;
static int dives[2], divesEAN[2], divesDeep[2], diveplans[2];
- static long divetime[2], depth[2], sac[2];
- static long divetimeMax[2], depthMax[2], sacMin[2];
+ static long divetime[2], depth[2];
+ static long divetimeMax[2], depthMax[2], sacMin[2], sacMax[2];
static long divetimeAvg[2], depthAvg[2], sacAvg[2];
- static int divesSAC[2];
+ static long totalSACTime[2], totalSacVolume[2];
};
#endif // DIVESUMMARY_H