Commit graph

15 commits

Author SHA1 Message Date
Berthold Stoeger
d27b6805f3 Cleanup: rename plannerShared to PlannerShared
Usually, we use PascalCase (i.e. camelCase with a capital
letter at the start) for class names. For consistency, let's
do it here as well.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-04 02:17:52 +01:00
Berthold Stoeger
8396b4bf01 Remove plannerShared::instance()
This class contains only static functions (i.e. it does not contain
any state). There does not seem to be a reason to have an instance
of that class. Therefore, remove the instance() function.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-01-31 21:31:26 +01:00
jan Iversen
86fd49f2d7 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 <jan@casacondor.com>
2020-01-25 17:13:20 -08:00
jan Iversen
cd3c2266f9 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>
2020-01-25 17:13:20 -08:00
jan Iversen
e55c740d84 diveplanner: call planner model directly for simple variables.
Variables without conversion, do not need to pass plannerShared
(due to the QML interface).

Simple variables do not pass plannerShared, but diveplanner
in desktop-widgets and qmlinterface in mobile-widgets call the
implementation directly.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25 17:13:20 -08:00
jan Iversen
1f51251f1b backend-shared: remove asc/desc functions
Ascent/Descent rate functions are fully implemented in diveplannermodel,
therefore remove these functions.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20 15:49:02 -08:00
jan Iversen
6e06550631 core/settings:: remove string functions for units
Remove string version of unit_system, duration_units, length, pressure,
temperature, vertical_speed_time, and volume, including tests and make signals
strongly typed in C++

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20 09:55:26 -08:00
jan Iversen
80b55b9e85 tests: correct decosac/bottomsac in imperial.
The getter returns alwayes in m/1000, making the calculations
identical, independent if the system is in Metric or Imperial units.

Correct getter test cases.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-31 04:32:34 +09:00
jan Iversen
2f16f7539e tests: correct bestmixend test cases.
When unit system Imperial is properly activated, these test cases
have wrong values, and thus fail.

Use correct values.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-31 04:32:34 +09:00
jan Iversen
24c42b9b55 tests: reactivate test case in testplannershared
reactivate deco2 test case, after problem is solved in plannerShared.

Also add a commit on bottompo2/decopo2 in imperial mode, that do not
use PSI as expected.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-31 04:32:34 +09:00
jan Iversen
7641a6263f tests: correct testplannershared
PSI is not implemented for diveplanner
Bestmixend in feet is not implemented for diveplanner

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29 12:32:45 -08:00
jan Iversen
9e5564a3de tests: add gas tests for plannerShared
Add cases to test gas options.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-29 01:17:04 +09:00
jan Iversen
9229681b98 tests: add research values for diveplanning.
This commit contains the researched values used for
diveplanning, which form the basis for the test cases.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-29 01:17:04 +09:00
jan Iversen
d7d6f56c6f tests: add test cases plannerShared ratings
Add test cases to test ratings variables

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-27 05:40:26 +09:00
jan Iversen
f92daa16ef tests: add framework for plannerShared test
Add TestPlannerShared test (cpp + h)

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-27 05:40:26 +09:00