From 786b472f475adfaf8ab5897d5cdc8d87845dc339 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Fri, 15 Jan 2016 19:35:50 -0800 Subject: [PATCH] Stop connection lost handling during accel cal --- .../APM/APMSensorsComponentController.cc | 10 ++++++++++ .../APM/APMSensorsComponentController.h | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/AutoPilotPlugins/APM/APMSensorsComponentController.cc b/src/AutoPilotPlugins/APM/APMSensorsComponentController.cc index 2f3c0ead5..1853ca611 100644 --- a/src/AutoPilotPlugins/APM/APMSensorsComponentController.cc +++ b/src/AutoPilotPlugins/APM/APMSensorsComponentController.cc @@ -77,6 +77,11 @@ APMSensorsComponentController::APMSensorsComponentController(void) : connect(_sensorsComponent, &VehicleComponent::setupCompleteChanged, this, &APMSensorsComponentController::setupNeededChanged); } +APMSensorsComponentController::~APMSensorsComponentController() +{ + _vehicle->setConnectionLostEnabled(true); +} + /// Appends the specified text to the status log area in the ui void APMSensorsComponentController::_appendStatusLog(const QString& text) { @@ -143,6 +148,10 @@ void APMSensorsComponentController::_resetInternalState(void) void APMSensorsComponentController::_stopCalibration(APMSensorsComponentController::StopCalibrationCode code) { + if (_accelCalInProgress) { + _vehicle->setConnectionLostEnabled(true); + } + disconnect(_uas, &UASInterface::textMessageReceived, this, &APMSensorsComponentController::_handleUASTextMessage); _compassButton->setEnabled(true); @@ -193,6 +202,7 @@ void APMSensorsComponentController::calibrateCompass(void) void APMSensorsComponentController::calibrateAccel(void) { + _vehicle->setConnectionLostEnabled(false); _startLogCalibration(); _accelCalInProgress = true; _uas->startCalibration(UASInterface::StartCalibrationAccel); diff --git a/src/AutoPilotPlugins/APM/APMSensorsComponentController.h b/src/AutoPilotPlugins/APM/APMSensorsComponentController.h index 61758fc10..dabdba523 100644 --- a/src/AutoPilotPlugins/APM/APMSensorsComponentController.h +++ b/src/AutoPilotPlugins/APM/APMSensorsComponentController.h @@ -41,7 +41,8 @@ class APMSensorsComponentController : public FactPanelController public: APMSensorsComponentController(void); - + ~APMSensorsComponentController(); + Q_PROPERTY(bool fixedWing READ fixedWing CONSTANT) Q_PROPERTY(QQuickItem* statusLog MEMBER _statusLog) -- 2.22.0