Table Of Contents

Previous topic

pooldefs

Next topic

poolexception

This Page

poolelement

This module is part of the Python Pool library. It defines the base classes for

Classes

PoolBaseElement

Inheritance diagram of PoolBaseElement

class PoolBaseElement(**kwargs)

Bases: sardana.pool.poolobject.PoolObject

A Pool object that besides the name, reference to the pool, ID, full_name and user_full_name has:

  • _simulation_mode : boolean telling if in simulation mode
  • _state : element state
  • _status : element status
lock(blocking=True)

Acquires the this element lock

Parameters:blocking (bool) – whether or not to block if lock is already acquired [default: True]
unlock()
get_action_cache()

Returns the internal action cache object

serialize(*args, **kwargs)
get_simulation_mode(cache=True, propagate=1)

Returns the simulation mode for this object.

Parameters:
  • cache (bool) – not used [default: True]
  • propagate (int) – [default: 1]
Returns:

the current simulation mode

Return type:

bool

set_simulation_mode(simulation_mode, propagate=1)
put_simulation_mode(simulation_mode)
simulation_mode

element simulation mode

get_state(cache=True, propagate=1)

Returns the state for this object. If cache is True (default) it returns the current state stored in cache (it will force an update if cache is empty). If propagate > 0 and if the state changed since last read, it will propagate the state event to all listeners.

Parameters:
  • cache (bool) – tells if return value from local cache or update from HW read [default: True]
  • propagate (int) – if > 0 propagates the event in case it changed since last HW read. Values bigger that mean the event if sent should be a priority event [default: 1]
Returns:

the current object state

Return type:

sardana.State

inspect_state()

Looks at the current cached value of state

Returns:the current object state
Return type:sardana.State
set_state(state, propagate=1)
put_state(state)
state

element state

inspect_status()

Looks at the current cached value of status

Returns:the current object status
Return type:str
get_status(cache=True, propagate=1)

Returns the status for this object. If cache is True (default) it returns the current status stored in cache (it will force an update if cache is empty). If propagate > 0 and if the status changed since last read, it will propagate the status event to all listeners.

Parameters:
  • cache (bool) – tells if return value from local cache or update from HW read [default: True]
  • propagate (int) – if > 0 propagates the event in case it changed since last HW read. Values bigger that mean the event if sent should be a priority event [default: 1]
Returns:

the current object status

Return type:

str

set_status(status, propagate=1)
put_status(status)
status

element status

calculate_state_info(status_info=None)

Transforms the given state information. This specific base implementation transforms the given state,status tuple into a state, new_status tuple where new_status is “self.name is state plus the given status. It is assumed that the given status comes directly from the controller status information.

Parameters:status_info (tuple<State, str>) – given status information [default: None, meaning use current state status.
Returns:a transformed state information
Return type:tuple<State, str>
set_state_info(state_info, propagate=1)
read_state_info()
put_state_info(state_info)
get_default_attribute()
get_default_acquisition_channel()
stop()
was_stopped()
abort()
was_aborted()
was_interrupted()

Tells if action ended by an abort or stop

is_action_running()

Determines if the element action is running or not.

is_in_operation()

Returns True if this element is involved in any operation

is_in_local_operation()
get_operation()
set_operation(operation)
clear_operation()

PoolElement

Inheritance diagram of PoolElement

class PoolElement(**kwargs)[source]

Bases: sardana.pool.poolbaseelement.PoolBaseElement

A Pool element is an Pool object which is controlled by a controller. Therefore it contains a _ctrl_id and a _axis (the id of the element in the controller).

serialize(*args, **kwargs)[source]
get_parent()[source]
get_controller()[source]
get_controller_id()[source]
get_axis()[source]
set_action_cache(action_cache)[source]
get_source()[source]
get_instrument()[source]
set_instrument(instrument, propagate=1)[source]
stop()[source]
abort()[source]
get_par(name)[source]
set_par(name, value)[source]
get_extra_par(name)[source]
set_extra_par(name, value)[source]
axis

element axis

controller

element controller

controller_id

element controller id

instrument

element instrument