diff options
author | Robert C. Helling <helling@atdotde.de> | 2017-11-28 21:14:05 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-12-01 15:47:51 -0800 |
commit | 41b4e4a19a48dbb97321006cdcbf075fde7d81df (patch) | |
tree | 316eb87e01d8c087ca2a86c5bb50bb1c15407e29 /qt-models | |
parent | 0839342d335bef8312845d0c57a81d08a13f657c (diff) | |
download | subsurface-41b4e4a19a48dbb97321006cdcbf075fde7d81df.tar.gz |
Add imperial units to variations computation
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'qt-models')
-rw-r--r-- | qt-models/diveplannermodel.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index f549a0378..191e04917 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -1085,8 +1085,14 @@ void DivePlannerPointsModel::computeVariations(struct diveplan *original_plan, s restore_deco_state(save, &ds, false); char buf[200]; - sprintf(buf, "+ %d:%02d /m + %d:%02d /min", FRACTION(analyzeVariations(shallower, original, deeper, "m"),60), - FRACTION(analyzeVariations(shorter, original, longer, "min"), 60)); + if (prefs.units.length == units::METERS) + sprintf(buf, "+ %d:%02d /m + %d:%02d /min", FRACTION(analyzeVariations(shallower, original, deeper, "m"),60), + FRACTION(analyzeVariations(shorter, original, longer, "min"), 60)); + else + sprintf(buf, "+ %d:%02d /ft + %d:%02d /min", + FRACTION(analyzeVariations(shallower, original, deeper, "ft") * feet_to_mm(1.0) / 1000,60), + FRACTION(analyzeVariations(shorter, original, longer, "min"), 60)); + emit variationsComputed(QString(buf)); #ifdef SHOWSTOPVARIATIONS printf("\n\n"); |