def __init__(self, **kwargs): kwargs['manager'] = kwargs.pop('pool') kwargs['elem_type'] = ElementType.ControllerClass SardanaClass.__init__(self, **kwargs) self.types = [] self.dict_extra = {} self.api_version = 1 klass = self.klass # Generic controller information self.ctrl_features = tuple(klass.ctrl_features) self.ctrl_properties = props = CaselessDict() for k, v in klass.class_prop.items(): # old member props[k] = DataInfo.toDataInfo(k, v) for k, v in klass.ctrl_properties.items(): props[k] = DataInfo.toDataInfo(k, v) self.ctrl_attributes = ctrl_attrs = CaselessDict() for k, v in klass.ctrl_attributes.items(): ctrl_attrs[k] = DataInfo.toDataInfo(k, v) self.axis_attributes = axis_attrs = CaselessDict() for k, v in klass.ctrl_extra_attributes.items(): # old member axis_attrs[k] = DataInfo.toDataInfo(k, v) for k, v in klass.axis_attributes.items(): axis_attrs[k] = DataInfo.toDataInfo(k, v) self.types = types = self.__build_types() self.type_names = map(ElementType.whatis, types) if ElementType.PseudoMotor in types: self.motor_roles = tuple(klass.motor_roles) self.pseudo_motor_roles = tuple(klass.pseudo_motor_roles) if len(self.pseudo_motor_roles) == 0: self.pseudo_motor_roles = (klass.__name__,) self.dict_extra['motor_roles'] = self.motor_roles self.dict_extra['pseudo_motor_roles'] = self.pseudo_motor_roles if ElementType.PseudoCounter in types: self.counter_roles = tuple(klass.counter_roles) self.pseudo_counter_roles = tuple(klass.pseudo_counter_roles) if len(self.pseudo_counter_roles) == 0: self.pseudo_counter_roles = (klass.__name__,) self.dict_extra['counter_roles'] = self.counter_roles self.dict_extra['pseudo_counter_roles'] = self.pseudo_counter_roles if ElementType.IORegister in types: self.dict_extra['predefined_values'] = klass.predefined_values init_args = inspect.getargspec(klass.__init__) if init_args.varargs is None or init_args.keywords is None: self.api_version = 0
def __init__(self, **kwargs): kwargs['manager'] = kwargs.pop('macro_server') kwargs['elem_type'] = ElementType.MacroClass SardanaClass.__init__(self, **kwargs) Parameterizable.__init__(self)
def __init__(self, **kwargs): kwargs['manager'] = kwargs.pop('macro_server') kwargs['elem_type'] = ElementType.RecorderClass SardanaClass.__init__(self, **kwargs)
def __init__(self, **kwargs): kwargs['manager'] = kwargs.pop('pool') kwargs['elem_type'] = ElementType.ControllerClass SardanaClass.__init__(self, **kwargs) self.types = [] self.dict_extra = {} self.api_version = 1 klass = self.klass # Generic controller information self.ctrl_features = tuple(klass.ctrl_features) self.ctrl_properties = props = CaselessDict() self.ctrl_properties_descriptions = [] dep_msg = ("Defining the controller property description using a " + "string is deprecated, use " + "sardana.pool.controller.Description constant instead.") for k, v in klass.class_prop.items(): # old member props[k] = DataInfo.toDataInfo(k, v) try: self.ctrl_properties_descriptions.append(v[Description]) except KeyError: self.warning(dep_msg) self.ctrl_properties_descriptions.append(v['Description']) for k, v in klass.ctrl_properties.items(): props[k] = DataInfo.toDataInfo(k, v) try: self.ctrl_properties_descriptions.append(v[Description]) except KeyError: self.warning(dep_msg) self.ctrl_properties_descriptions.append(v['Description']) self.dict_extra['properties'] = tuple(klass.ctrl_properties) self.dict_extra['properties_desc'] = self.ctrl_properties_descriptions self.ctrl_attributes = ctrl_attrs = CaselessDict() for k, v in klass.ctrl_attributes.items(): ctrl_attrs[k] = DataInfo.toDataInfo(k, v) self.axis_attributes = axis_attrs = CaselessDict() for k, v in klass.ctrl_extra_attributes.items(): # old member axis_attrs[k] = DataInfo.toDataInfo(k, v) for k, v in klass.axis_attributes.items(): axis_attrs[k] = DataInfo.toDataInfo(k, v) self.types = types = self.__build_types() self.type_names = map(ElementType.whatis, types) if ElementType.PseudoMotor in types: self.motor_roles = tuple(klass.motor_roles) self.pseudo_motor_roles = tuple(klass.pseudo_motor_roles) if len(self.pseudo_motor_roles) == 0: self.pseudo_motor_roles = (klass.__name__, ) self.dict_extra['motor_roles'] = self.motor_roles self.dict_extra['pseudo_motor_roles'] = self.pseudo_motor_roles if ElementType.PseudoCounter in types: self.counter_roles = tuple(klass.counter_roles) self.pseudo_counter_roles = tuple(klass.pseudo_counter_roles) if len(self.pseudo_counter_roles) == 0: self.pseudo_counter_roles = (klass.__name__, ) self.dict_extra['counter_roles'] = self.counter_roles self.dict_extra['pseudo_counter_roles'] = self.pseudo_counter_roles if ElementType.IORegister in types: self.dict_extra['predefined_values'] = klass.predefined_values init_args = inspect.getargspec(klass.__init__) if init_args.varargs is None or init_args.keywords is None: self.api_version = 0
def __init__(self, **kwargs): kwargs['manager'] = kwargs.pop('pool') kwargs['elem_type'] = ElementType.ControllerClass SardanaClass.__init__(self, **kwargs) self.types = [] self.dict_extra = {} self.api_version = 1 klass = self.klass # Generic controller information self.ctrl_features = tuple(klass.ctrl_features) self.ctrl_properties = props = CaselessDict() self.ctrl_properties_descriptions = [] dep_msg = ("Defining the controller property description using a " + "string is deprecated, use " + "sardana.pool.controller.Description constant instead.") for k, v in klass.class_prop.items(): # old member props[k] = DataInfo.toDataInfo(k, v) if Description in v: self.ctrl_properties_descriptions.append(v[Description]) elif 'Description' in v: self.warning(dep_msg) self.ctrl_properties_descriptions.append(v['Description']) for k, v in klass.ctrl_properties.items(): props[k] = DataInfo.toDataInfo(k, v) if Description in v: self.ctrl_properties_descriptions.append(v[Description]) elif 'Description' in v: self.warning(dep_msg) self.ctrl_properties_descriptions.append(v['Description']) self.dict_extra['properties'] = tuple(klass.ctrl_properties) self.dict_extra['properties_desc'] = self.ctrl_properties_descriptions self.ctrl_attributes = ctrl_attrs = CaselessDict() for k, v in klass.ctrl_attributes.items(): ctrl_attrs[k] = DataInfo.toDataInfo(k, v) self.axis_attributes = axis_attrs = CaselessDict() for k, v in klass.ctrl_extra_attributes.items(): # old member axis_attrs[k] = DataInfo.toDataInfo(k, v) for k, v in klass.axis_attributes.items(): axis_attrs[k] = DataInfo.toDataInfo(k, v) self.types = types = self.__build_types() self.type_names = map(ElementType.whatis, types) if ElementType.PseudoMotor in types: self.motor_roles = tuple(klass.motor_roles) self.pseudo_motor_roles = tuple(klass.pseudo_motor_roles) if len(self.pseudo_motor_roles) == 0: self.pseudo_motor_roles = (klass.__name__,) self.dict_extra['motor_roles'] = self.motor_roles self.dict_extra['pseudo_motor_roles'] = self.pseudo_motor_roles if ElementType.PseudoCounter in types: self.counter_roles = tuple(klass.counter_roles) self.pseudo_counter_roles = tuple(klass.pseudo_counter_roles) if len(self.pseudo_counter_roles) == 0: self.pseudo_counter_roles = (klass.__name__,) self.dict_extra['counter_roles'] = self.counter_roles self.dict_extra['pseudo_counter_roles'] = self.pseudo_counter_roles if ElementType.IORegister in types: self.dict_extra['predefined_values'] = klass.predefined_values init_args = inspect.getargspec(klass.__init__) if init_args.varargs is None or init_args.keywords is None: self.api_version = 0
def __init__(self, **kwargs): kwargs["manager"] = kwargs.pop("macro_server") kwargs["elem_type"] = ElementType.MacroClass SardanaClass.__init__(self, **kwargs) Parameterizable.__init__(self)