mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 07:28:54 +08:00
docs: Markup board specific parameters (#26527)
This commit is contained in:
@@ -20,11 +20,24 @@ If a listed parameter is missing from the Firmware see: [Finding/Updating Parame
|
||||
"""
|
||||
)
|
||||
|
||||
# Define the groups and parameters that are specific to certain boards, to allow for a note to be added to the documentation.
|
||||
BOARD_SPECIFIC_GROUPS = ['Actuator Outputs']
|
||||
PARAM_IS_OUTPUT_TIMER = ['PWM_MAIN_TIM0', 'PWM_MAIN_TIM1', 'PWM_MAIN_TIM2', 'PWM_AUX_TIM0', 'PWM_AUX_TIM1', 'PWM_AUX_TIM2', 'PWM_AUX_TIM3']
|
||||
|
||||
for group in groups:
|
||||
result += f'## {group.GetName()}\n\n'
|
||||
|
||||
group_is_board_specific = (group.GetName() in BOARD_SPECIFIC_GROUPS)
|
||||
|
||||
for param in group.GetParams():
|
||||
name = param.GetName()
|
||||
|
||||
# Apply note if either the group is board specific
|
||||
apply_note_board_specific_group = group_is_board_specific
|
||||
|
||||
# Apply note if name is in list of timer group parameters
|
||||
apply_timer_param_note = (name in PARAM_IS_OUTPUT_TIMER)
|
||||
|
||||
short_desc = param.GetFieldValue("short_desc") or ''
|
||||
|
||||
# Add fullstop to short_desc if not present
|
||||
@@ -78,6 +91,10 @@ If a listed parameter is missing from the Firmware see: [Finding/Updating Parame
|
||||
def_val='Disabled (0)'
|
||||
|
||||
result += f'### {name} (`{type}`)' + ' {#' + name + '}\n\n'
|
||||
if apply_note_board_specific_group:
|
||||
result += f'<Badge type="warning" text="This parameter is only present on some boards." />\n\n'
|
||||
if apply_timer_param_note:
|
||||
result += f'<Badge type="info" text="The exact output numbers where this timer applies are board-specific." />\n\n'
|
||||
if short_desc:
|
||||
result += f'{short_desc}\n\n'
|
||||
if long_desc:
|
||||
@@ -87,7 +104,7 @@ If a listed parameter is missing from the Firmware see: [Finding/Updating Parame
|
||||
if bitmask_list:
|
||||
result += bitmask_output
|
||||
# Format the ranges as a table.
|
||||
result += f"Reboot | minValue | maxValue | increment | default | unit\n--- | --- | --- | --- | --- | ---\n{'✓' if reboot_required else ' ' } | {min_val} | {max_val} | {increment} | {def_val} | {unit} \n\n"
|
||||
result += f"Reboot | minValue | maxValue | increment | default | unit\n--- | --- | --- | --- | --- | ---\n{'✓' if reboot_required else ' ' } | {min_val} | {max_val} | {increment} | {def_val} | {unit} | \n\n"
|
||||
|
||||
self.output = result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user