From 9ea3d0eaf55ccea99fa3a8025bf7a734f8bb2787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20P=C3=A9rez=20Alonso?= Date: Sat, 8 Mar 2025 21:40:52 +0100 Subject: [PATCH] Fix radius reset when editing FW Landing Patterns Resolved an issue where the loiter radius of a fixed-wing Landing Pattern would revert back to its default value when starting to edit the mission item. --- src/PlanView/FWLandingPatternEditor.qml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/PlanView/FWLandingPatternEditor.qml b/src/PlanView/FWLandingPatternEditor.qml index c83d95ebe00..cd8e8ff62f0 100644 --- a/src/PlanView/FWLandingPatternEditor.qml +++ b/src/PlanView/FWLandingPatternEditor.qml @@ -41,7 +41,7 @@ Rectangle { property string _setToVehicleLocationStr: qsTr("Set to vehicle location") property bool _showCameraSection: !_missionVehicle.apmFirmware property int _altitudeMode: missionItem.altitudesAreRelative ? QGroundControl.AltitudeModeRelative : QGroundControl.AltitudeModeAbsolute - property real _previousLoiterRadius: 0 + property real _previousLoiterRadius: missionItem.loiterRadius.rawValue Column { id: editorColumn @@ -74,12 +74,8 @@ Rectangle { // glide slope heading correctly onCheckedChanged: { if (checked) { - // Restore the previous loiter radius or set the default value - if (_previousLoiterRadius > 0) { - missionItem.loiterRadius.rawValue = _previousLoiterRadius - } else { - missionItem.loiterRadius.rawValue = missionItem.loiterRadius.defaultValue - } + // Restore the previous loiter radius + missionItem.loiterRadius.rawValue = _previousLoiterRadius } else { _previousLoiterRadius = missionItem.loiterRadius.rawValue missionItem.loiterRadius.rawValue = 0