aboutsummaryrefslogtreecommitdiff
path: root/src/Altimeter.qml
diff options
context:
space:
mode:
authordodoradio <dodoradio@outlook.com>2023-07-12 20:28:18 +0100
committerdodoradio <dodoradio@outlook.com>2023-07-12 22:28:51 +0100
commit34f0cb81fe8f6133c5d6d5c26af69486aa6d24ef (patch)
treecf47ffe8eb244056d73f179ccd5ad7794829f23d /src/Altimeter.qml
parent73cbf360e599a184d85ea220b13ffc70b308d4e7 (diff)
Fix inverted altimeter behaviour and allow negative altimeter calibrations
The altimeter was erroneously made to add to the sea level air pressure instead of subtracting from it, which resulted in inverted behaviour. This has now been fixed. This also allows setting a negative altimeter offset
Diffstat (limited to '')
-rw-r--r--src/Altimeter.qml4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Altimeter.qml b/src/Altimeter.qml
index ae71493..3ee11ac 100644
--- a/src/Altimeter.qml
+++ b/src/Altimeter.qml
@@ -44,13 +44,13 @@ Item {
id: pressureText
anchors.centerIn: parent
horizontalAlignment: Text.AlignHCenter
- text: Math.round(pressureSensor.reading.pressure/12 + altimeterOffset.value)
+ text: Math.round(-pressureSensor.reading.pressure/12 + altimeterOffset.value)
font.pixelSize: parent.height / 4
}
ConfigurationValue {
id: altimeterOffset
key: "/org/asteroidos/sensors/altimeter-offset"
- defaultValue: -8443
+ defaultValue: 8443
}
Label {
anchors.horizontalCenter: parent.horizontalCenter