Added a text to display wifi status.

This commit is contained in:
unrealdragon 2026-09-14 15:31:21 +05:30
commit b8201398e1

View file

@ -9,6 +9,7 @@ Item {
property color tank_lid_color: "#F0121212"
property color tank_base_color: "#00FFFFFF"
property color water_level_color: "#F00F7FAF"
property color water_color_above_alert: "#F00FAF0F"
property color tank_base_border_color: "#F0121212"
property color text_color: "#F05FAF5F"
property double height_max: tank_base.height - 10
@ -19,6 +20,7 @@ Item {
property double max_thres_input: 0
property double rate_of_fill: 0
property double expected_to_fill: 0
property double alert_threshold: 0
Rectangle {
id: base
@ -137,6 +139,7 @@ Item {
function setConfig(config: var) {
min_thres_input = config.min;
max_thres_input = config.max;
alert_threshold = config.alert;
}
function setDistance(distance) {
@ -156,8 +159,17 @@ Item {
console.log("Current reading is: " + current_reading)
console.log("Normalized height is: " + normalized_height)
console.log("Percentage filled is: " + percentage_filled)
console.log("Alert threshold is: " + root.alert_threshold)
console.log("Is level above alert threshold: " + (distance_f <= root.alert_threshold))
root.current_level = normalized_height;
root.percentage_filled = percentage_filled;
if(distance_f <= root.alert_threshold) {
water_level.color = water_color_above_alert
}
else {
water_level.color = water_level_color
}
}
}