dive planner: correct bottomsac/decosac calc.

Move conversion cuft <-> liter from desktop-widget/diveplanner.cpp
to plannerShared, to facilitate the same results in mobile
diveplanner

Use Backend for bottomsac/decosac and update to check
for switch LITER <-> CUFT

Add bottomsac/decosac to QMLinterface.

Signed-off-by: jan Iversen <jan@casacondor.com>
This commit is contained in:
jan Iversen 2020-01-08 12:06:23 +01:00 committed by Dirk Hohndel
parent 5548376776
commit cd3c2266f9
6 changed files with 49 additions and 18 deletions

View file

@ -145,9 +145,9 @@ void TestPlannerShared::test_gas()
// Remark return will from qPref is in m / 1000.
qPrefDivePlanner::set_bottomsac(2830);
QCOMPARE(plannerShared::bottomsac(), 2.83);
QCOMPARE(int(plannerShared::bottomsac() * 1000), 99);
qPrefDivePlanner::set_bottomsac(16000);
QCOMPARE(plannerShared::bottomsac(), 16);
QCOMPARE(int(plannerShared::bottomsac() * 1000), 565);
plannerShared::set_decosac(0.9);
QCOMPARE(qPrefDivePlanner::decosac(), 25485);
@ -156,9 +156,9 @@ void TestPlannerShared::test_gas()
// Remark return will from qPref is in m / 1000.
qPrefDivePlanner::set_decosac(11500);
QCOMPARE(plannerShared::decosac(), 11.5);
QCOMPARE(int(plannerShared::decosac() * 1000), 406);
qPrefDivePlanner::set_decosac(19800);
QCOMPARE(plannerShared::decosac(), 19.8);
QCOMPARE(int(plannerShared::decosac() * 1000), 699);
// Remark bottompo2 is in BAR, even though unit system is
// Imperial, the desktop version is like that.