Skip to content

Empty template#761

Merged
amilcarlucas merged 3 commits into
masterfrom
empty_template
Sep 1, 2025
Merged

Empty template#761
amilcarlucas merged 3 commits into
masterfrom
empty_template

Conversation

@amilcarlucas
Copy link
Copy Markdown
Collaborator

No description provided.

The test was failing with a "bad argument type for built-in operation" error when trying to create ImageTk.PhotoImage objects. Through debugging, I discovered that this was a compatibility issue with the current Pillow version (11.3.0) and Tkinter when using ImageTk.PhotoImage directly.

Solution Implemented
Replaced ImageTk.PhotoImage with tk.PhotoImage: Instead of using ImageTk.PhotoImage(resized_image), I changed the implementation to use tk.PhotoImage(data=buffer.getvalue()) where the image is first saved to a BytesIO buffer as PNG data.

Enhanced Error Handling: Added validation for image dimensions to prevent division by zero errors and ensure minimum dimensions of 1 pixel.

Added Context Manager: Used with Image.open(filepath) as image: for proper resource management.

Improved Image Format Compatibility: Added checks to ensure the image is in a compatible format for tk.PhotoImage.
These templates have no opinions nor recomendations
Copilot AI review requested due to automatic review settings September 1, 2025 21:28
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 PR introduces comprehensive "empty" ArduCopter vehicle templates for both 4.5.x and 4.6.x firmware versions. These templates provide baseline configuration parameter files that serve as starting points for users who want to create their own vehicle configurations from scratch.

  • Adds two new empty template directories for ArduCopter 4.5.x and 4.6.x versions
  • Provides a complete set of 53+ parameter files covering all aspects of flight controller configuration
  • Updates test code to handle image processing changes from PIL.ImageTk to tkinter.PhotoImage

Reviewed Changes

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

Show a summary per file
File Description
tests/test_frontend_tkinter_base_window.py Updates test to mock tkinter.PhotoImage instead of PIL.ImageTk.PhotoImage and adds PNG data handling
vehicle_templates/.../vehicle_components.json Empty component definitions for both firmware versions with default placeholder values
vehicle_templates/.../00_default.param Complete default parameter sets for ArduCopter firmware
vehicle_templates/.../*.param Sequential parameter files covering IMU calibration, sensors, tuning, and operational configurations
24_inflight_magnetometer_fit_setup.pdef.xml Parameter definition XML files for magnetometer calibration automation

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Sep 1, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
8219 6359 77% 73% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
ardupilot_methodic_configurator/backend_filesystem_program_settings.py 100% 🟢
ardupilot_methodic_configurator/frontend_tkinter_base_window.py 85% 🟢
TOTAL 92% 🟢

updated for commit: 02411d8 by action🐍

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Sep 1, 2025

Test Results

    2 files      2 suites   1m 19s ⏱️
1 644 tests 1 643 ✅ 1 💤 0 ❌
3 288 runs  3 286 ✅ 2 💤 0 ❌

Results for commit 02411d8.

@amilcarlucas amilcarlucas merged commit f13cf8a into master Sep 1, 2025
31 checks passed
@amilcarlucas amilcarlucas deleted the empty_template branch September 1, 2025 21:55
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