Exemplo n.º 1
0
    def get_turbo_error_code(self):
        """Gets the current error code of the turbo from the turbo controller.

        Returns
        -------
        str
            The current error code of the turbo.
        """
        send_data_request(self.ser, self.turbo_address, 303)

        addr, rw, param_num, error_code = read_gauge_response(self.ser)

        return error_code
Exemplo n.º 2
0
    def get_turbo_motor_temperature(self):
        """Gets the temperatures of the turbo rotor from the turbo controller.

        Returns
        -------
        int
            The rotor temperature of the turbo in Celsius.
        """

        send_data_request(self.ser, self.turbo_address, 346)
        addr, rw, param_num, motor_temp = read_gauge_response(self.ser)

        return int(motor_temp)
Exemplo n.º 3
0
    def get_turbo_set_rotation_speed(self):
        """Gets the the rotation speed that the turbo is set to from the turbo controller.
        This is the speed in Hz that the turbo motor will spin up to if turned on.

        Returns
        -------
        int
            The rotation speed that the turbo is set to in Hz
        """

        send_data_request(self.ser, self.turbo_address, 308)

        addr, rw, param_num, set_rotation_speed = read_gauge_response(self.ser)

        return int(set_rotation_speed)
Exemplo n.º 4
0
    def get_turbo_actual_rotation_speed(self):
        """Gets the current rotation speed of the turbo from the turbo controller.

        Returns
        -------
        int
            The current rotation speed of the turbo in Hz.
        """

        send_data_request(self.ser, self.turbo_address, 309)

        addr, rw, param_num, actual_rotation_speed = read_gauge_response(
            self.ser)

        return int(actual_rotation_speed)
Exemplo n.º 5
0
    def unready_turbo(self):
        """Unreadies the turbo. Does not cause the turbo to spin up.
        Returns
        -------
        bool
            True for successful, False for failure.
        """

        send_control_command(self.ser, self.turbo_address, 10, "000000")

        addr, rw, param_num, turbo_response = read_gauge_response(self.ser)

        if turbo_response not in PFEIFFER_BOOL:
            raise ValueError(
                f"Unrecognized response from turbo: {turbo_response}")
        else:
            return turbo_response == "111111"
Exemplo n.º 6
0
    def turn_turbo_motor_off(self):
        """Turns the turbo motor off.

        Returns
        -------
        bool
            True for successful, False for failure.
        """

        send_control_command(self.ser, self.turbo_address, 23, "000000")

        addr, rw, param_num, turbo_response = read_gauge_response(self.ser)

        if turbo_response not in PFEIFFER_BOOL:
            raise ValueError(
                f"Unrecognized response from turbo: {turbo_response}")
        else:
            return turbo_response == "111111"
Exemplo n.º 7
0
    def acknowledge_turbo_errors(self):
        """Acknowledges the turbo errors. This is analagous to clearing the errors.
        If the errors were fixed, the turbo will be able to be turned back on.

        Returns
        -------
        bool
            True for successful, False for failure.
        """

        send_control_command(self.ser, self.turbo_address, 9, "111111")

        addr, rw, param_num, turbo_response = read_gauge_response(self.ser)

        if turbo_response not in PFEIFFER_BOOL:
            raise ValueError(
                f"Unrecognized response from turbo: {turbo_response}")
        else:
            return turbo_response == "111111"
Exemplo n.º 8
0
    def turn_turbo_motor_on(self):
        """Turns the turbo motor on. The turbo must be readied before the motor will turn on.
        This is what causes the turbo to actually spin up.

        Returns
        -------
        bool
            True for successful, False for failure.
        """

        send_control_command(self.ser, self.turbo_address, 23, "111111")

        addr, rw, param_num, turbo_response = read_gauge_response(self.ser)

        if turbo_response not in PFEIFFER_BOOL:
            raise ValueError(
                f"Unrecognized response from turbo: {turbo_response}")
        else:
            return turbo_response == "111111"