aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2015-01-16 13:02:26 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-17 08:17:29 +1300
commitf2939dd991f5f9cd40501d419e7a816492857311 (patch)
tree4226f652381b6c556b9d5093dabaff3cbcfa4b90 /qt-ui/diveplanner.cpp
parentac40c458facfa4f641c1cf2a2384d955431cdb7c (diff)
downloadsubsurface-f2939dd991f5f9cd40501d419e7a816492857311.tar.gz
Minor PSCR fixes
Update O2 metabolsim rate and adopt default gas switch depths to pSCR oxygen drop. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r--qt-ui/diveplanner.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index 1b389afdf..cd3206c41 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -905,7 +905,11 @@ bool DivePlannerPointsModel::addGas(struct gasmix mix)
/* The depth to change to that gas is given by the depth where its pO₂ is 1.6 bar.
* The user should be able to change this depth manually. */
pressure_t modpO2;
- modpO2.mbar = prefs.decopo2;
+ if (displayed_dive.dc.divemode == PSCR)
+ modpO2.mbar = prefs.decopo2 + (1000 - get_o2(&mix)) * SURFACE_PRESSURE *
+ prefs.o2consumption / prefs.decosac / prefs.pscr_ratio;
+ else
+ modpO2.mbar = prefs.decopo2;
cyl->depth = gas_mod(&mix, modpO2, M_OR_FT(3,10));