Update fc_block_decode.py frequency to csv

fc-c
Alan Johnston 10 months ago committed by GitHub
parent 92505e430d
commit d9fa7a9dc1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -45,8 +45,8 @@ telem_string_format = " Image: {image_id:3d} count: {image_count:2d}<p
" Vx(mV): {Vx:5d} Vy(mV): {Vy:5d} Vz(mV): {Vz:5d}<p>" + \ " Vx(mV): {Vx:5d} Vy(mV): {Vy:5d} Vz(mV): {Vz:5d}<p>" + \
" Ix(mA): {Ix:5d} Iy(mA): {Iy:5d} Iz(mA): {Iz:5d}<p>" + \ " Ix(mA): {Ix:5d} Iy(mA): {Iy:5d} Iz(mA): {Iz:5d}<p>" + \
" Vbat(mV): {Vb:5d} Ibat(mA): {Ib:5d}<p></pre>" + \ " Vbat(mV): {Vb:5d} Ibat(mA): {Ib:5d}<p></pre>" + \
" Freq: {frequency:10f} errors: {errors} Seq: {sequence:d} {frame_type} frames: {frame_count:d}" " Freq: {frequency:10.1f} 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}, " + \ 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}" "{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] frequency_string = data_block_string[2]
print(frequency_string) print(frequency_string)
frequency = float(frequency_string[:len(frequency_string) - 2]) frequency = float(frequency_string[:len(frequency_string) - 2])
print(frequency)
errors = int(data_block_string[5]) errors = int(data_block_string[5])
data_block = [int(number_string,16) for number_string in data_block_string[7:]] data_block = [int(number_string,16) for number_string in data_block_string[7:]]
first_byte = data_block[0] first_byte = data_block[0]

Loading…
Cancel
Save

Powered by TurnKey Linux.