Skip to content

ParameterEditor: support Mission Planner .param file import in diff dialog#14451

Open
DonLakeFlyer wants to merge 1 commit into
mavlink:masterfrom
DonLakeFlyer:mp-param-import
Open

ParameterEditor: support Mission Planner .param file import in diff dialog#14451
DonLakeFlyer wants to merge 1 commit into
mavlink:masterfrom
DonLakeFlyer:mp-param-import

Conversation

@DonLakeFlyer
Copy link
Copy Markdown
Collaborator

Fixes #14347

Summary

The parameter diff dialog accepted only QGC tab-delimited .params files. Mission Planner exports space-delimited .param files using the identical 5-column format (VehicleId ComponentId Name Value Type), so valid MP files were silently rejected — parsedLineCount stayed 0 and buildDiffFromFile returned false with no user feedback.

Changes

ParameterEditorController.ccbuildDiffFromFile

  • Split on /[\t ]+/ (was \t only) so both QGC and MP column separators are handled.
  • Trim each data line before splitting to avoid a spurious empty leading field.
  • Added parsedLineCount guard: when no 5-column lines are found, show an explicit user message ("No valid parameters found…") and return false instead of silently returning true with an empty diff list.

ParameterManager.h / ParameterManager.cc

  • Removed dead readParametersFromStream (declaration + implementation). It had no callers; the UI has used buildDiffFromFile exclusively since the diff dialog was introduced.

ParameterEditor.qml

  • Added Mission Planner Files (.param)* filter to the load file dialog alongside the existing QGC filter.

Tests — ParameterEditorControllerTest

  • Six new integration tests via MockLink (PX4): QGC format with diff, MP format with diff, QGC no-diff, MP no-diff, bad format (expects error message), unknown parameter (noVehicleValue path).

…ialog

The parameter diff dialog previously only parsed tab-delimited QGC .params
files. Mission Planner exports space-delimited .param files using the same
5-column format (VehicleId ComponentId Name Value Type), so valid files
were silently rejected — parsedLineCount stayed 0 and the function returned
false with no user-visible message.

Changes:
- buildDiffFromFile: split on /[\t ]+/ instead of '\t' so both formats
  are accepted. Trim each line before splitting to avoid empty leading
  fields. Add parsedLineCount guard: show an explicit error and return
  false when no 5-column lines are found (bad file format).
- Remove dead ParameterManager::readParametersFromStream (declaration and
  implementation) — had no callers since the UI moved to buildDiffFromFile.
- ParameterEditor.qml: add 'Mission Planner Files (*.param)' filter to the
  load file dialog alongside the existing QGC filter.
- Add ParameterEditorControllerTest covering QGC format, MP format,
  no-diff (both formats), bad format, and unknown parameter.

Fixes mavlink#14347
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

Extends the parameter diff loader to accept Mission Planner whitespace-delimited .param files (in addition to QGC tab-delimited .params), surfaces an explicit error when no parameter rows are parsed, adds the new filter to the load dialog, removes dead code in ParameterManager, and adds integration tests covering the new behavior.

Changes:

  • buildDiffFromFile now splits on [\t ]+ after trimming, tracks parsedLineCount, and shows a user-facing message when nothing parses.
  • ParameterEditor.qml adds the Mission Planner Files (.param)* name filter and the unused readParametersFromStream is removed from ParameterManager.
  • New ParameterEditorControllerTest exercises QGC/MP formats (with and without diffs), bad-format handling, and unknown-on-vehicle params.

Reviewed changes

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

Show a summary per file
File Description
src/QmlControls/ParameterEditorController.cc Whitespace-tolerant split, parsed-line counter, and "no valid parameters" user message
src/QmlControls/ParameterEditor.qml Adds MP .param filter to the load file dialog
src/FactSystem/ParameterManager.h Removes declaration of dead readParametersFromStream
src/FactSystem/ParameterManager.cc Removes implementation of dead readParametersFromStream
test/FactSystem/ParameterEditorControllerTest.{h,cc} New integration tests for the diff loader (QGC/MP, no-diff, bad format, unknown param)
test/FactSystem/CMakeLists.txt Adds new test sources
test/CMakeLists.txt Registers ParameterEditorControllerTest with Integration/Vehicle/MockLink labels
docs/en/qgc-user-guide/getting_started/whats_new.md Documents the new MP .param import capability

@codecov
Copy link
Copy Markdown

codecov Bot commented May 31, 2026

Codecov Report

❌ Patch coverage is 57.14286% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 28.00%. Comparing base (f29efd3) to head (c583afd).
⚠️ Report is 37 commits behind head on master.

Files with missing lines Patch % Lines
src/QmlControls/ParameterEditorController.cc 57.14% 0 Missing and 3 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14451      +/-   ##
==========================================
+ Coverage   25.47%   28.00%   +2.53%     
==========================================
  Files         769      767       -2     
  Lines       65912    66331     +419     
  Branches    30495    30640     +145     
==========================================
+ Hits        16788    18578    +1790     
+ Misses      37285    34930    -2355     
- Partials    11839    12823     +984     
Flag Coverage Δ
unittests 28.00% <57.14%> (+2.53%) ⬆️

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

Files with missing lines Coverage Δ
src/FactSystem/ParameterManager.cc 38.23% <ø> (+1.43%) ⬆️
src/FactSystem/ParameterManager.h 83.33% <ø> (ø)
src/QmlControls/ParameterEditorController.cc 23.95% <57.14%> (+23.95%) ⬆️

... and 200 files with indirect coverage changes


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 3bc4088...c583afd. 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

Build Results

Platform Status

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

All builds passed.

Pre-commit

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

Pre-commit hooks: 2 passed, 45 failed, 7 skipped.

Test Results

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

Code Coverage

Coverage Baseline Change
61.9% 61.7% +0.2%

Artifact Sizes

Artifact Size Δ from master
QGroundControl 216.79 MB -4.60 MB (decrease)
QGroundControl-aarch64 176.66 MB +0.00 MB (increase)
QGroundControl-installer-AMD64 134.68 MB -0.02 MB (decrease)
QGroundControl-installer-AMD64-ARM64 77.50 MB -0.00 MB (decrease)
QGroundControl-installer-ARM64 106.03 MB +0.02 MB (increase)
QGroundControl-linux 186.86 MB -147.82 MB (decrease)
QGroundControl-mac 186.86 MB No change
QGroundControl-windows 186.87 MB No change
QGroundControl-x86_64 172.33 MB +0.00 MB (increase)
Total size decreased by 152.42 MB

Updated: 2026-05-31 20:37:05 UTC • Triggered by: Linux

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants