mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
e47b812fd0
commit
b36178a00a
3 changed files with 7 additions and 7 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue