diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | core/dive.c | 3 | ||||
-rw-r--r-- | qt-models/cylindermodel.cpp | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 7173d5006..af5e6a40b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +Use pO2 from prefernces for MOD display in equipment tab mobile: fix manually adding dives in the past [#2971] --- diff --git a/core/dive.c b/core/dive.c index 35d5c5972..f79af7ed2 100644 --- a/core/dive.c +++ b/core/dive.c @@ -3628,8 +3628,9 @@ int get_depth_at_time(const struct divecomputer *dc, unsigned int time) fraction_t best_o2(depth_t depth, const struct dive *dive) { fraction_t fo2; + int po2 = in_planner() ? prefs.bottompo2 : prefs.modpO2 * 1000; - fo2.permille = (prefs.bottompo2 * 100 / depth_to_mbar(depth.mm, dive)) * 10; //use integer arithmetic to round down to nearest percent + fo2.permille = (po2 * 100 / depth_to_mbar(depth.mm, dive)) * 10; //use integer arithmetic to round down to nearest percent // Don't permit >100% O2 if (fo2.permille > 1000) fo2.permille = 1000; diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp index f8612c48d..61bb3b9f5 100644 --- a/qt-models/cylindermodel.cpp +++ b/qt-models/cylindermodel.cpp @@ -230,7 +230,7 @@ QVariant CylindersModel::data(const QModelIndex &index, int role) const return QStringLiteral("*"); } else { pressure_t modpO2; - modpO2.mbar = prefs.bottompo2; + modpO2.mbar = in_planner() ? prefs.bottompo2 : prefs.modpO2 * 1000; return get_depth_string(gas_mod(cyl->gasmix, modpO2, d, M_OR_FT(1,1)), true); } case MND: |