Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Generator: python: set display bitmask based on enum if no value is provided directly #1006

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

IamPete1
Copy link
Member

Because enums are represented as lists with no class it would be a big change to add the bitmask property to the enum. Instead this sets the existing display property on the field which uses the enum to "bitmask" if no value is directly provided and the enum is marked as a bitmask in the xml.

mavlink/mavlink#2215
ArduPilot/mavlink#383

As far as I can tell the other generators deal with this correctly already.

@IamPete1 IamPete1 force-pushed the python_generator_bitmask branch from a1d2888 to 9cb9240 Compare February 23, 2025 13:41
@IamPete1
Copy link
Member Author

This is the diff in generated output. AVAILABLE_MODES, VIDEO_STREAM_INFORMATION, AIRSPEED and STORM32_GIMBAL_MANAGER_CONTROL all get a display bitmask flag. This is because they are cases where the xml "display=bitmask" was not set but the "bitmask=true" was set on the enum which they point to.

image

@tridge tridge merged commit 48f9b93 into ArduPilot:master Feb 24, 2025
14 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants