Skip to content

pressure_control

Generic Pressure control class.

PressureControl

Thin adapter exposing a uniform pressure-control interface over a backend controller.

Source code in src/fluid_control/pressure_control.py
class PressureControl:
    """Thin adapter exposing a uniform pressure-control interface over a backend controller."""

    def __init__(self, controller):
        """
        Store the backing controller.

        Args:
            controller: Backend pressure-control device exposing ``set_veab`` and ``get_veab``.

        """
        self.controller = controller

    def set_output_pressure(self, pressure: int):
        """
        Set the output pressure on the backing controller.

        Args:
            pressure (int): Target output pressure in mbar.

        """
        self.controller.set_veab(pressure)

    def get_output_pressure(self):
        """
        Return the current output pressure from the backing controller.

        Returns:
            The controller's current output pressure reading.

        """
        return self.controller.get_veab()

    def get_status(self):
        """
        Return the controller status.

        Raises:
            NotImplementedError: Status reporting is not yet implemented for this generic adapter.

        """
        raise NotImplementedError("PressureControl.get_status is not implemented for the generic adapter")

__init__(controller)

Store the backing controller.

Parameters:

Name Type Description Default
controller

Backend pressure-control device exposing set_veab and get_veab.

required
Source code in src/fluid_control/pressure_control.py
def __init__(self, controller):
    """
    Store the backing controller.

    Args:
        controller: Backend pressure-control device exposing ``set_veab`` and ``get_veab``.

    """
    self.controller = controller

get_output_pressure()

Return the current output pressure from the backing controller.

Returns:

Type Description

The controller's current output pressure reading.

Source code in src/fluid_control/pressure_control.py
def get_output_pressure(self):
    """
    Return the current output pressure from the backing controller.

    Returns:
        The controller's current output pressure reading.

    """
    return self.controller.get_veab()

get_status()

Return the controller status.

Raises:

Type Description
NotImplementedError

Status reporting is not yet implemented for this generic adapter.

Source code in src/fluid_control/pressure_control.py
def get_status(self):
    """
    Return the controller status.

    Raises:
        NotImplementedError: Status reporting is not yet implemented for this generic adapter.

    """
    raise NotImplementedError("PressureControl.get_status is not implemented for the generic adapter")

set_output_pressure(pressure)

Set the output pressure on the backing controller.

Parameters:

Name Type Description Default
pressure int

Target output pressure in mbar.

required
Source code in src/fluid_control/pressure_control.py
def set_output_pressure(self, pressure: int):
    """
    Set the output pressure on the backing controller.

    Args:
        pressure (int): Target output pressure in mbar.

    """
    self.controller.set_veab(pressure)