Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the number of decimals used to display tank sensor values when… #1851

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions pages/settings/devicelist/tank/PageTankSetup.qml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Page {
allowed: dataItem.seen && (!standard.dataItem.isValid || standard.currentValue === 2)
dataItem.uid: root.bindPrefix + "/RawValueEmpty"
suffix: rawUnit.value || ""
decimals: 3
decimals: rawUnit.decimals
stepSize: 0.005
}

Expand All @@ -71,7 +71,7 @@ Page {
allowed: dataItem.seen && (!standard.dataItem.isValid || standard.currentValue === 2)
dataItem.uid: root.bindPrefix + "/RawValueFull"
suffix: rawUnit.value || ""
decimals: 3
decimals: rawUnit.decimals
stepSize: 0.005
}

Expand Down Expand Up @@ -160,6 +160,18 @@ Page {

VeQuickItem {
id: rawUnit

// The possible values here are not well defined. The doco says: "can be V, and probably also mA and R or O."
// At least one installation uses "cm".
property int decimals: {
switch (value) {
case "cm":
return 1
default:
return 3
}
}

uid: root.bindPrefix + "/RawUnit"
}
}
Loading