From 11ab9aa0311fc0efbb03d3e387480f390f903ea7 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Sun, 10 Apr 2016 15:02:59 -0700 Subject: [PATCH] Warn used about sensor cal over WiFi --- src/AutoPilotPlugins/PX4/SensorsComponent.qml | 9 +++++++++ src/AutoPilotPlugins/PX4/SensorsComponentController.cc | 4 ++++ src/AutoPilotPlugins/PX4/SensorsComponentController.h | 1 + 3 files changed, 14 insertions(+) diff --git a/src/AutoPilotPlugins/PX4/SensorsComponent.qml b/src/AutoPilotPlugins/PX4/SensorsComponent.qml index 15bff89009..4fb7605d68 100644 --- a/src/AutoPilotPlugins/PX4/SensorsComponent.qml +++ b/src/AutoPilotPlugins/PX4/SensorsComponent.qml @@ -138,6 +138,15 @@ QGCView { hideDialog() } } + + } + + Component.onCompleted: { + var usingUDP = controller.usingUDPLink() + if (usingUDP) { + console.log("onUsingUDPLink") + showMessage("Sensor Calibration", "Performing sensor calibration over a WiFi connection is known to be unreliable. You should disconnect and perform calibration using a direct USB connection instead.", StandardButton.Ok) + } } QGCPalette { id: qgcPal; colorGroupEnabled: panel.enabled } diff --git a/src/AutoPilotPlugins/PX4/SensorsComponentController.cc b/src/AutoPilotPlugins/PX4/SensorsComponentController.cc index 6404700115..c28be78849 100644 --- a/src/AutoPilotPlugins/PX4/SensorsComponentController.cc +++ b/src/AutoPilotPlugins/PX4/SensorsComponentController.cc @@ -74,7 +74,11 @@ SensorsComponentController::SensorsComponentController(void) : _unknownFirmwareVersion(false), _waitingForCancel(false) { +} +bool SensorsComponentController::usingUDPLink(void) +{ + return _vehicle->priorityLink()->getLinkConfiguration()->type() == LinkConfiguration::TypeUdp; } /// Appends the specified text to the status log area in the ui diff --git a/src/AutoPilotPlugins/PX4/SensorsComponentController.h b/src/AutoPilotPlugins/PX4/SensorsComponentController.h index b8498d482f..fe9744efa1 100644 --- a/src/AutoPilotPlugins/PX4/SensorsComponentController.h +++ b/src/AutoPilotPlugins/PX4/SensorsComponentController.h @@ -95,6 +95,7 @@ public: Q_INVOKABLE void calibrateLevel(void); Q_INVOKABLE void calibrateAirspeed(void); Q_INVOKABLE void cancelCalibration(void); + Q_INVOKABLE bool usingUDPLink(void); bool fixedWing(void); -- GitLab