Skip to content

Commit 6f7b485

Browse files
tridgeclaude
andcommitted
misseditor: use pymavlink param labels for column headings
When pymavlink exposes <param label="..."> via enum.label[i] (newly emitted by mavgen_python), prefer that label as the mission-grid column heading. This finally gives MAV_CMD_DO_SET_CAM_TRIGG_DIST param 1 the proper "Distance" heading (and ~550 other params across all dialects). Older pymavlink installs without enum.label keep working: a getattr fallback drops back to the existing description_map fnmatch heuristic. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f4e1734 commit 6f7b485

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

MAVProxy/modules/mavproxy_misseditor/me_defines.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ def get_column_labels(command_name):
6363
return {}
6464
labels = {}
6565
enum = mavutil.mavlink.enums['MAV_CMD'][cmd]
66+
# pymavlink >= label-emitting versions expose enum.label[i]; older
67+
# installs lack it, so fall back to the description-based heuristic
68+
enum_labels = getattr(enum, 'label', {})
6669
for col in enum.param.keys():
67-
labels[col] = make_column_label(command_name, enum.param[col], "P%u" % col)
70+
if col in enum_labels:
71+
labels[col] = enum_labels[col]
72+
else:
73+
labels[col] = make_column_label(
74+
command_name, enum.param[col], "P%u" % col)
6875
return labels

0 commit comments

Comments
 (0)