2019-11-23 19:44:23 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Controls 2.12
|
|
|
|
import QtQuick.Controls 1.4
|
|
|
|
import QtQuick.Layouts 1.12
|
|
|
|
import QtQuick.Dialogs 1.3
|
|
|
|
import org.subsurfacedivelog.mobile 1.0
|
|
|
|
import org.kde.kirigami 2.4 as Kirigami
|
|
|
|
|
|
|
|
Kirigami.ScrollablePage {
|
|
|
|
title: qsTr("Dive planner setup")
|
|
|
|
|
2020-01-19 09:06:51 +00:00
|
|
|
property string speedUnit: (Backend.length === Enums.METERS) ? qsTr("m/min") : qsTr("ft/min")
|
2020-01-02 07:21:13 +00:00
|
|
|
Connections {
|
2020-01-19 09:06:51 +00:00
|
|
|
target: Backend
|
2020-01-02 07:21:13 +00:00
|
|
|
onLengthChanged: {
|
2020-01-19 17:49:42 +00:00
|
|
|
spinAscrate75.value = Backend.ascrate75
|
|
|
|
spinAscrate50.value = Backend.ascrate50
|
|
|
|
spinAscratestops.value = Backend.ascratestops
|
|
|
|
spinAscratelast6m.value = Backend.ascratelast6m
|
|
|
|
spinDescrate.value = Backend.descrate
|
2020-01-02 07:21:13 +00:00
|
|
|
}
|
|
|
|
}
|
2019-12-26 07:35:41 +00:00
|
|
|
Column {
|
2019-11-23 19:44:23 +00:00
|
|
|
width: parent.width
|
|
|
|
spacing: 1
|
2020-01-22 11:54:18 +00:00
|
|
|
Layout.margins: Kirigami.Units.gridUnit
|
2019-11-23 19:44:23 +00:00
|
|
|
|
2019-12-26 07:35:41 +00:00
|
|
|
TemplateSection {
|
|
|
|
id: rates
|
|
|
|
title: qsTr("Rates")
|
|
|
|
|
|
|
|
GridLayout {
|
|
|
|
columns: 2
|
2020-01-22 11:54:18 +00:00
|
|
|
rowSpacing: Kirigami.Units.smallSpacing * 2
|
|
|
|
columnSpacing: Kirigami.Units.smallSpacing
|
2019-12-26 07:35:41 +00:00
|
|
|
visible: rates.isExpanded
|
|
|
|
|
|
|
|
TemplateLabel {
|
|
|
|
Layout.columnSpan: 2
|
|
|
|
text: qsTr("Ascent")
|
|
|
|
font.bold: true
|
|
|
|
}
|
|
|
|
TemplateLabel {
|
|
|
|
text: qsTr("below 75% avg. depth")
|
|
|
|
}
|
|
|
|
TemplateSpinBox {
|
2020-01-02 07:21:13 +00:00
|
|
|
id: spinAscrate75
|
2019-12-26 07:35:41 +00:00
|
|
|
from: 1
|
|
|
|
to: 99
|
|
|
|
stepSize: 1
|
2020-01-19 17:49:42 +00:00
|
|
|
value: Backend.ascrate75
|
2019-12-26 07:35:41 +00:00
|
|
|
textFromValue: function (value, locale) {
|
2020-01-01 17:28:30 +00:00
|
|
|
return value + speedUnit
|
2019-12-26 07:35:41 +00:00
|
|
|
}
|
|
|
|
onValueModified: {
|
2020-01-19 17:49:42 +00:00
|
|
|
Backend.ascrate75 = value
|
2019-12-26 07:35:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
TemplateLabel {
|
|
|
|
text: qsTr("75% to 50% avg. depth")
|
|
|
|
}
|
|
|
|
TemplateSpinBox {
|
2020-01-02 07:21:13 +00:00
|
|
|
id: spinAscrate50
|
2019-12-26 07:35:41 +00:00
|
|
|
from: 1
|
|
|
|
to: 99
|
|
|
|
stepSize: 1
|
2020-01-19 17:49:42 +00:00
|
|
|
value: Backend.ascrate50
|
2019-12-26 07:35:41 +00:00
|
|
|
textFromValue: function (value, locale) {
|
2020-01-01 17:28:30 +00:00
|
|
|
return value + speedUnit
|
2019-12-26 07:35:41 +00:00
|
|
|
}
|
|
|
|
onValueModified: {
|
2020-01-19 17:49:42 +00:00
|
|
|
Backend.ascrate50 = value
|
2019-12-26 07:35:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
TemplateLabel {
|
|
|
|
text: qsTr("50% avg. depth to 6m")
|
|
|
|
}
|
|
|
|
TemplateSpinBox {
|
2020-01-02 07:21:13 +00:00
|
|
|
id: spinAscratestops
|
2019-12-26 07:35:41 +00:00
|
|
|
from: 1
|
|
|
|
to: 99
|
|
|
|
stepSize: 1
|
2020-01-19 17:49:42 +00:00
|
|
|
value: Backend.ascratestops
|
2019-12-26 07:35:41 +00:00
|
|
|
textFromValue: function (value, locale) {
|
2020-01-01 17:28:30 +00:00
|
|
|
return value + speedUnit
|
2019-12-26 07:35:41 +00:00
|
|
|
}
|
|
|
|
onValueModified: {
|
2020-01-19 17:49:42 +00:00
|
|
|
Backend.ascratestops = value
|
2019-12-26 07:35:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
TemplateLabel {
|
|
|
|
text: qsTr("6m to surface")
|
|
|
|
}
|
|
|
|
TemplateSpinBox {
|
2020-01-02 07:21:13 +00:00
|
|
|
id: spinAscratelast6m
|
2019-12-26 07:35:41 +00:00
|
|
|
from: 1
|
|
|
|
to: 99
|
|
|
|
stepSize: 1
|
2020-01-19 17:49:42 +00:00
|
|
|
value: Backend.ascratelast6m
|
2019-12-26 07:35:41 +00:00
|
|
|
textFromValue: function (value, locale) {
|
2020-01-01 17:28:30 +00:00
|
|
|
return value + speedUnit
|
2019-12-26 07:35:41 +00:00
|
|
|
}
|
|
|
|
onValueModified: {
|
2020-01-19 17:49:42 +00:00
|
|
|
Backend.ascratelast6m = value
|
2019-12-26 07:35:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
TemplateLabel {
|
|
|
|
Layout.columnSpan: 2
|
|
|
|
text: qsTr("Descent")
|
|
|
|
font.bold: true
|
|
|
|
}
|
|
|
|
TemplateLabel {
|
|
|
|
text: qsTr("Surface to the bottom")
|
|
|
|
}
|
|
|
|
TemplateSpinBox {
|
2020-01-02 07:21:13 +00:00
|
|
|
id: spinDescrate
|
2019-12-26 07:35:41 +00:00
|
|
|
from: 1
|
|
|
|
to: 99
|
|
|
|
stepSize: 1
|
2020-01-19 17:49:42 +00:00
|
|
|
value: Backend.descrate
|
2019-12-26 07:35:41 +00:00
|
|
|
textFromValue: function (value, locale) {
|
2020-01-01 17:28:30 +00:00
|
|
|
return value + speedUnit
|
2019-12-26 07:35:41 +00:00
|
|
|
}
|
|
|
|
onValueModified: {
|
2020-01-19 17:49:42 +00:00
|
|
|
Backend.descrate = value
|
2019-12-26 07:35:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
TemplateSection {
|
|
|
|
id: planning
|
|
|
|
title: qsTr("Planning")
|
|
|
|
|
|
|
|
GridLayout {
|
|
|
|
columns: 2
|
2020-01-22 11:54:18 +00:00
|
|
|
rowSpacing: Kirigami.Units.smallSpacing * 2
|
|
|
|
columnSpacing: Kirigami.Units.smallSpacing
|
2019-12-26 07:35:41 +00:00
|
|
|
visible: planning.isExpanded
|
|
|
|
|
|
|
|
// Only support "Open circuit"
|
|
|
|
TemplateLabel {
|
|
|
|
text: "WORK in progress"
|
|
|
|
}
|
|
|
|
|
|
|
|
TemplateRadioButton {
|
|
|
|
text: qsTr("Recreational NO deco")
|
|
|
|
Layout.columnSpan: 2
|
|
|
|
}
|
|
|
|
// Reserve gas is 50bar (PADI/SSI rules)
|
|
|
|
TemplateRadioButton {
|
|
|
|
text: qsTr("Bühlmann, GFLow/GFHigh:")
|
|
|
|
}
|
|
|
|
Row {
|
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
TemplateSpinBox {
|
|
|
|
width: planning.width / 2 -30
|
|
|
|
from: 1
|
|
|
|
to: 99
|
|
|
|
stepSize: 1
|
|
|
|
value: 15
|
|
|
|
textFromValue: function (value, locale) {
|
|
|
|
return value + qsTr(" %")
|
|
|
|
}
|
|
|
|
onValueModified: {
|
|
|
|
console.log("got value: " + value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
TemplateSpinBox {
|
|
|
|
width: planning.width / 2 -30
|
|
|
|
from: 1
|
|
|
|
to: 99
|
|
|
|
stepSize: 1
|
|
|
|
value: 15
|
|
|
|
textFromValue: function (value, locale) {
|
|
|
|
return value + qsTr(" %")
|
|
|
|
}
|
|
|
|
onValueModified: {
|
|
|
|
console.log("got value: " + value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
TemplateRadioButton {
|
|
|
|
text: qsTr("VPM-B, Conservatism:")
|
|
|
|
}
|
|
|
|
TemplateSpinBox {
|
|
|
|
from: 0
|
|
|
|
to: 4
|
|
|
|
stepSize: 1
|
|
|
|
value: 2
|
|
|
|
textFromValue: function (value, locale) {
|
|
|
|
return qsTr("+") + value
|
|
|
|
}
|
|
|
|
onValueModified: {
|
|
|
|
console.log("got value: " + value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
TemplateSection {
|
|
|
|
id: gasoptions
|
|
|
|
title: qsTr("Gas options")
|
|
|
|
|
|
|
|
GridLayout {
|
|
|
|
columns: 2
|
2020-01-22 11:54:18 +00:00
|
|
|
rowSpacing: Kirigami.Units.smallSpacing * 2
|
|
|
|
columnSpacing: Kirigami.Units.smallSpacing
|
2019-12-26 07:35:41 +00:00
|
|
|
visible: gasoptions.isExpanded
|
|
|
|
|
|
|
|
TemplateLabel {
|
|
|
|
text: qsTr("Bottom SAC")
|
|
|
|
}
|
|
|
|
TemplateSpinBox {
|
|
|
|
from: 1
|
|
|
|
to: 99
|
|
|
|
stepSize: 1
|
2019-12-30 18:56:27 +00:00
|
|
|
value: Planner.bottomsac
|
2019-12-26 07:35:41 +00:00
|
|
|
textFromValue: function (value, locale) {
|
|
|
|
return value + qsTr("l/min")
|
|
|
|
}
|
|
|
|
onValueModified: {
|
2019-12-30 18:56:27 +00:00
|
|
|
Planner.bottomsac = value
|
2019-12-26 07:35:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
TemplateLabel {
|
|
|
|
text: qsTr("Deco SAC")
|
|
|
|
}
|
|
|
|
TemplateSpinBox {
|
|
|
|
from: 1
|
|
|
|
to: 99
|
|
|
|
stepSize: 1
|
2019-12-30 18:56:27 +00:00
|
|
|
value: Planner.decosac
|
2019-12-26 07:35:41 +00:00
|
|
|
textFromValue: function (value, locale) {
|
|
|
|
return value + qsTr("l/min")
|
|
|
|
}
|
|
|
|
onValueModified: {
|
2019-12-30 18:56:27 +00:00
|
|
|
Planner.decosac = value
|
2019-12-26 07:35:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
TemplateLabel {
|
|
|
|
text: qsTr("SAC factor")
|
|
|
|
}
|
|
|
|
TemplateSpinBox {
|
|
|
|
from: 20
|
|
|
|
to: 99
|
|
|
|
stepSize: 1
|
2019-12-30 18:56:27 +00:00
|
|
|
value: Planner.sacfactor
|
2019-12-26 07:35:41 +00:00
|
|
|
textFromValue: function (value, locale) {
|
|
|
|
return (value / 10).toFixed(1)
|
|
|
|
}
|
|
|
|
onValueModified: {
|
2019-12-30 18:56:27 +00:00
|
|
|
Planner.sacfactor = value
|
2019-12-26 07:35:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
TemplateLabel {
|
|
|
|
text: qsTr("Problem solving time")
|
|
|
|
}
|
|
|
|
TemplateSpinBox {
|
|
|
|
from: 1
|
|
|
|
to: 9
|
|
|
|
stepSize: 1
|
2019-12-30 18:56:27 +00:00
|
|
|
value: Planner.problemsolvingtime
|
2019-12-26 07:35:41 +00:00
|
|
|
textFromValue: function (value, locale) {
|
|
|
|
return value + qsTr("min")
|
|
|
|
}
|
|
|
|
onValueModified: {
|
2019-12-30 18:56:27 +00:00
|
|
|
Planner.problemsolvingtime = value
|
2019-12-26 07:35:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
TemplateLabel {
|
|
|
|
text: qsTr("Bottom pO2")
|
|
|
|
}
|
|
|
|
TemplateSpinBox {
|
|
|
|
from: 0
|
|
|
|
to: 200
|
|
|
|
stepSize: 1
|
2019-12-30 18:56:27 +00:00
|
|
|
value: Planner.bottompo2
|
2019-12-26 07:35:41 +00:00
|
|
|
textFromValue: function (value, locale) {
|
|
|
|
return (value / 100).toFixed(2) + "bar"
|
|
|
|
}
|
|
|
|
onValueModified: {
|
2019-12-30 18:56:27 +00:00
|
|
|
Planner.bottompo2 = value
|
2019-12-26 07:35:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
TemplateLabel {
|
|
|
|
text: qsTr("Deco pO2")
|
|
|
|
}
|
|
|
|
TemplateSpinBox {
|
|
|
|
from: 0
|
|
|
|
to: 200
|
|
|
|
stepSize: 1
|
2019-12-30 18:56:27 +00:00
|
|
|
value: Planner.decopo2
|
2019-12-26 07:35:41 +00:00
|
|
|
textFromValue: function (value, locale) {
|
|
|
|
return (value / 100).toFixed(2) + "bar"
|
|
|
|
}
|
|
|
|
onValueModified: {
|
2019-12-30 18:56:27 +00:00
|
|
|
Planner.decopo2 = value
|
2019-12-26 07:35:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
TemplateLabel {
|
|
|
|
text: qsTr("Best mix END")
|
|
|
|
}
|
|
|
|
TemplateSpinBox {
|
|
|
|
from: 1
|
|
|
|
to: 99
|
|
|
|
stepSize: 1
|
2019-12-30 18:56:27 +00:00
|
|
|
value: Planner.bestmixend
|
2019-12-26 07:35:41 +00:00
|
|
|
textFromValue: function (value, locale) {
|
|
|
|
return value + qsTr("m")
|
|
|
|
}
|
|
|
|
onValueModified: {
|
2019-12-30 18:56:27 +00:00
|
|
|
Planner.bestmixend = value
|
2019-12-26 07:35:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
TemplateCheckBox {
|
|
|
|
text: qsTr("O2 narcotic")
|
2019-12-29 19:06:42 +00:00
|
|
|
checked: Planner.o2narcotic
|
|
|
|
onClicked: {
|
|
|
|
Planner.o2narcotic = checked
|
|
|
|
}
|
2019-12-26 07:35:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
TemplateSection {
|
|
|
|
id: notes
|
|
|
|
title: qsTr("Notes")
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
visible: notes.isExpanded
|
|
|
|
|
|
|
|
TemplateCheckBox {
|
|
|
|
text: qsTr("Display runtime")
|
2019-12-29 19:06:42 +00:00
|
|
|
checked: Planner.display_runtime
|
|
|
|
onClicked: {
|
|
|
|
Planner.display_runtime = checked
|
|
|
|
}
|
2019-12-26 07:35:41 +00:00
|
|
|
}
|
|
|
|
TemplateCheckBox {
|
|
|
|
text: qsTr("Display segment duration")
|
2019-12-29 19:06:42 +00:00
|
|
|
checked: Planner.display_duration
|
|
|
|
onClicked: {
|
|
|
|
Planner.display_duration = checked
|
|
|
|
}
|
2019-12-26 07:35:41 +00:00
|
|
|
}
|
|
|
|
TemplateCheckBox {
|
|
|
|
text: qsTr("Display transitions in deco")
|
2019-12-29 19:06:42 +00:00
|
|
|
checked: Planner.display_transitions
|
|
|
|
onClicked: {
|
|
|
|
Planner.display_transitions = checked
|
|
|
|
}
|
2019-12-26 07:35:41 +00:00
|
|
|
}
|
|
|
|
TemplateCheckBox {
|
|
|
|
text: qsTr("Verbatim dive plan")
|
2019-12-29 19:06:42 +00:00
|
|
|
checked: Planner.verbatim_plan
|
|
|
|
onClicked: {
|
|
|
|
Planner.verbatim_plan = checked
|
|
|
|
}
|
2019-12-26 07:35:41 +00:00
|
|
|
}
|
|
|
|
TemplateCheckBox {
|
|
|
|
text: qsTr("Display plan variations")
|
2019-12-29 19:06:42 +00:00
|
|
|
checked: Planner.display_variations
|
|
|
|
onClicked: {
|
|
|
|
Planner.display_variations = checked
|
|
|
|
}
|
2019-12-26 07:35:41 +00:00
|
|
|
}
|
|
|
|
}
|
2019-11-23 19:44:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|