aboutsummaryrefslogtreecommitdiffstats
path: root/backend-shared/plannershared.cpp
diff options
context:
space:
mode:
authorGravatar jan Iversen <jan@casacondor.com>2019-12-23 17:23:24 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-12-26 08:46:01 -0800
commitc4d9b737cdf0881a81c6ba635bd9dedbc3a1af26 (patch)
tree84a1240821fecb9fc36cb6d80181e443c35a4bc4 /backend-shared/plannershared.cpp
parent413501bc61689e552de5764db69933a237e7af56 (diff)
downloadsubsurface-c4d9b737cdf0881a81c6ba635bd9dedbc3a1af26.tar.gz
plannerShared: add o2narcotic
Add include of cylinderModel Add o2narcotic the set function is special because it first informs the plannerModel that there is a new value and then ask cylindermodel to calculate a new bestmix 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.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/backend-shared/plannershared.cpp b/backend-shared/plannershared.cpp
index 2093e4c4f..fe4e52443 100644
--- a/backend-shared/plannershared.cpp
+++ b/backend-shared/plannershared.cpp
@@ -3,6 +3,7 @@
#include "core/settings/qPrefDivePlanner.h"
#include "core/settings/qPrefTechnicalDetails.h"
#include "qt-models/diveplannermodel.h"
+#include "qt-models/cylindermodel.h"
plannerShared *plannerShared::instance()
{
@@ -210,3 +211,14 @@ void plannerShared::set_sacfactor(double value)
// NO conversion, this is done in the planner model.
DivePlannerPointsModel::instance()->setSacFactor(value);
}
+
+bool plannerShared::o2narcotic()
+{
+ return qPrefDivePlanner::o2narcotic();
+}
+void plannerShared::set_o2narcotic(bool value)
+{
+ qPrefDivePlanner::set_o2narcotic(value);
+ DivePlannerPointsModel::instance()->emitDataChanged();
+ CylindersModel::instance()->updateBestMixes();
+}