Commit 20ed1f69 authored by Willian Galvani's avatar Willian Galvani

Add cooldown to Sub motor test page

parent eeed7a62
...@@ -168,6 +168,8 @@ SetupPage { ...@@ -168,6 +168,8 @@ SetupPage {
onToggled: { onToggled: {
if (controller.vehicle.armed) { if (controller.vehicle.armed) {
timer.stop() timer.stop()
enabled = false
coolDownTimer.start()
} }
controller.vehicle.armed = checked controller.vehicle.armed = checked
...@@ -183,6 +185,8 @@ SetupPage { ...@@ -183,6 +185,8 @@ SetupPage {
safetySwitch.checked = armed safetySwitch.checked = armed
if (!armed) { if (!armed) {
timer.stop() timer.stop()
safetySwitch.enabled = false
coolDownTimer.start()
} else { } else {
timer.start() timer.start()
} }
...@@ -198,7 +202,14 @@ SetupPage { ...@@ -198,7 +202,14 @@ SetupPage {
text: qsTr("Slide this switch to arm the vehicle and enable the motor test (CAUTION!)") text: qsTr("Slide this switch to arm the vehicle and enable the motor test (CAUTION!)")
} }
} // Row } // Row
Row {
QGCLabel {
id: cooldownLabel
visible: coolDownTimer.running
color: qgcPal.warningText
text: qsTr("A 10 second coooldown is required before testing again, please stand by...")
}
}
// Repeats the command signal and updates the checkbox every 50 ms // Repeats the command signal and updates the checkbox every 50 ms
Timer { Timer {
id: timer id: timer
...@@ -219,6 +230,15 @@ SetupPage { ...@@ -219,6 +230,15 @@ SetupPage {
} }
} }
} }
Timer {
id: coolDownTimer
interval: 11000
repeat: false
onTriggered: {
safetySwitch.enabled = true
}
}
} // Column } // Column
} // Component } // Component
} // SetupPahe } // SetupPahe
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment