def start_and_decode_hot_spots_scan(): ## Hot spots scanning fault_detection_output = do_hot_spot_detection() print "Output of Hot spot detection is: ", fault_detection_output print fault_detection_output[0] if fault_detection_output[0] == ("E" or "e"): # If output starts with E or e return "Error" # Return error elif fault_detection_output[0] == ("H" or "h"): # If output starts with H or h (Hot spot detected) return "1" # Return that fault was detected elif fault_detection_output[0] == ("N" or "n"): # If output starts with N or n (No hot spots detected) return "0" # Return that fault was not detected return "Error" # Any other option (impossible) - Error
def start_and_decode_hot_spots_scan(): ## Hot spots scanning # fault_detection_output= {"fault_detection_feedback": "12.53", #"000.0" #"Error" # "max_pixel_locations_x": "00", # "max_pixel_locations_y": "99"} fault_detection_output = do_hot_spot_detection(jpeg_streamer) if fault_detection_output["fault_detection_feedback"][0] == ("E" or "e"): # If output starts with E or e return "Error" # Return error else: # If there was no error feedback = str(fault_detection_output["fault_detection_feedback"]) + \ str(fault_detection_output["max_pixel_locations_x"]) + \ str(fault_detection_output["max_pixel_locations_y"]) return feedback return "Error" # If it got here, there was an error