Skip to content

Misc fixes - #2022

Merged
amilcarlucas merged 8 commits into
masterfrom
misc_fixes
Sep 4, 2026
Merged

Misc fixes#2022
amilcarlucas merged 8 commits into
masterfrom
misc_fixes

Conversation

@amilcarlucas

@amilcarlucas amilcarlucas commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Description

Small improvements

Checklist

  • Run pre-commit checks locally
  • Verified by a human programmer
  • All commits are signed off (use git commit --signoff)
  • Code follows our coding standards
  • Documentation updated if needed
  • No breaking changes or properly documented

Testing

Describe how you tested these changes:

  • Unit tests pass
  • Integration tests pass
  • Manual testing performed
  • Tested on flight controller hardware

Copilot AI lite review requested due to automatic review settings September 3, 2026 20:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

This PR broadens parameter file handling to support multiple Unicode encodings, improves ArduPlane-specific frame-class behavior, and synchronizes UI state after external parameter uploads. It also introduces/upgrades ArduPilot device-ID decoding assets and updates templates/config to reflect ArduPlane quad-plane parameter semantics.

Changes:

  • Add UTF-16/UTF-32 (with/without BOM) support when reading .param files and extend tests accordingly.
  • Adjust ArduPlane frame-class logic (allow “Undefined”; prefer Q_FRAME_*) and update import/config/validation + tests.
  • Refresh FC-value snapshots and parent tables after successful external uploads; document the workflow and add tests.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/unit_data_model_vehicle_components_validation_constants.py Updates expectations around “Undefined” frame class for ArduPlane.
tests/test_param_pid_adjustment_update.py Adds coverage for UTF-16/UTF-32 parameter file loading in PID adjustment tool.
tests/test_frontend_tkinter_parameter_compare_and_upload.py Adds regression tests for post-upload FC snapshot refresh and table repopulation.
tests/test_data_model_vehicle_components_validation.py Adds validation coverage for ArduPlane accepting “Undefined” frame class.
tests/test_data_model_par_dict.py Adds broad encoding/BOM coverage for parameter file parsing.
tests/test_backend_flightcontroller_business_logic.py Adds ArduPlane-specific preference for Q_FRAME_* in frame info extraction.
tests/test_annotate_params.py Adds annotation coverage for UTF-16/UTF-32 parameter inputs.
tests/acceptance_use_fc_params_from_file.py Improves acceptance test by using real filesystem + monkeypatch.chdir.
pyproject.toml Excludes generated decode_devid.py from linting.
ardupilot_methodic_configurator/vehicle_templates/ArduPlane/normal_plane/00_default.param Updates default ArduPlane template parameters (large refresh).
ardupilot_methodic_configurator/param_pid_adjustment_update.py Switches to shared Unicode-aware line reader and updates error messaging.
ardupilot_methodic_configurator/log_analysis/decode_devid_lib.py Updates device-id decoding logic/types/CLI to match upstream.
ardupilot_methodic_configurator/log_analysis/data_model_vehicle_overview_sensor_rules.py Switches to generated decode_devid module and handles decode failure.
ardupilot_methodic_configurator/frontend_tkinter_parameter_compare_and_upload.py Synchronizes FC snapshots post-upload and refreshes parent table on close.
ardupilot_methodic_configurator/data_model_vehicle_components_validation.py Allows “Undefined” frame class only for ArduPlane.
ardupilot_methodic_configurator/data_model_vehicle_components_import.py Passes firmware type into frame-info extraction to support ArduPlane behavior.
ardupilot_methodic_configurator/data_model_par_dict.py Adds encoding detection + Unicode-aware line reader used across loaders.
ardupilot_methodic_configurator/configuration_steps_ArduPlane.json Adds derived Q_FRAME_CLASS handling and autoimport patterns.
ardupilot_methodic_configurator/backend_flightcontroller_commands.py Supplies vehicle type into frame-info extraction.
ardupilot_methodic_configurator/backend_flightcontroller_business_logic.py Makes frame-info extraction vehicle-type aware (ArduPlane prefers Q_FRAME_*).
ardupilot_methodic_configurator/annotate_params.py Reads input via Unicode-aware line reader.
ardupilot_methodic_configurator/main.py Sets vehicle type/version earlier so widgets/imports use correct frame-class semantics.
ARCHITECTURE_parameter_upload.md Documents post-upload synchronization and table refresh behavior.
.github/workflows/update_flightcontroller_ids.yml Starts syncing upstream decode_devid.py into the repo and stages it.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/update_flightcontroller_ids.yml Outdated
Comment on lines 2 to +5
ACRO_PITCH_RATE,180
ACRO_ROLL_RATE,180
ACRO_YAW_RATE,0
ADSB_TYPE,0
Comment on lines +76 to +82
with open("temp.param", "wb") as f:
f.write("# HEADER\r\nPARAM1,1.0 # Comment\r\n".encode("utf-16"))

params, content = load_param_file_with_content("temp.param")

assert params == {"PARAM1": Par(1.0, "Comment")}
assert content == ["# HEADER", "PARAM1,1.0 # Comment"]
Comment on lines +92 to +95
with open("temp.param", "wb") as f:
f.write("# HEADER\r\nPARAM1,1.0 # Comment\r\n".encode("utf-32"))

params, content = load_param_file_with_content("temp.param")
Replace the local device ID decoder with ArduPilot's upstream
Tools/scripts/decode_devid.py.

Update sensor-rule integration for the upstream decoder API, preserve
the copied-file disclaimer in the update workflow, and exclude the
synchronized file from project-specific Ruff checks.
ArduPlane stores multicopter frame settings in Q_FRAME_CLASS and
Q_FRAME_TYPE, unlike ArduCopter. Pass the vehicle type through frame
extraction so ArduPlane explicitly prefers those parameters.

Initialize the detected firmware type before importing parameters and
creating component-editor widgets, ensuring the correct frame-class
choices are used.

Allow Undefined as a valid displayable frame class for normal fixed-wing
ArduPlane configurations without a multicopter frame.

Add regression coverage for parameter precedence and Plane validation.
Use per-test temporary directories for parameter loader, export, and PID
adjustment tests. Update path-sensitive assertions and remove manual cleanup
of repository-relative test artifacts.
@amilcarlucas
amilcarlucas merged commit 728fba1 into master Sep 4, 2026
22 of 27 checks passed
@amilcarlucas
amilcarlucas deleted the misc_fixes branch September 4, 2026 09:38
@coveralls

coveralls commented Sep 4, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 33817969144

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage decreased (-0.08%) to 89.316%

Details

  • Coverage decreased (-0.08%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 39 coverage regressions across 5 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

39 previously-covered lines in 5 files lost coverage.

File Lines Losing Coverage Coverage
main.py 13 89.32%
data_model_vehicle_components_validation.py 10 97.65%
annotate_params.py 8 86.89%
param_pid_adjustment_update.py 6 94.34%
log_analysis/data_model_vehicle_overview_sensor_rules.py 2 82.35%

Coverage Stats

Coverage Status
Relevant Lines: 19038
Covered Lines: 17004
Line Coverage: 89.32%
Relevant Branches: 5704
Covered Branches: 4706
Branch Coverage: 82.5%
Branches in Coverage %: No
Coverage Strength: 2.66 hits per line

💛 - Coveralls

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

☂️ Code Coverage

current status: ✅

Overall Coverage

Statements Covered Coverage Threshold Status
19038 16998 89% 89% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
ardupilot_methodic_configurator/main.py 89% 🟢
ardupilot_methodic_configurator/annotate_params.py 87% 🟢
ardupilot_methodic_configurator/backend_flightcontroller_business_logic.py 100% 🟢
ardupilot_methodic_configurator/backend_flightcontroller_commands.py 100% 🟢
ardupilot_methodic_configurator/data_model_par_dict.py 100% 🟢
ardupilot_methodic_configurator/data_model_vehicle_components_import.py 98% 🟢
ardupilot_methodic_configurator/data_model_vehicle_components_validation.py 98% 🟢
ardupilot_methodic_configurator/frontend_tkinter_parameter_compare_and_upload.py 49% 🟢
ardupilot_methodic_configurator/log_analysis/data_model_vehicle_overview_sensor_rules.py 82% 🟢
ardupilot_methodic_configurator/param_pid_adjustment_update.py 94% 🟢
TOTAL 90% 🟢

updated for commit: 07e3bd4 by action🐍

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants