Browse Source

Merge pull request #7808 from Williangalvani/motorTestTimeout

Motor test fixes for Sub
QGC4.4
Don Gagne 6 years ago committed by GitHub
parent
commit
187d2c756d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 26
      src/AutoPilotPlugins/APM/APMSubMotorComponent.qml

26
src/AutoPilotPlugins/APM/APMSubMotorComponent.qml

@ -168,6 +168,8 @@ SetupPage { @@ -168,6 +168,8 @@ SetupPage {
onToggled: {
if (controller.vehicle.armed) {
timer.stop()
enabled = false
coolDownTimer.start()
}
controller.vehicle.armed = checked
@ -183,6 +185,8 @@ SetupPage { @@ -183,6 +185,8 @@ SetupPage {
safetySwitch.checked = armed
if (!armed) {
timer.stop()
safetySwitch.enabled = false
coolDownTimer.start()
} else {
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!)")
}
} // 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
Timer {
id: timer
@ -212,13 +223,22 @@ SetupPage { @@ -212,13 +223,22 @@ SetupPage {
var reversed = controller.getParameterFact(-1, "MOT_" + (_lastIndex + 1) + "_DIRECTION").value == -1
if (reversed) {
controller.vehicle.motorTest(_lastIndex, 100 - slider.motorSlider.value)
controller.vehicle.motorTest(_lastIndex, 100 - slider.motorSlider.value, 0)
} else {
controller.vehicle.motorTest(_lastIndex, slider.motorSlider.value)
controller.vehicle.motorTest(_lastIndex, slider.motorSlider.value, 0)
}
}
}
}
Timer {
id: coolDownTimer
interval: 11000
repeat: false
onTriggered: {
safetySwitch.enabled = true
}
}
} // Column
} // Component
} // SetupPahe

Loading…
Cancel
Save