From a7d18a9fa649e1f6e9b7d553e286abce8a430b9a Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Mon, 6 Jul 2015 00:07:39 +0200 Subject: Round MOD of gas rather than truncate For the proper calculation, we need to take salinity and surface pressure into account (rather than depth = bar * 10 - 10) Signed-off-by: Robert C. Helling Signed-off-by: Dirk Hohndel --- qt-models/cylindermodel.cpp | 2 +- qt-models/diveplannermodel.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'qt-models') diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp index a3ab34513..8786f7889 100644 --- a/qt-models/cylindermodel.cpp +++ b/qt-models/cylindermodel.cpp @@ -218,7 +218,7 @@ bool CylindersModel::setData(const QModelIndex &index, const QVariant &value, in prefs.o2consumption / prefs.decosac / prefs.pscr_ratio; else modpO2.mbar = prefs.decopo2; - cyl->depth = gas_mod(&cyl->gasmix, modpO2, M_OR_FT(3, 10)); + cyl->depth = gas_mod(&cyl->gasmix, modpO2, &displayed_dive, M_OR_FT(3, 10)); changed = true; } break; diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index 439e7a4de..e4cff38ec 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -536,7 +536,7 @@ bool DivePlannerPointsModel::addGas(struct gasmix mix) prefs.o2consumption / prefs.decosac / prefs.pscr_ratio; else modpO2.mbar = prefs.decopo2; - cyl->depth = gas_mod(&mix, modpO2, M_OR_FT(3,10)); + cyl->depth = gas_mod(&mix, modpO2, &displayed_dive, M_OR_FT(3,10)); -- cgit v1.2.3-70-g09d2