summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2014-05-26 00:06:55 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-25 15:42:51 -0700
commitf0f60e1f84819500e9e12522d43a903b3a8f87fb (patch)
tree33d2053a1fc0b9aa438af41e51278f51ffee20dc
parentd1366257f081fc28939bd6abe9b67b1dba3fb07a (diff)
downloadsubsurface-f0f60e1f84819500e9e12522d43a903b3a8f87fb.tar.gz
Use gas_mod and fix fpe
When removing o2 from a gas, eg setting it to "", air, this code would raise a nice fpe. Fix that by using gas_mod instead. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/models.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index dc9a7189a..2bc690eb9 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -253,7 +253,9 @@ bool CylindersModel::setData(const QModelIndex &index, const QVariant &value, in
case O2:
if (CHANGED()) {
cyl->gasmix.o2 = string_to_fraction(vString.toUtf8().data());
- cyl->depth.mm = 1600 * 1000 / cyl->gasmix.o2.permille * 10 - 10000;
+ pressure_t modppO2;
+ modppO2.mbar = 1600;
+ cyl->depth = gas_mod(&cyl->gasmix, modppO2);
changed = true;
}
break;