summaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-10-27 23:04:24 +0100
committerGravatar Robert C. Helling <helling@atdotde.de>2020-11-24 10:54:10 +0100
commitb36178a00a37f3679decebb52fffe6e41e5c5704 (patch)
tree6a7997c041dd28d2033b84def68968c69bf8b402 /qt-models
parente47b812fd07e8652dd65795510ff13c5657d4baf (diff)
downloadsubsurface-b36178a00a37f3679decebb52fffe6e41e5c5704.tar.gz
cylindermodel: remove in_planner() use
in_planner() is problematic, since it is uses desktop-only application state. Since the cylinder-model already has an appropriate inPlanner flag, use this instead. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/cylindermodel.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp
index 61bb3b9f5..129fa865a 100644
--- a/qt-models/cylindermodel.cpp
+++ b/qt-models/cylindermodel.cpp
@@ -230,7 +230,7 @@ QVariant CylindersModel::data(const QModelIndex &index, int role) const
return QStringLiteral("*");
} else {
pressure_t modpO2;
- modpO2.mbar = in_planner() ? prefs.bottompo2 : prefs.modpO2 * 1000;
+ modpO2.mbar = inPlanner ? prefs.bottompo2 : prefs.modpO2 * 1000;
return get_depth_string(gas_mod(cyl->gasmix, modpO2, d, M_OR_FT(1,1)), true);
}
case MND:
@@ -429,11 +429,11 @@ bool CylindersModel::setData(const QModelIndex &index, const QVariant &value, in
if (QString::compare(qPrintable(vString), "*") == 0) {
cyl.bestmix_o2 = true;
// Calculate fO2 for max. depth
- cyl.gasmix.o2 = best_o2(d->maxdepth, d);
+ cyl.gasmix.o2 = best_o2(d->maxdepth, d, inPlanner);
} else {
cyl.bestmix_o2 = false;
// Calculate fO2 for input depth
- cyl.gasmix.o2 = best_o2(string_to_depth(qPrintable(vString)), d);
+ cyl.gasmix.o2 = best_o2(string_to_depth(qPrintable(vString)), d, inPlanner);
}
pressure_t modpO2;
modpO2.mbar = prefs.decopo2;
@@ -643,7 +643,7 @@ bool CylindersModel::updateBestMixes()
for (int i = 0; i < d->cylinders.nr; i++) {
cylinder_t *cyl = get_cylinder(d, i);
if (cyl->bestmix_o2) {
- cyl->gasmix.o2 = best_o2(d->maxdepth, d);
+ cyl->gasmix.o2 = best_o2(d->maxdepth, d, inPlanner);
// fO2 + fHe must not be greater than 1
if (get_o2(cyl->gasmix) + get_he(cyl->gasmix) > 1000)
cyl->gasmix.he.permille = 1000 - get_o2(cyl->gasmix);