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>
This commit is contained in:
Dirk Hohndel 2016-03-11 13:17:57 -08:00
parent 5a83226aa8
commit f1d73606e5

View file

@ -609,6 +609,8 @@ parsed:
diveChanged = true; diveChanged = true;
d->cylinder[0].start.mbar = parsePressureToMbar(startpressure); d->cylinder[0].start.mbar = parsePressureToMbar(startpressure);
d->cylinder[0].end.mbar = parsePressureToMbar(endpressure); 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 // gasmix for first cylinder
if (get_gas_string(d->cylinder[0].gasmix) != gasmix) { if (get_gas_string(d->cylinder[0].gasmix) != gasmix) {