summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2013-12-07 23:54:19 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-08 09:42:15 +0100
commitf96ea9cc9a9b3a8f3815e492e8a2cfa8057e9add (patch)
treedb53b7b41a62589121252d89fd8deb54e42d203b
parent01e32107258c895653ddeeddc6081b8c2bdc0a1a (diff)
downloadsubsurface-f96ea9cc9a9b3a8f3815e492e8a2cfa8057e9add.tar.gz
If we have defined a gas, default to that one.
If we start to define a gas, we should use that one by default instead of air. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/diveplanner.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index c6d9fa523..ad4f60055 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -1200,6 +1200,12 @@ int DivePlannerPointsModel::addStop(int milimeters, int seconds, int o2, int he,
} else if (seconds == 0 && milimeters == 0 && row == 0) {
milimeters = M_OR_FT(5, 15); // 5m / 15ft
seconds = 600; // 10 min
+ //Default to the first defined gas, if we got one.
+ cylinder_t *cyl = &stagingDive->cylinder[0];
+ if (cyl) {
+ o2 = cyl->gasmix.o2.permille;
+ he = cyl->gasmix.he.permille;
+ }
}
if (o2 != -1)
if (!addGas(o2, he))