Skip to content

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

Merged
tridge merged 1 commit intoArduPilot:masterfrom
IamPete1:python_generator_bitmask
Feb 24, 2025
Merged

Generator: python: set display bitmask based on enum if no value is provided directly#1006
tridge merged 1 commit intoArduPilot:masterfrom
IamPete1:python_generator_bitmask

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
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