예제 #1
0
def start_and_decode_coolant_valve_scan():
    ## Valve handle scanning
    fault_detection_output = do_Valve_Handle_scanning()
    if fault_detection_output[0] == ("E" or "e"):                 # If output starts with E or e
        return "Error"                                          # Return error
    elif fault_detection_output[0] == ("C" or "c"):               # If output starts with C or c (Closed)
        return "1"                                              # Return that fault was detected
    elif fault_detection_output[0] == ("O" or "o"):               # If output starts with O or o (Open)
        return "0"                                              # Return that fault was not detected
    return "Error"                                              # Any other option (impossible) - Error
예제 #2
0
def start_and_decode_coolant_valve_scan():
    ## Valve handle scanning
    fault_detection_output = do_Valve_Handle_scanning()
    if fault_detection_output[0] == ("E" or "e"):                 # If output starts with E or e
        return "Error"                                          # Return error
    elif fault_detection_output[0] == ("C" or "c"):               # If output starts with C or c (Closed)
        return "1"                                              # Return that fault was detected
    elif fault_detection_output[0] == ("O" or "o"):               # If output starts with O or o (Open)
        return "0"                                              # Return that fault was not detected
    return "Error"                                              # Any other option (impossible) - Error
예제 #3
0
def start_and_decode_coolant_valve_scan():
    ## Valve handle scanning
    # fault_detection_output = {"angle_information": "1.",        # DEBUGGING
    #                           "fault_detection_feedback": "Open"#"Closed" #"Open" #"Error"
    #                           }
    fault_detection_output = do_Valve_Handle_scanning(cam, jpeg_streamer)
    if fault_detection_output["fault_detection_feedback"][0] == ("E" or "e"):
                                                                # If output starts with E or e
        return "Error"                                          # Return error
    elif fault_detection_output["fault_detection_feedback"][0] == ("C" or "c"):
        feedback = str(fault_detection_output["angle_information"]) + "1111111"
                                                                # If output starts with C or c (Closed)
        return feedback                                         # Return that fault was detected
    elif fault_detection_output["fault_detection_feedback"][0] == ("O" or "o"):
        feedback = str(fault_detection_output["angle_information"]) + "0000000"
                                                                # If output starts with C or c (Closed)
        return feedback                                         # Return that fault was detected
    return "Error"                                              # Any other option (impossible) - Error
예제 #4
0
def start_and_decode_coolant_valve_scan():
    ## Valve handle scanning
    # fault_detection_output = {"angle_information": "1.",        # DEBUGGING
    #                           "fault_detection_feedback": "Open"#"Closed" #"Open" #"Error"
    #                           }
    fault_detection_output = do_Valve_Handle_scanning(cam, jpeg_streamer)
    if fault_detection_output["fault_detection_feedback"][0] == ("E" or "e"):
        # If output starts with E or e
        return "Error"  # Return error
    elif fault_detection_output["fault_detection_feedback"][0] == ("C" or "c"):
        feedback = str(fault_detection_output["angle_information"]) + "1111111"
        # If output starts with C or c (Closed)
        return feedback  # Return that fault was detected
    elif fault_detection_output["fault_detection_feedback"][0] == ("O" or "o"):
        feedback = str(fault_detection_output["angle_information"]) + "0000000"
        # If output starts with C or c (Closed)
        return feedback  # Return that fault was detected
    return "Error"  # Any other option (impossible) - Error