aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/models.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r--qt-ui/models.cpp6
1 files changed, 5 insertions, 1 deletions
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;
}