Component editor ESC connection interdependencies#1516
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds UI/data-model coupling so ESC telemetry options mirror and lock appropriately when FC↔ESC connection uses shared buses (SERIAL/CAN), and updates tests to cover these interdependencies.
Changes:
- Cascade-update ESC→FC Telemetry type/protocol when FC→ESC connection type/protocol changes, with UI mirroring/locking for SERIAL/CAN.
- Refine ESC telemetry validation rules and introduce a derived protocol set for “same-port SERIAL” behavior.
- Extend tkinter editor tests and integration patches to stabilize root/Tk usage.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| tests/test_frontend_tkinter_component_editor_integration.py | Patches tkinter.Tk to return provided root for integration stability. |
| tests/test_frontend_tkinter_component_editor.py | Adds unit tests asserting ESC telemetry widgets refresh/lock/mirror based on FC→ESC changes. |
| ardupilot_methodic_configurator/frontend_tkinter_component_editor.py | Implements cascade updates + UI mirroring/locking for ESC telemetry when FC→ESC is SERIAL/CAN. |
| ardupilot_methodic_configurator/data_model_vehicle_components_validation.py | Updates ESC telemetry definitions and centralizes/cascades telemetry choice computation. |
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified FilesNo covered modified files...
|
Coverage Report for CI Build 24640356675Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage increased (+0.7%) to 94.905%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
Test Results 4 files ± 0 4 suites ±0 41m 18s ⏱️ -16s Results for commit 7efcbe6. ± Comparison against base commit c29523a. This pull request removes 1 and adds 27 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
e984072 to
fa8a55c
Compare
07fa8cf to
49c2825
Compare
e418859 to
4a9ab20
Compare
| err_msg = self.update_protocol_combobox_entries( | ||
| self.data_model.get_combobox_values_for_path(protocol_path), protocol_path | ||
| ) |
There was a problem hiding this comment.
Errors are concatenated with += without separators, which can produce hard-to-read combined messages and makes future additions error-prone. Consider collecting messages in a list and joining with a newline (or returning only the first error) so the returned string stays readable and deterministic.
| err_msg += self.update_protocol_combobox_entries(telemetry_type_choices, telemetry_type_path) | ||
| err_msg += self.update_protocol_combobox_entries(telemetry_protocol_choices, telemetry_protocol_path) |
There was a problem hiding this comment.
Errors are concatenated with += without separators, which can produce hard-to-read combined messages and makes future additions error-prone. Consider collecting messages in a list and joining with a newline (or returning only the first error) so the returned string stays readable and deterministic.
…tion Rename MOT_PWM_TYPE_DICT to ESC_CONNECTION_DICT and refactor ESC->FC telemetry validation into dedicated methods (_compute_esc_telemetry_choices, _update_esc_fc_connection_choices, etc.) for better maintainability. Rename BDShot protocol to BDShotOnly for clarity. Add ESC_TELEMETRY_ONLY_PROTOCOLS and ESC_SERIAL_SAME_PORT_PROTOCOLS constants to differentiate protocol categories.
Description
Component editor ESC connection interdependencies
Checklist
git commit --signoff)Testing
Describe how you tested these changes: