From cd3c2266f9f687746770912bfc913c4f94bb124b Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Wed, 8 Jan 2020 12:06:23 +0100 Subject: dive planner: correct bottomsac/decosac calc. Move conversion cuft <-> liter from desktop-widget/diveplanner.cpp to plannerShared, to facilitate the same results in mobile diveplanner Use Backend for bottomsac/decosac and update to check for switch LITER <-> CUFT Add bottomsac/decosac to QMLinterface. Signed-off-by: jan Iversen --- mobile-widgets/qml/DivePlannerSetup.qml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'mobile-widgets/qml/DivePlannerSetup.qml') diff --git a/mobile-widgets/qml/DivePlannerSetup.qml b/mobile-widgets/qml/DivePlannerSetup.qml index 294752de3..2c04d4695 100644 --- a/mobile-widgets/qml/DivePlannerSetup.qml +++ b/mobile-widgets/qml/DivePlannerSetup.qml @@ -22,8 +22,8 @@ Kirigami.ScrollablePage { spinDescrate.value = Backend.descrate } onVolumeChanged: { - spinBottomsac.value = Planner.bottomsac - spinDecosac.value = Planner.decosac + spinBottomsac.value = Backend.bottomsac + spinDecosac.value = Backend.decosac } } Column { @@ -227,14 +227,16 @@ Kirigami.ScrollablePage { TemplateSpinBox { id: spinBottomsac from: 1 - to: 99 + to: (Backend.volume === Enums.LITER) ? 85 : 300 stepSize: 1 - value: Planner.bottomsac + value: Backend.bottomsac textFromValue: function (value, locale) { - return value + volumeUnit + return (Backend.volume === Enums.LITER) ? + value + volumeUnit : + (value / 100).toFixed(2) + volumeUnit } onValueModified: { - Planner.bottomsac = value + Backend.bottomsac = value } } TemplateLabel { @@ -243,14 +245,16 @@ Kirigami.ScrollablePage { TemplateSpinBox { id: spinDecosac from: 1 - to: 99 + to: (Backend.volume === Enums.LITER) ? 85 : 300 stepSize: 1 - value: Planner.decosac + value: Backend.decosac textFromValue: function (value, locale) { - return value + volumeUnit + return (Backend.volume === Enums.LITER) ? + value + volumeUnit : + (value / 100).toFixed(2) + volumeUnit } onValueModified: { - Planner.decosac = value + Backend.decosac = value } } TemplateLabel { -- cgit v1.2.3-70-g09d2