From 3bede50e13f719595f0d4e4f9a2e3ae24be198e4 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 16 Feb 2025 11:26:07 -0500 Subject: [PATCH] Update fc_block_decode.py only save valid images --- groundstation/fc_block_decode.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/groundstation/fc_block_decode.py b/groundstation/fc_block_decode.py index d02f5792..825cdb44 100644 --- a/groundstation/fc_block_decode.py +++ b/groundstation/fc_block_decode.py @@ -26,17 +26,17 @@ Ix, Iy, Iz, Ic, Ib = 0, 0, 0, 0, 0 frame_count, frame_type = 0, " " frequency_string, frequency, errors, first_byte = " ", 0, 0, 0 -# html_dir = "/home/pi/CubeSatSim/groundstation/public_html/" -html_dir = "/home/pi/fctelem/public_html/" +# = "/home/pi/CubeSatSim/groundstation/public_html/" + = "/home/pi/fctelem/public_html/" image_dir = "/home/pi/fctelem/" image = "image_file" ssdv = "/home/pi/ssdv/ssdv -d -J " system("sudo rm " + image_dir + image) -#system("sudo rm " + html_dir + "*") -system("sudo rm " + html_dir + "/images/*") +#system("sudo rm " + + "*") +system("sudo rm " + + "/images/*") -#system("cp /home/pi/CubeSatSim/sstv/sstv_image_1_320_x_256.jpg " + html_dir + "image_file.jpeg") +#system("cp /home/pi/CubeSatSim/sstv/sstv_image_1_320_x_256.jpg " + + "image_file.jpeg") head_string = 'FunCube CubeSatSim Telemetry\n\n

FunCube CubeSatSim Telemetry

' + \ '

  
All images
' @@ -140,10 +140,13 @@ if __name__ == "__main__": if (new_image_id != image_id): print("End of image") if (image_id != 256): + print("Saving complete image") newfilename = image_dir + image + str(new_image_id) + ".jpeg" # system(ssdv + image_dir + image + " " + filename) system("mv " + filename + " " + newfilename) - system("mv " + image_dir + image + " " + image_dir + image + str(image_id)) + system("mv " + image_dir + image + " " + image_dir + image + str(image_id)) + # system("cp " + filename + " " + html_dir + "images/" + image + str(image_id) + ".jpeg") + system("cp " + filename + " " + html_dir + "images/") else: system("sudo rm " + image_dir + image) print("New Image ID: ") @@ -160,8 +163,6 @@ if __name__ == "__main__": filename = image_dir + image + str(image_id) + "." + str(image_count) + ".jpeg" system(ssdv + image_dir + image + " " + filename) system("cp " + filename + " " + html_dir + "image_file.jpeg") -# system("cp " + filename + " " + html_dir + "images/" + image + str(image_id) + ".jpeg") - system("cp " + filename + " " + html_dir + "images/") telem_string = fstr(telem_string_format) with open(html_dir + "index.html", "w") as html_file: html_file.write(head_string)