From c2eac21cb56eecdae97820a2edb0a43da5f9316d Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Tue, 7 Aug 2018 13:41:03 -0700 Subject: [PATCH] Prompt for Reboot after compass cal --- .../PX4/SensorsComponentController.cc | 2 +- .../PX4/SensorsComponentController.h | 2 +- src/AutoPilotPlugins/PX4/SensorsSetup.qml | 22 +++++++++++++++---- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/AutoPilotPlugins/PX4/SensorsComponentController.cc b/src/AutoPilotPlugins/PX4/SensorsComponentController.cc index 032f54037..89085b8c4 100644 --- a/src/AutoPilotPlugins/PX4/SensorsComponentController.cc +++ b/src/AutoPilotPlugins/PX4/SensorsComponentController.cc @@ -167,7 +167,7 @@ void SensorsComponentController::_stopCalibration(SensorsComponentController::St emit resetStatusTextArea(); } if (_magCalInProgress) { - emit setCompassRotations(); + emit magCalComplete(); } break; diff --git a/src/AutoPilotPlugins/PX4/SensorsComponentController.h b/src/AutoPilotPlugins/PX4/SensorsComponentController.h index d9cb441c2..b9de627fc 100644 --- a/src/AutoPilotPlugins/PX4/SensorsComponentController.h +++ b/src/AutoPilotPlugins/PX4/SensorsComponentController.h @@ -92,7 +92,7 @@ signals: void orientationCalSidesRotateChanged(void); void resetStatusTextArea(void); void waitingForCancelChanged(void); - void setCompassRotations(void); + void magCalComplete(void); private slots: void _handleUASTextMessage(int uasId, int compId, int severity, QString text); diff --git a/src/AutoPilotPlugins/PX4/SensorsSetup.qml b/src/AutoPilotPlugins/PX4/SensorsSetup.qml index 028973fbf..6bbb20ddc 100644 --- a/src/AutoPilotPlugins/PX4/SensorsSetup.qml +++ b/src/AutoPilotPlugins/PX4/SensorsSetup.qml @@ -131,11 +131,11 @@ Item { onResetStatusTextArea: statusLog.text = statusTextAreaDefaultText - onSetCompassRotations: { - if (!_sensorsHaveFixedOrientation && (showCompass0Rot || showCompass1Rot || showCompass2Rot)) { + onMagCalComplete: { + //if (!_sensorsHaveFixedOrientation && (showCompass0Rot || showCompass1Rot || showCompass2Rot)) { setOrientationsDialogShowBoardOrientation = false - showDialog(setOrientationsDialogComponent, qsTr("Set Compass Rotation(s)"), qgcView.showDialogDefaultWidth, StandardButton.Ok) - } + showDialog(setOrientationsDialogComponent, qsTr("Compass Calibration Complete"), qgcView.showDialogDefaultWidth, StandardButton.Ok) + //} } onWaitingForCancelChanged: { @@ -252,6 +252,20 @@ Item { anchors.top: parent.top spacing: ScreenTools.defaultFontPixelHeight + QGCLabel { + width: parent.width + wrapMode: Text.WordWrap + text: qsTr("Set your compass orientations below and the make sure to reboot the vehicle prior to flight.") + } + + QGCButton { + text: qsTr("Reboot Vehicle") + onClicked: { + controller.vehicle.rebootVehicle() + hideDialog() + } + } + QGCLabel { width: parent.width wrapMode: Text.WordWrap -- 2.22.0