mxcubeweb.core.adapter.adapter_base#

Classes

ActuatorAdapterBase(ho, *args)

AdapterBase(ho, role, app)

Hardware Object Adapter Base class

class mxcubeweb.core.adapter.adapter_base.ActuatorAdapterBase(ho, *args)[source]#

Bases: AdapterBase

get_value()[source]#

Retrieve value from underlying hardware object. :returns: The value. :rtype: (str)

Raises:

ValueError – When value for any reason can’t be retrieved.

limits()[source]#

Read the energy limits. :returns: Two floats (min, max). :rtype: (tuple)

Raises:

ValueError – When limits for any reason can’t be retrieved.

set_value(value)[source]#

Sets a value on underlying hardware object. :param value: Value to be set. :type value: float

Returns:

The actual value, after being set.

Return type:

(str)

Raises:
  • ValueError – When conversion or treatment of value fails.

  • StopIteration – When a value change was interrupted (abort/cancel).

stop()[source]#

Stop an action/movement.

value_change(*args, **kwargs)[source]#

Signal handler to be used for sending values to the client via socketIO.

class mxcubeweb.core.adapter.adapter_base.AdapterBase(ho, role, app)[source]#

Bases: object

Hardware Object Adapter Base class

property adapter_type#

Returns: (str): The data type of the value

available()[source]#

Check if the hardware object is considered to be available/online/enabled :returns: True if available. :rtype: (bool)

emit_ho_changed(state, **kwargs)[source]#

Signal handler to be used for sending the entire object to the client via socketIO

property ho#

Underlaying HardwareObject :returns: HardwareObject :rtype: (object)

msg()[source]#

Returns a message describing the current state. should be used to communicate details of the state to the user. :returns: The message string. :rtype: (str)

read_only()[source]#

Returns true if the hardware object is read only, set_value can not be called :returns: True if read enly. :rtype: (bool)

state()[source]#

Retrieves the state of the underlying hardware object and converts it to a str that can be used by the javascript front end. :returns: The state :rtype: (str)

state_change(state, **kwargs)[source]#

Signal handler to be used for sending the state to the client via socketIO