Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

mavgen_python: make enumerations MavEnum instances #904

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

peterbarker
Copy link
Contributor

... instead of just bare dictionaries

... and add an is_bitmask method to them

# MAV_GENERATOR_STATUS_FLAG
enums["MAV_GENERATOR_STATUS_FLAG"] = MavEnum(bitmask=1)
MAV_GENERATOR_STATUS_FLAG_OFF = 1
enums["MAV_GENERATOR_STATUS_FLAG"][1] = EnumEntry("MAV_GENERATOR_STATUS_FLAG_OFF", """Generator is off.""")
MAV_GENERATOR_STATUS_FLAG_READY = 2
enums["MAV_GENERATOR_STATUS_FLAG"][2] = EnumEntry("MAV_GENERATOR_STATUS_FLAG_READY", """Generator is ready to start generating power.""")

... and one which is not a bitmask:

# MAV_VTOL_STATE
enums["MAV_VTOL_STATE"] = MavEnum()
MAV_VTOL_STATE_UNDEFINED = 0
enums["MAV_VTOL_STATE"][0] = EnumEntry("MAV_VTOL_STATE_UNDEFINED", """MAV is not configured as VTOL""")
MAV_VTOL_STATE_TRANSITION_TO_FW = 1
enums["MAV_VTOL_STATE"][1] = EnumEntry("MAV_VTOL_STATE_TRANSITION_TO_FW", """VTOL is in transition from multicopter to fixed-wing""")
MAV_VTOL_STATE_TRANSITION_TO_MC = 2
enums["MAV_VTOL_STATE"][2] = EnumEntry("MAV_VTOL_STATE_TRANSITION_TO_MC", """VTOL is in transition from fixed-wing to multicopter""")

@peterbarker peterbarker force-pushed the pr/MavEnum branch 10 times, most recently from f47010a to 93dcec6 Compare January 18, 2024 00:35
... instead of just bare dictionaries

... and add an is_bitmask method to them
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.

1 participant