Skip to content

Commit

Permalink
MAVExplorer: Add message descriptions to stats command
Browse files Browse the repository at this point in the history
  • Loading branch information
shancock884 committed Apr 15, 2024
1 parent 1b76d34 commit b49b9b7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion MAVProxy/modules/lib/msgstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,15 @@ def show_stats(mlog):
pairs = sorted(pairs, key = lambda p : p[1])
for (name,size) in pairs:
if size > 0:
print("%-*s %.2f%%" % (maxnamelen, name, 100.0 * size / total_size))
descstr = ''
if hasattr(mlog, 'metadata'):
desc = mlog.metadata.get_description(name)
if desc:
if len(desc) > (68 - maxnamelen):
descstr = " [%s...]" % desc[:(65 - maxnamelen)]
else:
descstr = " [%s]" % desc
print("%-*s %5.2f%%%s" % (maxnamelen, name, 100.0 * size / total_size, descstr))

print("")
category_total = 0
Expand Down

0 comments on commit b49b9b7

Please sign in to comment.