Skip to content

Fix parameter file diff loader and compass-cal refresh popup spam#14347

Draft
HTRamsey wants to merge 2 commits into
mavlink:masterfrom
HTRamsey:fix/param-diff-and-cal-refresh-popups
Draft

Fix parameter file diff loader and compass-cal refresh popup spam#14347
HTRamsey wants to merge 2 commits into
mavlink:masterfrom
HTRamsey:fix/param-diff-and-cal-refresh-popups

Conversation

@HTRamsey
Copy link
Copy Markdown
Collaborator

@HTRamsey HTRamsey commented May 9, 2026

Summary

Two parameter-system UX bugs surfaced together in #14346.

  • Parameter diff loader: ParameterEditorController::buildDiffFromFile only split on \t, so files with whitespace-aligned columns (Mission Planner / ArduPilot tooling, e.g. 1 1 SERVO_BLH_AUTO 1 2) and simple name,value CSVs produced zero parsed entries and the dialog reported "There are no differences between the file loaded and the current settings on the Vehicle" even when values clearly differed. Now splits on [\s,]+ and accepts both the 5-column and a new 2-column format.
  • Post-calibration refresh popup spam: after a compass cal stops (especially cancel) _refreshParams requests a bulk refresh of COMPASS_* / INS_* (APM) or CAL_* / SENS_* (PX4). The FC is often slow to answer mid-cancel, every timeout fired a modal "Parameter read failed" via QGC::showAppMessage, and dozens of modals stacked on the QML root and froze the UI. Added a notifyFailure flag (default true, preserves existing call sites) to ParameterManager::refreshParameter / refreshParametersPrefix and pass false from the post-cal refresh paths in both sensors controllers. The state machine still logs and emits _paramRequestReadFailure; only the modal is suppressed for the batch refresh.

Fixes #14346.

Test plan

  • Load a Mission Planner whitespace-separated .param file with at least one differing value → diff dialog lists differences and applies them on OK.
  • Load a name,value CSV → same.
  • Load a tab-separated QGC-exported file with all matching values → dialog still says "no differences" (regression check).
  • Start a compass calibration on ArduPilot, cancel it → no flood of "Parameter read failed" modals; UI stays responsive.
  • Run a normal compass cal to completion on ArduPilot and PX4 → params repopulate, no popup spam.
  • ctest -L Unit -R Parameter passes.

HTRamsey added 2 commits May 9, 2026 11:38
…ff loader

buildDiffFromFile only split lines on \t, so files with whitespace-aligned
columns (Mission Planner / ArduPilot tooling exports like
`1 1 SERVO_BLH_AUTO 1 2`) and simple `name,value` CSVs produced zero parsed
entries. The diff dialog then reported "There are no differences between the
file loaded and the current settings on the Vehicle" even when values clearly
differed.

Split on `[\s,]+` after trimming, accept both the existing 5-token
`vehicleId componentId name value mavType` format and a new 2-token
`name value` form. For 2-token rows the component is resolved by walking the
vehicle's component ids and the type is derived from the live Fact, so we can
still build a typed diff without the extra columns.

Fixes mavlink#14346
…efresh

After a compass calibration stops (especially on cancel) the FC is often slow
to answer the bulk `COMPASS_*` / `INS_*` (or `CAL_*` / `SENS_*` on PX4)
refresh that `_refreshParams` issues. Each timeout went through
`_mavlinkParamRequestRead` with `notifyFailure=true`, firing a modal
"Parameter read failed: …" via `QGC::showAppMessage` for every parameter.
Dozens of modals stack on the QML root and freeze the UI.

Add a `notifyFailure` parameter (defaults to true) to
`ParameterManager::refreshParameter` and `refreshParametersPrefix` and pass
`false` from the post-calibration refresh paths in both the APM and PX4
sensors controllers. The state machine still logs failures and emits
`_paramRequestReadFailure`; only the user-facing modal is suppressed for the
batch refresh.
Copilot AI review requested due to automatic review settings May 9, 2026 15:39
@HTRamsey HTRamsey marked this pull request as draft May 9, 2026 15:39
@github-actions github-actions Bot added the size/S label May 9, 2026
@HTRamsey
Copy link
Copy Markdown
Collaborator Author

HTRamsey commented May 9, 2026

@DonLakeFlyer this is a quick sample to show you what fixed some of the issues, in case you want to make your own PR based on this

@HTRamsey HTRamsey requested a review from DonLakeFlyer May 9, 2026 15:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes two parameter-system UX issues: parameter file diff import now correctly parses Mission Planner/ArduPilot-style whitespace-separated and simple name,value files, and post-compass-calibration parameter refreshes no longer spam modal “Parameter read failed” popups that can freeze the UI.

Changes:

  • Broadened ParameterEditorController::buildDiffFromFile parsing to accept whitespace/comma separators and both 5-column and 2-column formats.
  • Added a notifyFailure flag to ParameterManager::refreshParameter / refreshParametersPrefix to optionally suppress user-facing failure popups while still logging/emitting failure signals.
  • Updated PX4/APM sensor controllers to disable failure popups during bulk post-calibration refreshes.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/QmlControls/ParameterEditorController.cc Makes the diff loader accept whitespace/comma-separated parameter files and 2-token name value lines.
src/FactSystem/ParameterManager.h Extends refresh APIs with an optional notifyFailure parameter (defaulting to current behavior).
src/FactSystem/ParameterManager.cc Wires notifyFailure through to the PARAM_REQUEST_READ state machine failure path.
src/AutoPilotPlugins/PX4/SensorsComponentController.cc Suppresses per-parameter failure popups during bulk post-cal refresh.
src/AutoPilotPlugins/APM/APMSensorsComponentController.cc Suppresses per-parameter failure popups during bulk post-cal refresh.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 9, 2026

Codecov Report

❌ Patch coverage is 2.56410% with 76 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (master@4cb9d91). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/QmlControls/ParameterEditorController.cc 0.00% 68 Missing ⚠️
...oPilotPlugins/APM/APMSensorsComponentController.cc 0.00% 3 Missing ⚠️
...AutoPilotPlugins/PX4/SensorsComponentController.cc 0.00% 3 Missing ⚠️
src/FactSystem/ParameterManager.cc 50.00% 2 Missing ⚠️

❌ Your patch check has failed because the patch coverage (2.56%) is below the target coverage (30.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #14347   +/-   ##
=========================================
  Coverage          ?   25.29%           
=========================================
  Files             ?      764           
  Lines             ?    65561           
  Branches          ?    30314           
=========================================
  Hits              ?    16585           
  Misses            ?    37316           
  Partials          ?    11660           
Flag Coverage Δ
unittests 25.29% <2.56%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/FactSystem/ParameterManager.h 83.33% <ø> (ø)
src/FactSystem/ParameterManager.cc 36.71% <50.00%> (ø)
...oPilotPlugins/APM/APMSensorsComponentController.cc 0.00% <0.00%> (ø)
...AutoPilotPlugins/PX4/SensorsComponentController.cc 0.00% <0.00%> (ø)
src/QmlControls/ParameterEditorController.cc 0.00% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4cb9d91...1ddcabd. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

Build Results

Platform Status

Platform Status Details
Linux Passed View
Windows Failed View
MacOS Passed View
Android Passed View

Some builds failed.

Pre-commit

Check Status Details
pre-commit Failed (non-blocking) View

Pre-commit hooks: 4 passed, 44 failed, 7 skipped.

Test Results

linux-coverage: 90 passed, 0 skipped
Total: 90 passed, 0 skipped

Code Coverage

Coverage: 59.1%

No baseline available for comparison

Artifact Sizes

Artifact Size
QGroundControl 216.84 MB
QGroundControl-aarch64 176.75 MB
QGroundControl-linux 335.07 MB
QGroundControl-mac 187.07 MB
QGroundControl-windows 187.09 MB
QGroundControl-x86_64 171.93 MB
No baseline available for comparison

Updated: 2026-05-09 16:22:52 UTC • Triggered by: Android

@DonLakeFlyer
Copy link
Copy Markdown
Collaborator

Ok, thanks. I'll take a look...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parameter file import incorrectly reports “There are no differences”

3 participants