From 31e26fd14451c84ef4531aaa3b643b10b529a637 Mon Sep 17 00:00:00 2001 From: Doug Junkins Date: Tue, 19 Jan 2021 07:50:08 -0800 Subject: [PATCH] mobile: add GF fields for ceiling calculation Adds fields to the advanced preferences page to modify GFLow and GFHigh for the Buhlmann decompression model for calculating ceilings. Updated preferences code to set the Buhlmann parameters in core/deco.c when the GF prefs are updated. Signed-off-by: Doug Junkins --- CHANGELOG.md | 1 + core/settings/qPrefTechnicalDetails.cpp | 2 ++ .../preferences/preferences_graph.cpp | 1 - mobile-widgets/qml/Settings.qml | 26 ++++++++++++++++++- profile-widget/profilewidget2.cpp | 2 ++ 5 files changed, 30 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab1af0b46..09fa80f2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +- mobile: add GF fields to adjust Buhlmann algorithm parameters for calculated ceiling - undo: save to git after editing weights [#3159] - undo: reset dive-mode on undo of set-point addition - desktop: complete rewrite of the statistics code, significantly expanding capabilities diff --git a/core/settings/qPrefTechnicalDetails.cpp b/core/settings/qPrefTechnicalDetails.cpp index 2db4898ae..3c616170d 100644 --- a/core/settings/qPrefTechnicalDetails.cpp +++ b/core/settings/qPrefTechnicalDetails.cpp @@ -62,6 +62,7 @@ void qPrefTechnicalDetails::set_gfhigh(int value) if (value != prefs.gfhigh) { prefs.gfhigh = value; disk_gfhigh(true); + set_gf(-1, prefs.gfhigh); emit instance()->gfhighChanged(value); } } @@ -82,6 +83,7 @@ void qPrefTechnicalDetails::set_gflow(int value) if (value != prefs.gflow) { prefs.gflow = value; disk_gflow(true); + set_gf(prefs.gflow, -1); emit instance()->gflowChanged(value); } } diff --git a/desktop-widgets/preferences/preferences_graph.cpp b/desktop-widgets/preferences/preferences_graph.cpp index b7fd5b4b9..687a8d84e 100644 --- a/desktop-widgets/preferences/preferences_graph.cpp +++ b/desktop-widgets/preferences/preferences_graph.cpp @@ -68,7 +68,6 @@ void PreferencesGraph::syncSettings() prefs.planner_deco_mode = ui->buehlmann->isChecked() ? BUEHLMANN : VPMB; qPrefTechnicalDetails::set_gflow(ui->gflow->value()); qPrefTechnicalDetails::set_gfhigh(ui->gfhigh->value()); - set_gf(ui->gflow->value(), ui->gfhigh->value()); qPrefTechnicalDetails::set_vpmb_conservatism(ui->vpmb_conservatism->value()); set_vpmb_conservatism(ui->vpmb_conservatism->value()); qPrefTechnicalDetails::set_show_ccr_setpoint(ui->show_ccr_setpoint->isChecked()); diff --git a/mobile-widgets/qml/Settings.qml b/mobile-widgets/qml/Settings.qml index 3d28bec2a..46c9d2aa6 100644 --- a/mobile-widgets/qml/Settings.qml +++ b/mobile-widgets/qml/Settings.qml @@ -622,7 +622,7 @@ TemplatePage { checked: PrefTechnicalDetails.dcceiling onClicked: { PrefTechnicalDetails.dcceiling = checked - rootItem.settingChanged() + rootItem.settingsChanged() } } TemplateLabel { @@ -635,6 +635,30 @@ TemplatePage { rootItem.settingsChanged() } } + TemplateLabel { + text: qsTr("GFLow") + } + TemplateTextField { + id: gfLow + text: PrefTechnicalDetails.gflow + inputMask: "99" + onEditingFinished: { + PrefTechnicalDetails.gflow = gfLow.text + rootItem.settingsChanged() + } + } + TemplateLabel { + text: qsTr("GFHigh") + } + TemplateTextField { + id: gfHigh + text: PrefTechnicalDetails.gfhigh + inputMask: "99" + onEditingFinished: { + PrefTechnicalDetails.gfhigh = gfHigh.text + rootItem.settingsChanged() + } + } } TemplateLine { visible: sectionAdvanced.isExpanded diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index 4759c007a..043c39258 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -185,6 +185,8 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent), auto tec = qPrefTechnicalDetails::instance(); connect(tec, &qPrefTechnicalDetails::calcalltissuesChanged , this, &ProfileWidget2::actionRequestedReplot); connect(tec, &qPrefTechnicalDetails::calcceilingChanged , this, &ProfileWidget2::actionRequestedReplot); + connect(tec, &qPrefTechnicalDetails::gflowChanged , this, &ProfileWidget2::actionRequestedReplot); + connect(tec, &qPrefTechnicalDetails::gfhighChanged , this, &ProfileWidget2::actionRequestedReplot); connect(tec, &qPrefTechnicalDetails::dcceilingChanged , this, &ProfileWidget2::actionRequestedReplot); connect(tec, &qPrefTechnicalDetails::eadChanged , this, &ProfileWidget2::actionRequestedReplot); connect(tec, &qPrefTechnicalDetails::calcceiling3mChanged , this, &ProfileWidget2::actionRequestedReplot);