diff options
author | jan Iversen <jan@casacondor.com> | 2019-12-14 20:29:16 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-12-26 08:38:27 -0800 |
commit | b877dd973cd787464875f0329c6472bf7f508e01 (patch) | |
tree | e4bb753e19f02330c5e253e2864f9e7f1a35a44f /backend-shared/plannershared.cpp | |
parent | d90a2ca0089e782372085a870135340948f08899 (diff) | |
download | subsurface-b877dd973cd787464875f0329c6472bf7f508e01.tar.gz |
plannerShared: add variables from plannerModel
the variables are set through set functions in DivePlannerPointsModel,
but read via getters from qPrefDivePlanner.
Variables:
planner_deco_mode
reserveGas
safetyStop
gflow
gfhigh
vpmb_conservatism
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.cpp | 58 |
1 files changed, 56 insertions, 2 deletions
diff --git a/backend-shared/plannershared.cpp b/backend-shared/plannershared.cpp index ff95b9e0e..2420fdedc 100644 --- a/backend-shared/plannershared.cpp +++ b/backend-shared/plannershared.cpp @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-2.0 #include "plannershared.h" -#include "core/pref.h" #include "core/settings/qPrefDivePlanner.h" - +#include "core/settings/qPrefTechnicalDetails.h" +#include "qt-models/diveplannermodel.h" plannerShared *plannerShared::instance() { @@ -59,3 +59,57 @@ void plannerShared::set_descrate(int value) qPrefDivePlanner::set_descrate(value * TO_MM_BY_SEC); } +// Planning values +deco_mode plannerShared::planner_deco_mode() +{ + return qPrefDivePlanner::planner_deco_mode(); +} +void plannerShared::set_planner_deco_mode(deco_mode value) +{ + DivePlannerPointsModel::instance()->setDecoMode(value); +} + +int plannerShared::reserve_gas() +{ + return qPrefDivePlanner::reserve_gas(); +} +void plannerShared::set_reserve_gas(int value) +{ + DivePlannerPointsModel::instance()->setReserveGas(value); +} + +bool plannerShared::safetystop() +{ + return qPrefDivePlanner::safetystop(); +} +void plannerShared::set_safetystop(bool value) +{ + DivePlannerPointsModel::instance()->setSafetyStop(value); +} + +int plannerShared::gflow() +{ + return qPrefTechnicalDetails::gflow(); +} +void plannerShared::set_gflow(int value) +{ + DivePlannerPointsModel::instance()->setGFLow(value); +} + +int plannerShared::gfhigh() +{ + return qPrefTechnicalDetails::gflow(); +} +void plannerShared::set_gfhigh(int value) +{ + DivePlannerPointsModel::instance()->setGFHigh(value); +} + +int plannerShared::vpmb_conservatism() +{ + return qPrefTechnicalDetails::vpmb_conservatism(); +} +void plannerShared::set_vpmb_conservatism(int value) +{ + DivePlannerPointsModel::instance()->setVpmbConservatism(value); +} |