summaryrefslogtreecommitdiffstats
path: root/backend-shared/plannershared.cpp
diff options
context:
space:
mode:
authorGravatar jan Iversen <jan@casacondor.com>2020-01-25 13:02:59 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-01-25 17:27:25 -0800
commitd8b035ffe79de859da1179ab9d7948b23acaa71b (patch)
treece278a711ba6539be9e1ddff99822122752af891 /backend-shared/plannershared.cpp
parent4066a655929d6818ebfbadef1a10492d9f03c576 (diff)
downloadsubsurface-d8b035ffe79de859da1179ab9d7948b23acaa71b.tar.gz
diveplanner: add comments explaining different scaling
In some case the scaling (real value <-> UI value) is different for mobile and desktop. In order to make the difference understandable comments are added to each function. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'backend-shared/plannershared.cpp')
-rw-r--r--backend-shared/plannershared.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/backend-shared/plannershared.cpp b/backend-shared/plannershared.cpp
index 34fc61016..d35c1e676 100644
--- a/backend-shared/plannershared.cpp
+++ b/backend-shared/plannershared.cpp
@@ -89,6 +89,9 @@ void plannerShared::set_bottomsac(double value)
double plannerShared::decosac()
{
+// Mobile and desktop use the same values when using units::LITER,
+// however when using units::CUFT desktop want 0.00 - 3.00 while
+// mobile wants 0 - 300, therefore multiply by 100 for mobile
return (qPrefUnits::volume() == units::LITER) ?
qPrefDivePlanner::decosac() / 1000.0 :
ml_to_cuft(qPrefDivePlanner::decosac()
@@ -105,6 +108,9 @@ void plannerShared::set_decosac(double value)
double plannerShared::sacfactor()
{
+// mobile want 0 - 100 which are shown with 1 decimal as 0.0 - 10.0
+// whereas desktop wants 0.0 - 10.0
+// as a consequence divide by 10 or 100
return qPrefDivePlanner::sacfactor() /
#ifdef SUBSURFACE_MOBILE
10.0;