v0.0.4
This commit is contained in:
parent
a934520cd9
commit
aaccb27f22
3 changed files with 35 additions and 23 deletions
50
Main.qml
50
Main.qml
|
|
@ -6,7 +6,7 @@ import QtQuick.Controls.Material
|
|||
|
||||
Window {
|
||||
width: 640
|
||||
height: 480
|
||||
height: 1080
|
||||
visible: true
|
||||
title: qsTr("Hello World")
|
||||
id: root
|
||||
|
|
@ -19,6 +19,11 @@ Window {
|
|||
property double distance: 0
|
||||
property int distance_count: 0
|
||||
// visibility: Window.FullScreen
|
||||
Component.onCompleted: {
|
||||
if(Qt.platform.os !== "android") {
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
id: background
|
||||
|
|
@ -176,6 +181,7 @@ Window {
|
|||
topMargin: 20
|
||||
top: settings_label.bottom
|
||||
left: parent.left
|
||||
verticalCenter: max_thres_input.verticalCenter
|
||||
}
|
||||
height: max_thres_input.height
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
|
@ -187,8 +193,8 @@ Window {
|
|||
id: max_thres_input
|
||||
text: config.max
|
||||
anchors {
|
||||
left: max_thres_label.right
|
||||
leftMargin: 5
|
||||
right: parent.right
|
||||
rightMargin: 5
|
||||
top: settings_label.bottom
|
||||
topMargin: 20
|
||||
}
|
||||
|
|
@ -205,6 +211,7 @@ Window {
|
|||
topMargin: 20
|
||||
top: max_thres_label.bottom
|
||||
left: parent.left
|
||||
verticalCenter: min_thres_input.verticalCenter
|
||||
}
|
||||
height: min_thres_input.height
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
|
@ -216,8 +223,8 @@ Window {
|
|||
id: min_thres_input
|
||||
text: config.min
|
||||
anchors {
|
||||
left: min_thres_label.right
|
||||
leftMargin: 5
|
||||
right: parent.right
|
||||
rightMargin: 5
|
||||
top: max_thres_label.bottom
|
||||
topMargin: 20
|
||||
}
|
||||
|
|
@ -234,6 +241,7 @@ Window {
|
|||
topMargin: 20
|
||||
top: min_thres_label.bottom
|
||||
left: parent.left
|
||||
verticalCenter: alert_thres_input.verticalCenter
|
||||
}
|
||||
height: alert_thres_input.height
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
|
@ -245,8 +253,8 @@ Window {
|
|||
id: alert_thres_input
|
||||
text: config.alert
|
||||
anchors {
|
||||
left: alert_thres_label.right
|
||||
leftMargin: 5
|
||||
right: parent.right
|
||||
rightMargin: 5
|
||||
top: min_thres_label.bottom
|
||||
topMargin: 20
|
||||
}
|
||||
|
|
@ -261,9 +269,8 @@ Window {
|
|||
anchors {
|
||||
topMargin: 20
|
||||
top: alert_thres_label.bottom
|
||||
left: parent.left
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
width: parent.width - 20
|
||||
contentItem: Text {
|
||||
text: flip_bits_box.text
|
||||
font.pointSize: root.font_normal_text_size
|
||||
|
|
@ -297,10 +304,11 @@ Window {
|
|||
anchors {
|
||||
topMargin: 10
|
||||
bottom: save_config.top
|
||||
bottomMargin: 10
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
color: "#F0121212"
|
||||
width: parent.width / 2.5
|
||||
width: parent.width / 1.3
|
||||
height: 60
|
||||
border {
|
||||
width: 1
|
||||
|
|
@ -320,20 +328,19 @@ Window {
|
|||
property color settings_rect_pressed_prev: "#00000000"
|
||||
property color settings_rect_entered_prev: "#00000000"
|
||||
onEntered: {
|
||||
settings_rect_entered_prev = save_config.color
|
||||
save_config.color = "#5A1F1F1F"
|
||||
settings_rect_entered_prev = reset_averages.color
|
||||
reset_averages.color = "#5A1F1F1F"
|
||||
}
|
||||
onExited: {
|
||||
save_config.color = settings_rect_entered_prev
|
||||
reset_averages.color = settings_rect_entered_prev
|
||||
}
|
||||
onPressed: {
|
||||
settings_rect_pressed_prev = save_config.color
|
||||
save_config.color = "#5A1F4F1F"
|
||||
settings_popup.close();
|
||||
settings_rect_pressed_prev = reset_averages.color
|
||||
reset_averages.color = "#5A1F4F1F"
|
||||
listener.resetAverages();
|
||||
}
|
||||
onReleased: {
|
||||
save_config.color = settings_rect_pressed_prev
|
||||
reset_averages.color = settings_rect_pressed_prev
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -347,7 +354,7 @@ Window {
|
|||
horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
color: "#F0121212"
|
||||
width: parent.width / 2.5
|
||||
width: parent.width / 1.3
|
||||
height: 60
|
||||
border {
|
||||
width: 1
|
||||
|
|
@ -423,7 +430,7 @@ Window {
|
|||
id: tank_base
|
||||
color: "#0FFFFFFF"
|
||||
anchors.centerIn: parent
|
||||
width: parent.width / 2.5
|
||||
width: parent.width / 2
|
||||
height: parent.height / 2
|
||||
border.color: "#F0121212"
|
||||
border.width: 5
|
||||
|
|
@ -593,7 +600,10 @@ Window {
|
|||
}
|
||||
|
||||
function dataBlink() {
|
||||
let old_color = status_indicator.color;
|
||||
if(status_indicator_timer.running) {
|
||||
status_indicator_timer.stop();
|
||||
}
|
||||
let old_color = "#F05F5F0F";
|
||||
let new_color = "#F04FAF5F";
|
||||
status_indicator.color = new_color;
|
||||
status_indicator.old_color = old_color;
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ public class WaterLevelService extends Service {
|
|||
else {
|
||||
Instant currentTimestamp = Instant.now();
|
||||
Duration duration = Duration.between(prevAlertTimestamp, currentTimestamp);
|
||||
if(duration.toMinutes() > 30) {
|
||||
if(duration.toMinutes() > 60) {
|
||||
duration_passed = true;
|
||||
}
|
||||
prevAlertTimestamp = currentTimestamp;
|
||||
|
|
@ -113,9 +113,12 @@ public class WaterLevelService extends Service {
|
|||
.setSmallIcon(android.R.drawable.ic_dialog_alert)
|
||||
.setContentTitle("Water Level Sensor")
|
||||
.setContentText("Water Level is below alert threshold")
|
||||
.setPriority(Notification.PRIORITY_HIGH);
|
||||
.setPriority(Notification.PRIORITY_LOW);
|
||||
manager.notify(2, builder.build());
|
||||
Log.d("UDP Service", "Notification sent");
|
||||
if(!started) {
|
||||
started = true;
|
||||
}
|
||||
}
|
||||
DatagramPacket send_packet = new DatagramPacket(buffer, buffer.length, InetAddress.getByName("localhost"), 8180);
|
||||
socket_send.send(send_packet);
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ public:
|
|||
curr = curr->next;
|
||||
delete now;
|
||||
}
|
||||
qDebug() << "Clearing";
|
||||
curr = nullptr;
|
||||
head = nullptr;
|
||||
tail = nullptr;
|
||||
|
|
|
|||
Loading…
Reference in a new issue