poolmotor

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

Classes

PoolMotor

Inheritance diagram of PoolMotor
class PoolMotor(**kwargs)[source]

Bases: PoolElement

An internal Motor object. NOT part of the official API. Accessing this object from a controller plug-in may lead to undetermined behavior like infinite recursion.

on_change(evt_src, evt_type, evt_value)[source]
calculate_state_info(state_info=None)[source]

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 – given status information [default: None, meaning use current state status.

Returns:

a transformed state information

inspect_limit_switches()[source]

returns the current (cached value of the limit switches

Returns:

the current limit switches flags

get_limit_switches(cache=True, propagate=1)[source]

Returns the motor limit switches state.

Parameters:
  • cache (bool) – if True (default) return value in cache, otherwise read value from hardware

  • propagate (int) – 0 for not propagating, 1 to propagate, 2 propagate with priority

Return type:

SardanaAttribute

Returns:

the motor limit switches state

set_limit_switches(ls, propagate=1)[source]
put_limit_switches(ls, propagate=1)[source]
property limit_switches: SardanaAttribute

motor limit switches

has_instability_time(cache=True)[source]
get_instability_time(cache=True)[source]
set_instability_time(instability_time, propagate=1)[source]
property instability_time

motor instability time

has_backlash(cache=True)[source]
is_backlash_positive(cache=True)[source]
is_backlash_negative(cache=True)[source]
get_backlash(cache=True)[source]
set_backlash(backlash, propagate=1)[source]
property backlash

motor backlash

get_offset_attribute()[source]
get_offset(cache=True)[source]
set_offset(offset, propagate=1)[source]
property offset

motor offset

get_sign_attribute()[source]
get_sign(cache=True)[source]
set_sign(sign, propagate=1)[source]
property sign

motor sign

get_step_per_unit(cache=True, propagate=1)[source]
set_step_per_unit(step_per_unit, propagate=1)[source]
read_step_per_unit()[source]
property step_per_unit

motor steps per unit

get_acceleration(cache=True, propagate=1)[source]
set_acceleration(acceleration, propagate=1)[source]
read_acceleration()[source]
property acceleration

motor acceleration

get_deceleration(cache=True, propagate=1)[source]
set_deceleration(deceleration, propagate=1)[source]
read_deceleration()[source]
property deceleration

motor deceleration

get_base_rate(cache=True, propagate=1)[source]
set_base_rate(base_rate, propagate=1)[source]
read_base_rate()[source]
property base_rate

motor base rate

get_velocity(cache=True, propagate=1)[source]
set_velocity(velocity, propagate=1)[source]
read_velocity()[source]
property velocity

motor velocity

define_position(position)[source]
get_position_attribute()[source]

Returns the position attribute object for this motor

Return type:

SardanaAttribute

Returns:

the position attribute

get_position(cache=True, propagate=1)[source]

Returns the user position.

Parameters:
  • cache (bool) – if True (default) return value in cache, otherwise read value from hardware

  • propagate (int) – 0 for not propagating, 1 to propagate, 2 propagate with priority

Return type:

SardanaAttribute

Returns:

the user position

set_position(position)[source]

Moves the motor to the specified user position

Parameters:

position (float) – the user position to move to

Return type:

None

set_write_position(w_position, timestamp=None, propagate=1)[source]

Sets a new write value for the user position.

Parameters:
  • w_position (float) – the new write value for user position

  • propagate (int) – 0 for not propagating, 1 to propagate, 2 propagate with priority

Return type:

None

read_dial_position()[source]

Reads the dial position from hardware.

Return type:

SardanaValue

Returns:

a SardanaValue containing the dial position

put_dial_position(dial_position_value, propagate=1)[source]

Sets a new dial position.

Parameters:
  • dial_position_value (SardanaValue) – the new dial position value

  • propagate (int) – 0 for not propagating, 1 to propagate, 2 propagate with priority

Return type:

DialPosition

get_dial_position_attribute()[source]

Returns the dial position attribute object for this motor

Return type:

SardanaAttribute

Returns:

the dial position attribute

get_dial_position(cache=True, propagate=1)[source]

Returns the dial position.

Parameters:
  • cache (bool) – if True (default) return value in cache, otherwise read value from hardware

  • propagate (int) – 0 for not propagating, 1 to propagate, 2 propagate with priority

Return type:

SardanaAttribute

Returns:

the dial position

property position: SardanaAttribute

motor user position

property dial_position: SardanaAttribute

motor dial position

get_default_attribute()[source]
get_motion()[source]
property motion

motion object

calculate_motion(new_position, items=None, calculated=None)[source]

Calculate the motor position, dial position, backlash for the given final position. Items specifies the where to put the calculated values, calculated is not used by physical motors

start_move(new_position)[source]