summaryrefslogtreecommitdiffstats
path: root/qt-models/diveplannermodel.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 /qt-models/diveplannermodel.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 'qt-models/diveplannermodel.cpp')
-rw-r--r--qt-models/diveplannermodel.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp
index f290bebfc..65773e13c 100644
--- a/qt-models/diveplannermodel.cpp
+++ b/qt-models/diveplannermodel.cpp
@@ -434,6 +434,10 @@ void DivePlannerPointsModel::emitDataChanged()
void DivePlannerPointsModel::setBottomSac(double sac)
{
+// mobile delivers the same value as desktop when using
+// units:METERS
+// however when using units:CUFT mobile deliver 0-300 which
+// are really 0.00 - 3.00 so start be correcting that
#ifdef SUBSURFACE_MOBILE
if (qPrefUnits::volume() == units::CUFT)
sac /= 100; // cuft without decimals (0 - 300)
@@ -445,6 +449,10 @@ void DivePlannerPointsModel::setBottomSac(double sac)
void DivePlannerPointsModel::setDecoSac(double sac)
{
+// mobile delivers the same value as desktop when using
+// units:METERS
+// however when using units:CUFT mobile deliver 0-300 which
+// are really 0.00 - 3.00 so start be correcting that
#ifdef SUBSURFACE_MOBILE
if (qPrefUnits::volume() == units::CUFT)
sac /= 100; // cuft without decimals (0 - 300)
@@ -456,6 +464,9 @@ void DivePlannerPointsModel::setDecoSac(double sac)
void DivePlannerPointsModel::setSacFactor(double factor)
{
+// sacfactor is normal x.y (one decimal), however mobile
+// delivers 0 - 100 so adjust that to 0.0 - 10.0, to have
+// the same value as desktop
#ifdef SUBSURFACE_MOBILE
factor /= 10.0;
#endif