From 40d8fa8e4157453e8137e39620fb25abf62bcb2f Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 10 Oct 2015 16:58:20 +0200 Subject: [PATCH] PX4 Power component: Add UAVCAN end enum button --- src/AutoPilotPlugins/PX4/PowerComponent.qml | 7 ++++++- src/AutoPilotPlugins/PX4/PowerComponentController.cc | 6 ++++++ src/AutoPilotPlugins/PX4/PowerComponentController.h | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/AutoPilotPlugins/PX4/PowerComponent.qml b/src/AutoPilotPlugins/PX4/PowerComponent.qml index 59fa2e0dc..150b4cdda 100644 --- a/src/AutoPilotPlugins/PX4/PowerComponent.qml +++ b/src/AutoPilotPlugins/PX4/PowerComponent.qml @@ -277,9 +277,14 @@ QGCView { } QGCButton { - text: "Configure" + text: "Start Configuration" onClicked: controller.busConfigureActuators() } + + QGCButton { + text: "End Configuration" + onClicked: controller.StopBusConfigureActuators() + } } } diff --git a/src/AutoPilotPlugins/PX4/PowerComponentController.cc b/src/AutoPilotPlugins/PX4/PowerComponentController.cc index bcd085a51..d9cd80fb0 100644 --- a/src/AutoPilotPlugins/PX4/PowerComponentController.cc +++ b/src/AutoPilotPlugins/PX4/PowerComponentController.cc @@ -55,6 +55,12 @@ void PowerComponentController::busConfigureActuators(void) _uas->startBusConfig(UASInterface::StartBusConfigActuators); } +void PowerComponentController::stopBusConfigureActuators(void) +{ + disconnect(_uas, &UASInterface::textMessageReceived, this, &PowerComponentController::_handleUASTextMessage); + _uas->startBusConfig(UASInterface::EndBusConfigActuators); +} + void PowerComponentController::_stopCalibration(void) { disconnect(_uas, &UASInterface::textMessageReceived, this, &PowerComponentController::_handleUASTextMessage); diff --git a/src/AutoPilotPlugins/PX4/PowerComponentController.h b/src/AutoPilotPlugins/PX4/PowerComponentController.h index 6e1b9388f..5e608c7ca 100644 --- a/src/AutoPilotPlugins/PX4/PowerComponentController.h +++ b/src/AutoPilotPlugins/PX4/PowerComponentController.h @@ -44,6 +44,7 @@ public: Q_INVOKABLE void calibrateEsc(void); Q_INVOKABLE void busConfigureActuators(void); + Q_INVOKABLE void stopBusConfigureActuators(void); signals: void oldFirmware(void); -- 2.22.0