Skip to content

Component editor ESC connection interdependencies#1516

Merged
amilcarlucas merged 2 commits into
masterfrom
ESC_GUI
Apr 21, 2026
Merged

Component editor ESC connection interdependencies#1516
amilcarlucas merged 2 commits into
masterfrom
ESC_GUI

Conversation

@amilcarlucas
Copy link
Copy Markdown
Collaborator

Description

Component editor ESC connection interdependencies

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 review requested due to automatic review settings April 15, 2026 22:57
@amilcarlucas amilcarlucas marked this pull request as draft April 15, 2026 22:58
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

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.

Comment thread tests/test_frontend_tkinter_component_editor.py Outdated
Comment thread tests/test_frontend_tkinter_component_editor.py Outdated
Comment thread tests/test_frontend_tkinter_component_editor.py Outdated
Comment thread tests/test_frontend_tkinter_component_editor.py
Comment thread ardupilot_methodic_configurator/frontend_tkinter_component_editor.py Outdated
Comment thread ardupilot_methodic_configurator/data_model_vehicle_components_validation.py Outdated
Comment thread ardupilot_methodic_configurator/data_model_vehicle_components_validation.py Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
12401 11694 94% 89% 🟢

New Files

No new covered files...

Modified Files

No covered modified files...

updated for commit: 8997d11 by action🐍

@coveralls
Copy link
Copy Markdown

coveralls commented Apr 16, 2026

Coverage Report for CI Build 24640356675

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 increased (+0.7%) to 94.905%

Details

  • Coverage increased (+0.7%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 12856
Covered Lines: 12201
Line Coverage: 94.91%
Relevant Branches: 2089
Covered Branches: 2028
Branch Coverage: 97.08%
Branches in Coverage %: No
Coverage Strength: 3.61 hits per line

💛 - Coveralls

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

Test Results

     4 files  ±  0       4 suites  ±0   41m 18s ⏱️ -16s
 3 575 tests + 26   3 573 ✅ + 26   2 💤 ±0  0 ❌ ±0 
14 092 runs  +104  14 069 ✅ +105  23 💤  - 1  0 ❌ ±0 

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.
tests.unit_data_model_vehicle_components_validation_constants.TestValidationConstants ‑ test_mot_pwm_type_dict_structure
tests.gui_frontend_tkinter_component_editor.TestESCConnectionCascadeBehavior ‑ test_cascade_1_fc_esc_type_change_from_can_to_pwm_updates_all_downstream_widget_entries
tests.gui_frontend_tkinter_component_editor.TestESCConnectionCascadeBehavior ‑ test_cascade_2_fc_esc_protocol_change_to_brushed_restricts_telem_type_widget_to_none
tests.gui_frontend_tkinter_component_editor.TestESCConnectionCascadeBehavior ‑ test_cascade_2_fc_esc_protocol_change_to_dshot150_expands_telem_type_widget_entries
tests.gui_frontend_tkinter_component_editor.TestESCConnectionCascadeBehavior ‑ test_cascade_3_telem_type_change_from_none_to_main_out_shows_bdshot_protocol_in_widget
tests.gui_frontend_tkinter_component_editor.TestESCConnectionCascadeBehavior ‑ test_cascade_3_telem_type_change_from_none_to_serial_updates_protocol_widget
tests.gui_frontend_tkinter_component_editor.TestESCConnectionCascadeBehavior ‑ test_changing_fc_esc_protocol_from_brushed_to_dshot300_expands_telemetry_type_options
tests.gui_frontend_tkinter_component_editor.TestESCConnectionCascadeBehavior ‑ test_changing_fc_esc_protocol_to_brushed_resets_both_telemetry_type_and_protocol
tests.gui_frontend_tkinter_component_editor.TestESCConnectionCascadeBehavior ‑ test_changing_fc_esc_protocol_to_dshot_leaves_telemetry_type_editable
tests.gui_frontend_tkinter_component_editor.TestESCConnectionCascadeBehavior ‑ test_fc_esc_protocol_change_takes_effect_immediately_not_on_next_selection
tests.gui_frontend_tkinter_component_editor.TestESCConnectionCascadeBehavior ‑ test_pwm_fc_esc_leaves_telemetry_comboboxes_enabled
…

♻️ This comment has been updated with latest results.

@amilcarlucas amilcarlucas force-pushed the ESC_GUI branch 2 times, most recently from e984072 to fa8a55c Compare April 17, 2026 00:43
@amilcarlucas amilcarlucas force-pushed the ESC_GUI branch 2 times, most recently from 07fa8cf to 49c2825 Compare April 19, 2026 19:59
@amilcarlucas amilcarlucas marked this pull request as ready for review April 19, 2026 20:11
@amilcarlucas amilcarlucas requested a review from Copilot April 19, 2026 20:11
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

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Comment thread TUNING_GUIDE_ArduCopter.md Outdated
@amilcarlucas amilcarlucas force-pushed the ESC_GUI branch 2 times, most recently from e418859 to 4a9ab20 Compare April 19, 2026 20:58
@amilcarlucas amilcarlucas requested a review from Copilot April 19, 2026 20:58
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

Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.

Comment thread ardupilot_methodic_configurator/frontend_tkinter_component_editor.py Outdated
Comment thread ardupilot_methodic_configurator/frontend_tkinter_component_editor.py Outdated
Comment thread ardupilot_methodic_configurator/data_model_vehicle_components_validation.py Outdated
Comment thread tests/unit_data_model_vehicle_components_validation_constants.py Outdated
Comment thread tests/test_data_model_vehicle_components_import.py Outdated
Comment thread tests/gui_frontend_tkinter_component_editor.py
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

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Comment thread ardupilot_methodic_configurator/frontend_tkinter_component_editor_base.py Outdated
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

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

Comment thread tests/gui_frontend_tkinter_component_editor.py
Comment thread ardupilot_methodic_configurator/frontend_tkinter_component_editor.py Outdated
Comment on lines +110 to 112
err_msg = self.update_protocol_combobox_entries(
self.data_model.get_combobox_values_for_path(protocol_path), protocol_path
)
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +125 to +126
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)
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment thread ardupilot_methodic_configurator/data_model_vehicle_components_validation.py Outdated
…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.
@amilcarlucas amilcarlucas merged commit e95b62f into master Apr 21, 2026
32 of 35 checks passed
@amilcarlucas amilcarlucas deleted the ESC_GUI branch April 21, 2026 08:21
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