0.6.6: dalla Home si aprono le regolazioni dell'oggetto toccato, non di tutto l'impianto

This commit is contained in:
2026-10-11 09:59:25 +02:00
parent a788255593
commit afb2878a8c
8 changed files with 167 additions and 23 deletions
+33 -3
View File
@@ -10,11 +10,19 @@ import "../components"
// slider dentro la pagina che scorre si contendevano anche il trascinamento.
// Qui lo slider e' la PROPOSTA, il numero grande e' quello vero dell'impianto:
// i due coincidono solo dopo "Imposta".
//
// La Home passa l'oggetto toccato ("house" o "water") e si vedono solo le sue
// regolazioni: toccando "Acqua calda" non ha senso trovarsi davanti anche la
// casa. Senza parametro si vedono tutte, come in origine.
Page {
id: page
allowedOrientations: Orientation.All
property string section: ""
property bool mostraCasa: page.section !== "water"
property bool mostraAcqua: page.section !== "house"
property real pendingHouse: 0
property bool houseTouched: false
property real pendingWater: 0
@@ -53,6 +61,8 @@ Page {
function houseChanged() { return Math.abs(page.pendingHouse - page.houseTarget()) > 0.001 }
function waterChanged() { return Math.abs(page.pendingWater - page.waterTarget()) > 0.001 }
// UNA sola assegnazione: in Qt 5.6 assegnare Component.onCompleted due volte
// nello stesso oggetto e' un errore di compilazione del file.
Component.onCompleted: {
page.syncFromPlant()
if (api.configured)
@@ -95,9 +105,13 @@ Page {
PageHeader { title: qsTr("Setpoints") }
// ---- riscaldamento casa ---------------------------------------- //
SectionHeader { text: qsTr("Heating the house") }
SectionHeader {
visible: page.mostraCasa
text: qsTr("Heating the house")
}
ValueRow {
visible: page.mostraCasa
title: qsTr("Current target")
subtitle: qsTr("What the plant is keeping now")
value: page.fmt(page.houseTarget()) + " °C"
@@ -105,6 +119,7 @@ Page {
Slider {
id: casaSlider
visible: page.mostraCasa
width: parent.width
label: qsTr("New house target")
minimumValue: 5
@@ -123,6 +138,7 @@ Page {
}
Row {
visible: page.mostraCasa
x: Theme.horizontalPageMargin
width: col.width - 2 * Theme.horizontalPageMargin
spacing: Theme.paddingSmall
@@ -143,6 +159,7 @@ Page {
}
ActionButton {
visible: page.mostraCasa
text: qsTr("Set house to %1 °C").arg(page.fmt(page.pendingHouse))
confirmText: qsTr("House temperature to %1 °C").arg(page.fmt(page.pendingHouse))
enabled: page.houseChanged()
@@ -150,9 +167,13 @@ Page {
}
// ---- acqua calda sanitaria ------------------------------------- //
SectionHeader { text: qsTr("Domestic hot water") }
SectionHeader {
visible: page.mostraAcqua
text: qsTr("Domestic hot water")
}
ValueRow {
visible: page.mostraAcqua
title: qsTr("DHW target")
subtitle: qsTr("Water now %1 °C").arg(page.fmt(page.raw("dhw_current")))
value: page.fmt(page.waterTarget()) + " °C"
@@ -160,6 +181,7 @@ Page {
Slider {
id: acquaSlider
visible: page.mostraAcqua
width: parent.width
label: qsTr("New target")
minimumValue: 45
@@ -176,6 +198,7 @@ Page {
}
Row {
visible: page.mostraAcqua
x: Theme.horizontalPageMargin
width: col.width - 2 * Theme.horizontalPageMargin
spacing: Theme.paddingSmall
@@ -196,6 +219,7 @@ Page {
}
ActionButton {
visible: page.mostraAcqua
text: qsTr("Set target %1 °C").arg(page.fmt(page.pendingWater))
confirmText: qsTr("DHW target to %1 °C").arg(page.fmt(page.pendingWater))
enabled: page.waterChanged()
@@ -203,15 +227,21 @@ Page {
}
// ---- boost ------------------------------------------------------ //
SectionHeader { text: qsTr("Hot water boost") }
// Il boost e' dell'acqua calda: si vede con lei.
SectionHeader {
visible: page.mostraAcqua
text: qsTr("Hot water boost")
}
ActionButton {
visible: page.mostraAcqua
text: qsTr("Start DHW boost")
confirmText: qsTr("Starting DHW boost")
onTriggered: api.sendCommand("hot_water_boost_on")
}
ActionButton {
visible: page.mostraAcqua
text: qsTr("Stop DHW boost")
confirmText: qsTr("Stopping DHW boost")
onTriggered: api.sendCommand("hot_water_boost_off")