From e94d3282df9743f9aa9268deee53c84bf19b7cbf Mon Sep 17 00:00:00 2001 From: Simon Hancock Date: Sun, 10 Sep 2023 08:51:58 +0100 Subject: [PATCH] Mavgen WLua: Add param units to display --- generator/mavgen_wlua.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/generator/mavgen_wlua.py b/generator/mavgen_wlua.py index cc02297be..d41915ab4 100644 --- a/generator/mavgen_wlua.py +++ b/generator/mavgen_wlua.py @@ -162,10 +162,11 @@ def generate_field_or_param(outf, field_or_param, name, label, physical_type, fi field_type = "ftypes.UINT32" else: display_type = physical_type + unitstr = " " + field_or_param.units if field_or_param.units else "" t.write(outf, """ -f.${fname} = ProtoField.new("${flabel} (${ftypename})", "mavlink_proto.${fname}", ${ftype}, ${fvalues}) -""", {'fname': name, 'flabel': label, 'ftypename': display_type, 'ftype': field_type, 'fvalues': values}) +f.${fname} = ProtoField.new("${flabel} (${ftypename})${unitname}", "mavlink_proto.${fname}", ${ftype}, ${fvalues}) +""", {'fname': name, 'flabel': label, 'ftypename': display_type, 'ftype': field_type, 'fvalues': values, 'unitname': unitstr}) # generate flag enum subfields if enum_obj and enum_obj.bitmask: