diff options
author | Robert C. Helling <helling@atdotde.de> | 2019-10-29 17:57:34 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-10-31 00:30:38 -0700 |
commit | 9c8fbe494db231b59c2e072b54af85bc217c00d8 (patch) | |
tree | 2b387fea841a6a154135c8b268f3e40298ddbea5 /qt-models/cylindermodel.cpp | |
parent | 43b16f0810f7aa8328fd946e0e014d0625e3b53b (diff) | |
download | subsurface-9c8fbe494db231b59c2e072b54af85bc217c00d8.tar.gz |
Planner: Add option to treat O2 as narcotic
When computing the best mix for a target depth, for helium, one
can either require that the partial pressure of N2 is the same
as at the target depth or the partial pressure of N2 plus O2.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'qt-models/cylindermodel.cpp')
-rw-r--r-- | qt-models/cylindermodel.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp index 95c6aace2..a05cef23f 100644 --- a/qt-models/cylindermodel.cpp +++ b/qt-models/cylindermodel.cpp @@ -391,11 +391,11 @@ bool CylindersModel::setData(const QModelIndex &index, const QVariant &value, in if (QString::compare(qPrintable(vString), "*") == 0) { cyl->bestmix_he = true; // Calculate fO2 for max. depth - cyl->gasmix.he = best_he(displayed_dive.maxdepth, &displayed_dive); + cyl->gasmix.he = best_he(displayed_dive.maxdepth, &displayed_dive, prefs.o2narcotic, cyl->gasmix.o2); } else { cyl->bestmix_he = false; // Calculate fHe for input depth - cyl->gasmix.he = best_he(string_to_depth(qPrintable(vString)), &displayed_dive); + cyl->gasmix.he = best_he(string_to_depth(qPrintable(vString)), &displayed_dive, prefs.o2narcotic, cyl->gasmix.o2); } changed = true; } @@ -605,7 +605,7 @@ bool CylindersModel::updateBestMixes() gasUpdated = true; } if (cyl->bestmix_he) { - cyl->gasmix.he = best_he(displayed_dive.maxdepth, &displayed_dive); + cyl->gasmix.he = best_he(displayed_dive.maxdepth, &displayed_dive, prefs.o2narcotic, cyl->gasmix.o2); // fO2 + fHe must not be greater than 1 if (get_o2(cyl->gasmix) + get_he(cyl->gasmix) > 1000) cyl->gasmix.o2.permille = 1000 - get_he(cyl->gasmix); |