poolmetacontroller

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

Classes

DataInfo

Inheritance diagram of DataInfo
class DataInfo(name, dtype, dformat=0, access=1, description='', default_value=None, memorized='true', fget=None, fset=None, maxdimsize=None)[source]

Bases: object

copy()[source]
classmethod toDataInfo(name, info)[source]
toDict()[source]
serialize(*args, **kwargs)[source]

TypeData

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

Bases: object

Information for a specific Element type

ControllerLib

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

Bases: SardanaLibrary

Object representing a python module containning controller classes. Public members:

  • module - reference to python module

  • f_path - complete (absolute) path and filename

  • f_name - filename (including file extension)

  • path - complete (absolute) path

  • name - module name (without file extension)

  • controller_list - list<ControllerClass>

  • exc_info - exception information if an error occured when loading

    the module

add_controller(meta_class)

Adds a new :class:~`sardana.sardanameta.SardanaClass` to this library.

Parameters:

meta_class (Type[SardanaClass]) – the meta class to be added to this library

Return type:

None

get_controller(meta_class_name)

Returns a :class:~`sardana.sardanameta.SardanaClass` for the given meta class name or None if the meta class does not exist in this library.

Parameters:

meta_class_name (str) – the meta class name

Return type:

Type[SardanaClass]

Returns:

a meta class or None

get_controllers()

Returns a sequence of the meta classes that belong to this library.

Return type:

Sequence[Type[SardanaClass]]

Returns:

a sequence of meta classes that belong to this library

has_controller(meta_class_name)

Returns True if the given meta class name belongs to this library or False otherwise.

Parameters:

meta_class_name (str) – the meta class name

Return type:

bool

Returns:

True if the given meta class name belongs to this library or False otherwise

serialize(*args, **kwargs)[source]

Returns a serializable object describing this object.

Returns:

a serializable dict

property controllers

ControllerClass

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

Bases: SardanaClass

Object representing a python controller class. Public members:

  • name - class name

  • klass - python class object

  • lib - ControllerLibrary object representing the module where the controller is.

serialize(*args, **kwargs)[source]

Returns a serializable object describing this object.

Returns:

a serializable dict

property controller_class
property gender
property model
property organization

Constants

CONTROLLER_TEMPLATE = 'class @controller_name@(@controller_type@):\n    """@controller_name@ description."""\n\n'

String containing template code for a controller class

CTRL_TYPE_MAP = {2: <class 'sardana.pool.poolcontroller.PoolController'>, 3: <class 'sardana.pool.poolcontroller.PoolController'>, 5: <class 'sardana.pool.poolcontroller.PoolController'>, 6: <class 'sardana.pool.poolcontroller.PoolController'>, 8: <class 'sardana.pool.poolcontroller.PoolController'>, 9: <class 'sardana.pool.poolcontroller.PoolController'>, 10: <class 'sardana.pool.poolcontroller.PoolPseudoMotorController'>, 11: <class 'sardana.pool.poolcontroller.PoolPseudoCounterController'>}

a dictionary dict<ElementType, class> mapping element type enumeration with the corresponding controller pool class (PoolController or sub-class of it).

TYPE_MAP = {1: ('Controller', 'Controller', {2: <class 'sardana.pool.poolcontroller.PoolController'>, 3: <class 'sardana.pool.poolcontroller.PoolController'>, 5: <class 'sardana.pool.poolcontroller.PoolController'>, 6: <class 'sardana.pool.poolcontroller.PoolController'>, 8: <class 'sardana.pool.poolcontroller.PoolController'>, 9: <class 'sardana.pool.poolcontroller.PoolController'>, 10: <class 'sardana.pool.poolcontroller.PoolPseudoMotorController'>, 11: <class 'sardana.pool.poolcontroller.PoolPseudoCounterController'>}, 'controller/{klass}/{name}', <class 'sardana.pool.controller.Controller'>), 2: ('Motor', 'Motor', <class 'sardana.pool.poolmotor.PoolMotor'>, 'motor/{ctrl_name}/{axis}', <class 'sardana.pool.controller.MotorController'>), 3: ('CTExpChannel', 'ExpChannel', <class 'sardana.pool.poolcountertimer.PoolCounterTimer'>, 'expchan/{ctrl_name}/{axis}', <class 'sardana.pool.controller.CounterTimerController'>), 4: ('ZeroDExpChannel', 'ExpChannel', <class 'sardana.pool.poolzerodexpchannel.Pool0DExpChannel'>, 'expchan/{ctrl_name}/{axis}', <class 'sardana.pool.controller.ZeroDController'>), 5: ('OneDExpChannel', 'ExpChannel', <class 'sardana.pool.poolonedexpchannel.Pool1DExpChannel'>, 'expchan/{ctrl_name}/{axis}', <class 'sardana.pool.controller.OneDController'>), 6: ('TwoDExpChannel', 'ExpChannel', <class 'sardana.pool.pooltwodexpchannel.Pool2DExpChannel'>, 'expchan/{ctrl_name}/{axis}', <class 'sardana.pool.controller.TwoDController'>), 8: ('IORegister', 'IORegister', <class 'sardana.pool.poolioregister.PoolIORegister'>, 'ioregister/{ctrl_name}/{axis}', <class 'sardana.pool.controller.IORegisterController'>), 9: ('TriggerGate', 'TriggerGate', <class 'sardana.pool.pooltriggergate.PoolTriggerGate'>, 'triggergate/{ctrl_name}/{axis}', <class 'sardana.pool.controller.TriggerGateController'>), 10: ('PseudoMotor', 'Motor', <class 'sardana.pool.poolpseudomotor.PoolPseudoMotor'>, 'pm/{ctrl_name}/{axis}', <class 'sardana.pool.controller.PseudoMotorController'>), 11: ('PseudoCounter', 'ExpChannel', <class 'sardana.pool.poolpseudocounter.PoolPseudoCounter'>, 'pc/{ctrl_name}/{axis}', <class 'sardana.pool.controller.PseudoCounterController'>), 13: ('MotorGroup', 'MotorGroup', <class 'sardana.pool.poolmotorgroup.PoolMotorGroup'>, 'mg/{pool_name}/{name}', None), 14: ('MeasurementGroup', 'MeasurementGroup', <class 'sardana.pool.poolmeasurementgroup.PoolMeasurementGroup'>, 'mntgrp/{pool_name}/{name}', None), 15: ('Instrument', 'Instrument', <class 'sardana.pool.poolinstrument.PoolInstrument'>, '{full_name}', None)}

dictionary dict<ElementType, tuple> where tuple is a sequence:

  1. type string representation

  2. family

  3. internal pool class

  4. automatic full name

  5. controller class

TYPE_MAP_OBJ = {1: <sardana.pool.poolmetacontroller.TypeData object>, 2: <sardana.pool.poolmetacontroller.TypeData object>, 3: <sardana.pool.poolmetacontroller.TypeData object>, 4: <sardana.pool.poolmetacontroller.TypeData object>, 5: <sardana.pool.poolmetacontroller.TypeData object>, 6: <sardana.pool.poolmetacontroller.TypeData object>, 8: <sardana.pool.poolmetacontroller.TypeData object>, 9: <sardana.pool.poolmetacontroller.TypeData object>, 10: <sardana.pool.poolmetacontroller.TypeData object>, 11: <sardana.pool.poolmetacontroller.TypeData object>, 13: <sardana.pool.poolmetacontroller.TypeData object>, 14: <sardana.pool.poolmetacontroller.TypeData object>, 15: <sardana.pool.poolmetacontroller.TypeData object>}

dictionary dict<ElementType, TypeData>