This repository has been archived on 2024-06-03. You can view files and clone it, but cannot push or open issues or pull requests.
app/qml/BuzzerConn.qml
2018-08-14 17:07:42 +02:00

41 lines
855 B
QML

import QtQuick 2.0
Item {
id: buzzerConn
height: 0
width: 0
opacity: 0
visible: false
signal pushed()
Timer {
//timer that refreshes the connection state to the buzzer
id: connectionRefreshTimer
running: root.state !== "RUNNING" && root.state !== "STARTING"
repeat: false
interval: 1000
onTriggered: {
_cppBuzzerConn.refresh()
connectionRefreshTimer.start()
}
}
Timer {
id: running_refresh_timer
running: root.state === "RUNNING"
repeat: false
interval: 1
onTriggered: {
if(_cppBuzzerConn.buzzer_triggered()){
buzzerConn.pushed()
}
if(root.state === "RUNNING"){
running_refresh_timer.start()
}
}
}
}