From f2939dd991f5f9cd40501d419e7a816492857311 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Fri, 16 Jan 2015 13:02:26 +0100 Subject: Minor PSCR fixes Update O2 metabolsim rate and adopt default gas switch depths to pSCR oxygen drop. Signed-off-by: Robert C. Helling Signed-off-by: Dirk Hohndel --- qt-ui/models.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'qt-ui/models.cpp') diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index 9246a0b07..8a5b8235b 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -284,7 +284,11 @@ bool CylindersModel::setData(const QModelIndex &index, const QVariant &value, in if (CHANGED()) { cyl->gasmix.o2 = string_to_fraction(vString.toUtf8().data()); pressure_t modpO2; - modpO2.mbar = prefs.decopo2; + if (displayed_dive.dc.divemode == PSCR) + modpO2.mbar = prefs.decopo2 + (1000 - get_o2(&cyl->gasmix)) * SURFACE_PRESSURE * + prefs.o2consumption / prefs.decosac / prefs.pscr_ratio; + else + modpO2.mbar = prefs.decopo2; cyl->depth = gas_mod(&cyl->gasmix, modpO2, M_OR_FT(3, 10)); changed = true; } -- cgit v1.2.3-70-g09d2