-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
ArduPlane: Add RTL_RADIUS and RTL_AUTOLAND to Flight Safety page #14242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -126,6 +126,23 @@ | |||||||
| "label": "Return altitude", | ||||||||
| "optional": true, | ||||||||
| "enableWhen": "_planeRtlAltFact && _planeRtlAltFact.value >= 0" | ||||||||
| }, | ||||||||
| { | ||||||||
| "param": "RTL_RADIUS", | ||||||||
| "label": "Loiter radius", | ||||||||
| "optional": true | ||||||||
| }, | ||||||||
| { | ||||||||
| "control": "label", | ||||||||
| "label": "0 = use Waypoint Loiter Radius (WP_LOITER_RAD), negative = counter-clockwise", | ||||||||
| "indent": true, | ||||||||
| "smallFont": true | ||||||||
|
||||||||
| "smallFont": true | |
| "smallFont": true, | |
| "showWhen": "controller.parameterExists(-1, 'RTL_RADIUS')" |
Copilot
AI
Mar 30, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RTL_AUTOLAND is marked optional but the combobox is always rendered. Consider adding a showWhen/enabled condition based on controller.parameterExists(-1, "RTL_AUTOLAND") to avoid showing an empty control when the parameter isn’t present.
| "control": "combobox" | |
| "control": "combobox", | |
| "showWhen": "controller.parameterExists(-1, 'RTL_AUTOLAND')" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,6 +90,7 @@ def render_label( | |
| *, | ||
| text: str = "", | ||
| warning: bool = False, | ||
| small_font: bool = False, | ||
| tr_context: str = "", | ||
| ) -> str: | ||
| """Render a static ``QGCLabel`` (no fact binding).""" | ||
|
|
@@ -98,6 +99,8 @@ def render_label( | |
| lines.append(f"{indent} wrapMode: Text.WordWrap") | ||
| lines.append(f"{indent} Layout.fillWidth: true") | ||
| lines.append(f"{indent} Layout.preferredWidth: 0") | ||
| if small_font: | ||
| lines.append(f"{indent} font.pointSize: ScreenTools.smallFontPointSize") | ||
| if warning: | ||
|
Comment on lines
100
to
104
|
||
| lines.append(f"{indent} color: qgcPal.warningText") | ||
| lines.append(f"{indent}}}") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RTL_RADIUSis marked optional, but the generatedLabelledFactTextFieldwill still be enabled/visible even whengetParameterFact(..., false)returns null. In that case, editing the field can trigger a QML runtime error (FactTextField callsfact.validate(...)unconditionally). Consider adding ashowWhen/enableWhengate based on parameter existence (e.g.,controller.parameterExists(-1, "RTL_RADIUS")) so the field is hidden/disabled when the param is missing.