Skip to content

Add more FlightControllerInfoWindow tests, improve the code#388

Closed
amilcarlucas wants to merge 2 commits intomasterfrom
fc_info1
Closed

Add more FlightControllerInfoWindow tests, improve the code#388
amilcarlucas wants to merge 2 commits intomasterfrom
fc_info1

Conversation

@amilcarlucas
Copy link
Copy Markdown
Collaborator

@amilcarlucas amilcarlucas commented Apr 6, 2025

This pull request includes significant updates to the FlightControllerInfoWindow class in the ardupilot_methodic_configurator/frontend_tkinter_flightcontroller_info.py file. The changes improve the initialization and handling of the flight controller information window, enhance error handling, and refactor the code for better readability and maintainability.

Initialization and UI Improvements:

  • Added an optional root_tk parameter to the __init__ method to allow specifying a parent Tk root window. ([ardupilot_methodic_configurator/frontend_tkinter_flightcontroller_info.pyL27-R69](https://github.com/ArduPilot/MethodicConfigurator/pull/388/files#diff-5f236f363085a1bda103f6dbbd4d584ce9c0e41232d8cfdc6d94f80b37a19141L27-R69))
  • Introduced _init_ui and _create_info_fields methods to modularize the UI component initialization. ([ardupilot_methodic_configurator/frontend_tkinter_flightcontroller_info.pyL27-R69](https://github.com/ArduPilot/MethodicConfigurator/pull/388/files#diff-5f236f363085a1bda103f6dbbd4d584ce9c0e41232d8cfdc6d94f80b37a19141L27-R69))

Logging Enhancements:

  • Added _log_flight_controller_info method to encapsulate logging of flight controller information. ([ardupilot_methodic_configurator/frontend_tkinter_flightcontroller_info.pyL56-R160](https://github.com/ArduPilot/MethodicConfigurator/pull/388/files#diff-5f236f363085a1bda103f6dbbd4d584ce9c0e41232d8cfdc6d94f80b37a19141L56-R160))

Error Handling and Scheduling:

  • Added _schedule_download_parameters method to handle parameter download scheduling with error handling. ([ardupilot_methodic_configurator/frontend_tkinter_flightcontroller_info.pyL56-R160](https://github.com/ArduPilot/MethodicConfigurator/pull/388/files#diff-5f236f363085a1bda103f6dbbd4d584ce9c0e41232d8cfdc6d94f80b37a19141L56-R160))
  • Enhanced download_flight_controller_parameters method to include detailed error handling and support for an optional progress callback. ([ardupilot_methodic_configurator/frontend_tkinter_flightcontroller_info.pyL56-R160](https://github.com/ArduPilot/MethodicConfigurator/pull/388/files#diff-5f236f363085a1bda103f6dbbd4d584ce9c0e41232d8cfdc6d94f80b37a19141L56-R160))

Additional Imports:

  • Imported logging_error and SerialException to support new error handling logic. ([ardupilot_methodic_configurator/frontend_tkinter_flightcontroller_info.pyR14-R19](https://github.com/ArduPilot/MethodicConfigurator/pull/388/files#diff-5f236f363085a1bda103f6dbbd4d584ce9c0e41232d8cfdc6d94f80b37a19141R14-R19))

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

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

Comments suppressed due to low confidence (2)

ardupilot_methodic_configurator/frontend_tkinter_flightcontroller_info.py:84

  • [nitpick] Consider including the full exception traceback by setting exc_info=True in the logging_error call to aid in debugging.
logging_error(_("Error downloading flight controller parameters: %s"), str(e))

ardupilot_methodic_configurator/frontend_tkinter_flightcontroller_info.py:83

  • Ensure that tests cover this new exception handling path to verify that errors are logged and the progress window is destroyed properly.
except Exception as e:

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 6, 2025

Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit 3075b3d.

♻️ This comment has been updated with latest results.

@amilcarlucas amilcarlucas force-pushed the fc_info1 branch 3 times, most recently from 329f27d to 9f61393 Compare April 10, 2025 18:26
@amilcarlucas amilcarlucas changed the title Add more tests, improve the code Add more FlightControllerInfoWindow tests, improve the code Apr 10, 2025
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