Browse Source

Sub motor test fixes (#9243)

* APMSubMotorComponent.qml: do not send motor test messages after disarm command

* Vehicle: Change signature of motorTest to allow not showing errors

* APMMotorComponent.qml: Update to use new signature of motorTest()

* APMSubMotorComponent.qml: Update to use new signature of motorTest() with showErrors=false

* MotorComponent.qml: Update to use new signature of motorTest()
QGC4.4
Willian Galvani 4 years ago committed by GitHub
parent
commit
8ad94d6872
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/AutoPilotPlugins/APM/APMMotorComponent.qml
  2. 6
      src/AutoPilotPlugins/APM/APMSubMotorComponent.qml
  3. 2
      src/AutoPilotPlugins/Common/MotorComponent.qml
  4. 4
      src/Vehicle/Vehicle.cc
  5. 2
      src/Vehicle/Vehicle.h

2
src/AutoPilotPlugins/APM/APMMotorComponent.qml

@ -69,7 +69,7 @@ SetupPage { @@ -69,7 +69,7 @@ SetupPage {
updateValueWhileDragging: false
onValueChanged: {
controller.vehicle.motorTest(index + 1, value, value == 0 ? 0 : _motorTimeoutSecs)
controller.vehicle.motorTest(index + 1, value, value == 0 ? 0 : _motorTimeoutSecs, true)
if (value != 0) {
motorTimer.restart()
}

6
src/AutoPilotPlugins/APM/APMSubMotorComponent.qml

@ -279,7 +279,7 @@ SetupPage { @@ -279,7 +279,7 @@ SetupPage {
id: timer
interval: 50
repeat: true
running: canRunManualTest
running: canRunManualTest && shouldRunManualTest
onTriggered: {
if (controller.vehicle.armed) {
@ -288,9 +288,9 @@ SetupPage { @@ -288,9 +288,9 @@ SetupPage {
var reversed = controller.getParameterFact(-1, "MOT_" + (_lastIndex + 1) + "_DIRECTION").value == -1
if (reversed) {
controller.vehicle.motorTest(_lastIndex, 100 - slider.motorSlider.value, 0)
controller.vehicle.motorTest(_lastIndex, 100 - slider.motorSlider.value, 0, false)
} else {
controller.vehicle.motorTest(_lastIndex, slider.motorSlider.value, 0)
controller.vehicle.motorTest(_lastIndex, slider.motorSlider.value, 0, false)
}
}
}

2
src/AutoPilotPlugins/Common/MotorComponent.qml

@ -69,7 +69,7 @@ SetupPage { @@ -69,7 +69,7 @@ SetupPage {
updateValueWhileDragging: false
onValueChanged: {
controller.vehicle.motorTest(index + 1, value, value == 0 ? 0 : _motorTimeoutSecs)
controller.vehicle.motorTest(index + 1, value, value == 0 ? 0 : _motorTimeoutSecs, true)
if (value != 0) {
motorTimer.restart()
}

4
src/Vehicle/Vehicle.cc

@ -3150,9 +3150,9 @@ void Vehicle::setSoloFirmware(bool soloFirmware) @@ -3150,9 +3150,9 @@ void Vehicle::setSoloFirmware(bool soloFirmware)
}
}
void Vehicle::motorTest(int motor, int percent, int timeoutSecs)
void Vehicle::motorTest(int motor, int percent, int timeoutSecs, bool showError)
{
sendMavCommand(_defaultComponentId, MAV_CMD_DO_MOTOR_TEST, true, motor, MOTOR_TEST_THROTTLE_PERCENT, percent, timeoutSecs, 0, MOTOR_TEST_ORDER_BOARD);
sendMavCommand(_defaultComponentId, MAV_CMD_DO_MOTOR_TEST, showError, motor, MOTOR_TEST_THROTTLE_PERCENT, percent, timeoutSecs, 0, MOTOR_TEST_ORDER_BOARD);
}
QString Vehicle::brandImageIndoor() const

2
src/Vehicle/Vehicle.h

@ -372,7 +372,7 @@ public: @@ -372,7 +372,7 @@ public:
/// @param motor Motor number, 1-based
/// @param percent 0-no power, 100-full power
/// @param timeoutSec Disabled motor after this amount of time
Q_INVOKABLE void motorTest(int motor, int percent, int timeoutSecs);
Q_INVOKABLE void motorTest(int motor, int percent, int timeoutSecs, bool showError);
Q_INVOKABLE void setPIDTuningTelemetryMode(bool pidTuning);

Loading…
Cancel
Save