diff --git a/transmit.py b/transmit.py index c465fe2d..0c3fcd57 100644 --- a/transmit.py +++ b/transmit.py @@ -137,25 +137,31 @@ def increment_mode(): print("can't write to .mode file") def camera_photo(): + start = time.perf_counter() system("sudo rm /home/pi/CubeSatSim/camera_out.jpg") stored_image = False try: + print(time.perf_counter() - start) system("raspistill -o /home/pi/CubeSatSim/camera_out.jpg -w 320 -h 256") # > /dev/null 2>&1") + print(time.perf_counter() - start) f = open("/home/pi/CubeSatSim/camera_out.jpg") f.close() print("Photo taken") + print(time.perf_counter() - start) except: system("cp /home/pi/CubeSatSim/sstv//sstv_image_2_320_x_256.jpeg /home/pi/CubeSatSim/camera_out.jpg") print("Using stored image") stored_image = True - if (stored_image == False): + if (stored_image == False): + print(time.perf_counter() - start) file='/home/pi/CubeSatSim/camera_out.jpg' font1 = ImageFont.truetype('DejaVuSerif.ttf', 20) font2 = ImageFont.truetype('DejaVuSerif-Bold.ttf', 16) - + print(time.perf_counter() - start) try: filep = open("/home/pi/CubeSatSim/telem_string.txt") telem_string = filep.readline() + print(time.perf_counter() - start) except: telem_string = "" if (debug_mode == 1): @@ -163,15 +169,21 @@ def camera_photo(): print(telem_string) img = Image.open(file) + print(time.perf_counter() - start) draw = ImageDraw.Draw(img) # draw.text((10, 10), callsign, font=font2, fill='white') - # draw.text((120, 10), telem_string, font=font2, fill='white') + # draw.text((120, 10), telem_string, font=font2, fill='white') + print(time.perf_counter() - start) draw.text((12, 12), callsign, font=font1, fill='black') + print(time.perf_counter() - start) draw.text((10, 10), callsign, font=font1, fill='white') + print(time.perf_counter() - start) draw.text((122, 12), telem_string, font=font2, fill='black') + print(time.perf_counter() - start) draw.text((120, 10), telem_string, font=font2, fill='white') + print(time.perf_counter() - start) img.save(file) - + print(time.perf_counter() - start) print("CubeSatSim v2.1 transmit.py starting...") pd = 21