From 86fd49f2d79f3e199de5261a80e01b34541b96f6 Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Tue, 21 Jan 2020 16:16:10 +0100 Subject: diveplanner: adjust sac-factor calculation. The real values are 1.0 to 10.0, but QML needs int so mobile gets values 10.0 to 100.0 add sacfactor() to QMLInterface and update QML. Signed-off-by: jan Iversen --- backend-shared/plannershared.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'backend-shared/plannershared.cpp') diff --git a/backend-shared/plannershared.cpp b/backend-shared/plannershared.cpp index 542f1aae1..b39aa556c 100644 --- a/backend-shared/plannershared.cpp +++ b/backend-shared/plannershared.cpp @@ -105,10 +105,18 @@ void plannerShared::set_decosac(double value) double plannerShared::sacfactor() { - return qPrefDivePlanner::sacfactor() / 100.0; + return qPrefDivePlanner::sacfactor() / +#ifdef SUBSURFACE_MOBILE + 10.0; +#else + 100.0; +#endif } void plannerShared::set_sacfactor(double value) { +#ifdef SUBSURFACE_MOBILE + value /= 10.0; +#endif // NO conversion, this is done in the planner model. DivePlannerPointsModel::instance()->setSacFactor(value); } -- cgit v1.2.3-70-g09d2