From d9fa7a9dc112348c036c60c67f919d14501554c4 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 12 Feb 2025 08:54:39 -0500 Subject: [PATCH] Update fc_block_decode.py frequency to csv --- groundstation/fc_block_decode.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/groundstation/fc_block_decode.py b/groundstation/fc_block_decode.py index 3ba988be..226efd24 100644 --- a/groundstation/fc_block_decode.py +++ b/groundstation/fc_block_decode.py @@ -45,8 +45,8 @@ telem_string_format = " Image: {image_id:3d} count: {image_count:2d}

" + \ " Ix(mA): {Ix:5d} Iy(mA): {Iy:5d} Iz(mA): {Iz:5d}

" + \ " Vbat(mV): {Vb:5d} Ibat(mA): {Ib:5d}

" + \ - " Freq: {frequency:10f} errors: {errors} Seq: {sequence:d} {frame_type} frames: {frame_count:d}" -csv_format = "{frame_count:4d}, {frequency_string:12s}, {errors:3d}, {first_byte: 2x}, {sequence:5d}, {frame_type:9s}, {image_id:3d}, {image_count:2d}, " + \ + " Freq: {frequency:10.1f} errors: {errors} Seq: {sequence:d} {frame_type} frames: {frame_count:d}" +csv_format = "{frame_count:4d}, {frequency:10.1f}, {errors:3d}, {first_byte: 2x}, {sequence:5d}, {frame_type:9s}, {image_id:3d}, {image_count:2d}, " + \ "{Vx:5d}, {Vy:5d}, {Vz:5d}, {Ix:5d}, {Iy:5d}, {Iz:5d}, {Vb:5d}, {Ib:5d}" @@ -86,6 +86,7 @@ if __name__ == "__main__": frequency_string = data_block_string[2] print(frequency_string) frequency = float(frequency_string[:len(frequency_string) - 2]) + print(frequency) errors = int(data_block_string[5]) data_block = [int(number_string,16) for number_string in data_block_string[7:]] first_byte = data_block[0]