summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-03-11 13:17:57 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-03-11 13:17:57 -0800
commitf1d73606e5addc0f4d5d9b5a26dfd4527ce14bdc (patch)
tree185e80e7da35ea4343cf8dfc0ff11299d88a0cf3
parent5a83226aa8d7211e88097265af1cba29113d6cc1 (diff)
downloadsubsurface-f1d73606e5addc0f4d5d9b5a26dfd4527ce14bdc.tar.gz
QML UI: don't allow negative gas consumption
If end pressure is higher than start pressure, simply use the same start and end pressure. Fixes #1024 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-mobile/qmlmanager.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp
index ec18f8cb0..ed53f7f07 100644
--- a/qt-mobile/qmlmanager.cpp
+++ b/qt-mobile/qmlmanager.cpp
@@ -609,6 +609,8 @@ parsed:
diveChanged = true;
d->cylinder[0].start.mbar = parsePressureToMbar(startpressure);
d->cylinder[0].end.mbar = parsePressureToMbar(endpressure);
+ if (d->cylinder[0].end.mbar > d->cylinder[0].start.mbar)
+ d->cylinder[0].end.mbar = d->cylinder[0].start.mbar;
}
// gasmix for first cylinder
if (get_gas_string(d->cylinder[0].gasmix) != gasmix) {