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 4, 2024
1 parent ee73e97 commit eedb1ce
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) > (maxnamelen+60):
descstr = " [%s...]" % desc[:(maxnamelen+57)]
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 eedb1ce

Please sign in to comment.