Skip to content

Warn the users when they try to edit non-editable parameters#434

Merged
amilcarlucas merged 1 commit into
masterfrom
warn_about_non_editable_parameters
Apr 23, 2025
Merged

Warn the users when they try to edit non-editable parameters#434
amilcarlucas merged 1 commit into
masterfrom
warn_about_non_editable_parameters

Conversation

@amilcarlucas
Copy link
Copy Markdown
Collaborator

This pull request introduces enhancements to the parameter editor table in the ardupilot_methodic_configurator to better handle "forced" and "derived" parameters. The changes include new logic for displaying derived parameters, error handling for invalid edits, and improved metadata handling.

Enhancements to parameter handling:

  • Added a new flag present_as_derived to distinguish derived parameters from forced ones, and updated the logic to set this flag accordingly. ([[1]](https://github.com/ArduPilot/MethodicConfigurator/pull/434/files#diff-a1fc77b2f824d73d73195abb5559fad566982d510708937a5c52ba2c86de71acR309), [[2]](https://github.com/ArduPilot/MethodicConfigurator/pull/434/files#diff-a1fc77b2f824d73d73195abb5559fad566982d510708937a5c52ba2c86de71acL322-R323))
  • Updated the styling logic for parameter entries to account for both forced and derived parameters, ensuring derived parameters are visually distinct. ([ardupilot_methodic_configurator/frontend_tkinter_parameter_editor_table.pyL345-R346](https://github.com/ArduPilot/MethodicConfigurator/pull/434/files#diff-a1fc77b2f824d73d73195abb5559fad566982d510708937a5c52ba2c86de71acL345-R346))

Error handling improvements:

  • Introduced error messages for forced and derived parameters to inform users why they cannot edit these values directly. Added a function to display these messages when users attempt to interact with disabled entries. ([ardupilot_methodic_configurator/frontend_tkinter_parameter_editor_table.pyR369-R392](https://github.com/ArduPilot/MethodicConfigurator/pull/434/files#diff-a1fc77b2f824d73d73195abb5559fad566982d510708937a5c52ba2c86de71acR369-R392))

Metadata handling improvement:

  • Simplified the retrieval of parameter metadata by defaulting to an empty dictionary, reducing the need for conditional checks. ([ardupilot_methodic_configurator/frontend_tkinter_parameter_editor_table.pyL639-R664](https://github.com/ArduPilot/MethodicConfigurator/pull/434/files#diff-a1fc77b2f824d73d73195abb5559fad566982d510708937a5c52ba2c86de71acL639-R664))

Copilot AI review requested due to automatic review settings April 23, 2025 14:42
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

This pull request enhances the parameter editor table by warning users when they attempt to edit non-editable parameters and by clarifying the handling for forced and derived parameters. The key changes include:

  • Introducing a new flag to distinguish derived parameters and updating logic accordingly.
  • Adding error messages to alert users on edit attempts of non-editable entries.
  • Simplifying metadata retrieval with a default empty dictionary.
Comments suppressed due to low confidence (1)

ardupilot_methodic_configurator/frontend_tkinter_parameter_editor_table.py:323

  • It appears that forced parameters are being flagged as derived. To maintain the intended distinction between forced and derived parameters, consider setting 'present_as_forced = True' here and keeping 'present_as_derived = True' only for derived parameters.
present_as_derived = True

@github-actions
Copy link
Copy Markdown
Contributor

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
6172 4059 66% 60% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
ardupilot_methodic_configurator/frontend_tkinter_parameter_editor_table.py 41% 🟢
TOTAL 41% 🟢

updated for commit: bc82213 by action🐍

@github-actions
Copy link
Copy Markdown
Contributor

Test Results

    2 files      2 suites   2m 15s ⏱️
  818 tests   817 ✅ 1 💤 0 ❌
1 636 runs  1 634 ✅ 2 💤 0 ❌

Results for commit bc82213.

@amilcarlucas amilcarlucas merged commit f82baa0 into master Apr 23, 2025
18 of 21 checks passed
@amilcarlucas amilcarlucas deleted the warn_about_non_editable_parameters branch April 23, 2025 15:44
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.

2 participants