Skip to content

Commit

Permalink
Add message description to stats
Browse files Browse the repository at this point in the history
  • Loading branch information
shancock884 committed Feb 16, 2024
1 parent f48e570 commit 10f4153
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
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) > 65:
descstr = " [%s...]" % desc[:62]
else:
descstr = " [%s]" % desc
print("%-*s %.2f%%%s" % (maxnamelen, name, 100.0 * size / total_size, descstr))

print("")
category_total = 0
Expand Down
6 changes: 4 additions & 2 deletions MAVProxy/tools/MAVExplorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1190,8 +1190,8 @@ def cmd_logmessage(args):
if len(args) < 2:
print(usage)
return
set_vehicle_name()
#todo
if hasattr(mlog,'metadata'):
mlog.metadata.print_help(args[1])
return
if args[0] == 'download':
# download XML files for log messages
Expand All @@ -1205,6 +1205,8 @@ def cmd_logmessage(args):
child.start()
except Exception as e:
print(e)
if hasattr(mlog,'metadata'):
mlog.metadata.reload()
return
# Print usage if we've dropped through the ifs
print(usage)
Expand Down

0 comments on commit 10f4153

Please sign in to comment.