How to use the pyulog.core.ULog.get_field_size function in pyulog

To help you get started, we’ve selected a few pyulog examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PX4 / pyulog / pyulog / info.py View on Github external
for k in sorted(ulog.msg_info_multiple_dict):
                print(" {0}: {1}".format(k, ulog.msg_info_multiple_dict[k]))
        else:
            print("Info Multiple Messages: {}".format(
                ", ".join(["[{}: {}]".format(k, len(ulog.msg_info_multiple_dict[k])) for k in
                           sorted(ulog.msg_info_multiple_dict)])))



    print("")
    print("{:<41} {:7}, {:10}".format("Name (multi id, message size in bytes)",
                                      "number of data points", "total bytes"))

    data_list_sorted = sorted(ulog.data_list, key=lambda d: d.name + str(d.multi_id))
    for d in data_list_sorted:
        message_size = sum([ULog.get_field_size(f.type_str) for f in d.field_data])
        num_data_points = len(d.data['timestamp'])
        name_id = "{:} ({:}, {:})".format(d.name, d.multi_id, message_size)
        print(" {:<40} {:7d} {:10d}".format(name_id, num_data_points,
                                            message_size * num_data_points))