mxcubecore.HardwareObjects.abstract.AbstractNState#

AbstractNState class - interface for N state devices. Defines BaseValueEnum, initialise_values and value_to_enum methds. Implements validate_value, set/update limits.

Classes

AbstractNState(name)

Abstract base class for N state objects.

BaseValueEnum(value)

Defines only the compulsory unknown.

class mxcubecore.HardwareObjects.abstract.AbstractNState.AbstractNState(name)[source]#

Bases: AbstractActuator

Abstract base class for N state objects.

VALUES#

alias of BaseValueEnum

init()[source]#

Initilise the predefined values

initialise_values()[source]#

Initialise the ValueEnum with the values from the config.

re_emit_values()[source]#

Update values for all internal attributes

set_limits(limits)[source]#

Set the low and high limits. :param limits: two element (low limit, high limit) tuple. :type limits: tuple

Raises:

NotImplementedError

update_limits(limits=None)[source]#

Check if the limits have changed. :param limits: two elements (low limit, high limit) tuple. :type limits: tuple

Raises:

NotImplementedError

validate_value(value)[source]#

Check if the value is one of the predefined values. :param value: value to check :type value: Enum

Returns:

True if within the values.

Return type:

(bool)

value_to_enum(value, idx=0)[source]#

Tranform a value to Enum :param value: value :type value: str, int, float, tuple :param idx: Index in the value, if tuple :type idx: int

Returns:

Enum member, corresponding to the value or UNKNOWN.

Return type:

(Enum)

class mxcubecore.HardwareObjects.abstract.AbstractNState.BaseValueEnum(value)[source]#

Bases: Enum

Defines only the compulsory unknown.