Exemplo n.º 1
0
    def init_device(self):
        PoolExpChannelDevice.init_device(self)
        zerod = self.zerod
        if zerod is None:
            full_name = self.get_full_name()
            name = self.alias or full_name
            self.zerod = zerod = \
                self.pool.create_element(type="ZeroDExpChannel", name=name,
                                         full_name=full_name, id=self.Id, axis=self.Axis,
                                         ctrl_id=self.Ctrl_id)
        zerod.add_listener(self.on_zerod_changed)

        # force a state read to initialize the state attribute
        #state = zerod.state
        self.set_state(DevState.ON)
Exemplo n.º 2
0
    def init_device(self):
        PoolExpChannelDevice.init_device(self)
        zerod = self.zerod
        if zerod is None:
            full_name = self.get_full_name()
            name = self.alias or full_name
            self.zerod = zerod = \
                self.pool.create_element(type="ZeroDExpChannel", name=name,
                                         full_name=full_name, id=self.Id, axis=self.Axis,
                                         ctrl_id=self.Ctrl_id)
        zerod.add_listener(self.on_zerod_changed)

        # force a state read to initialize the state attribute
        #state = zerod.state
        self.set_state(DevState.ON)
Exemplo n.º 3
0
    def get_dynamic_attributes(self):
        cache_built = hasattr(self, "_dynamic_attributes_cache")

        std_attrs, dyn_attrs = \
            PoolExpChannelDevice.get_dynamic_attributes(self)

        if not cache_built:
            # For value attribute, listen to what the controller says for data
            # type (between long and float) and data format (scalar, spectrum
            # or image)
            value = std_attrs.get('value')
            if value is not None:
                _, data_info, attr_info = value
                ttype, tformat = to_tango_type_format(attr_info.dtype,
                                                      attr_info.dformat)
                data_info[0][0] = ttype
                data_info[0][1] = tformat
                if tformat == SPECTRUM:
                    shape = attr_info.maxdimsize
                    data_info[0].append(shape[0])
                elif tformat == IMAGE:
                    shape = attr_info.maxdimsize
                    data_info[0].append(shape[0])
                    data_info[0].append(shape[1])
        return std_attrs, dyn_attrs
Exemplo n.º 4
0
    def get_dynamic_attributes(self):
        cache_built = hasattr(self, "_dynamic_attributes_cache")

        std_attrs, dyn_attrs = \
            PoolExpChannelDevice.get_dynamic_attributes(self)

        if not cache_built:
            # For value attribute, listen to what the controller says for data
            # type (between long and float) and data format (scalar, spectrum
            # or image)
            value = std_attrs.get('value')
            if value is not None:
                _, data_info, attr_info = value
                ttype, tformat = to_tango_type_format(attr_info.dtype,
                                                      attr_info.dformat)
                data_info[0][0] = ttype
                data_info[0][1] = tformat
                if tformat == SPECTRUM:
                    shape = attr_info.maxdimsize
                    data_info[0].append(shape[0])
                elif tformat == IMAGE:
                    shape = attr_info.maxdimsize
                    data_info[0].append(shape[0])
                    data_info[0].append(shape[1])
        return std_attrs, dyn_attrs
Exemplo n.º 5
0
    def init_device(self):
        PoolExpChannelDevice.init_device(self)
        oned = self.oned
        if oned is None:
            full_name = self.get_full_name()
            name = self.alias or full_name
            self.oned = oned = \
                self.pool.create_element(type="OneDExpChannel",
                                         name=name, full_name=full_name, id=self.Id, axis=self.Axis,
                                         ctrl_id=self.Ctrl_id)
            if self.instrument is not None:
                oned.set_instrument(self.instrument)
        oned.add_listener(self.on_oned_changed)

        # force a state read to initialize the state attribute
        #state = ct.state
        self.set_state(DevState.ON)
Exemplo n.º 6
0
    def init_device(self):
        PoolExpChannelDevice.init_device(self)

        self.Elements = map(int, self.Elements)
        pseudo_counter = self.pseudo_counter
        if pseudo_counter is None:
            full_name = self.get_full_name()
            name = self.alias or full_name
            self.pseudo_counter = pseudo_counter = \
                self.pool.create_element(type="PseudoCounter", name=name,
                                         full_name=full_name, id=self.Id, axis=self.Axis,
                                         ctrl_id=self.Ctrl_id, user_elements=self.Elements)
            if self.instrument is not None:
                pseudo_counter.set_instrument(self.instrument)
        pseudo_counter.add_listener(self.on_pseudo_counter_changed)

        self.set_state(DevState.ON)
Exemplo n.º 7
0
    def initialize_dynamic_attributes(self):
        attrs = PoolExpChannelDevice.initialize_dynamic_attributes(self)

        non_detect_evts = "data",

        for attr_name in non_detect_evts:
            if attr_name in attrs:
                self.set_change_event(attr_name, True, False)
Exemplo n.º 8
0
    def init_device(self):
        PoolExpChannelDevice.init_device(self)

        self.Elements = map(int, self.Elements)
        pseudo_counter = self.pseudo_counter
        if pseudo_counter is None:
            full_name = self.get_full_name()
            name = self.alias or full_name
            self.pseudo_counter = pseudo_counter = \
                self.pool.create_element(type="PseudoCounter", name=name,
                                         full_name=full_name, id=self.Id, axis=self.Axis,
                                         ctrl_id=self.Ctrl_id, user_elements=self.Elements)
            if self.instrument is not None:
                pseudo_counter.set_instrument(self.instrument)
        pseudo_counter.add_listener(self.on_pseudo_counter_changed)

        self.set_state(DevState.ON)
Exemplo n.º 9
0
    def initialize_dynamic_attributes(self):
        attrs = PoolExpChannelDevice.initialize_dynamic_attributes(self)

        detect_evts = "value",
        non_detect_evts = "data",

        for attr_name in detect_evts:
            if attr_name in attrs:
                self.set_change_event(attr_name, True, True)
        for attr_name in non_detect_evts:
            if attr_name in attrs:
                self.set_change_event(attr_name, True, False)
Exemplo n.º 10
0
    def get_dynamic_attributes(self):
        cache_built = hasattr(self, "_dynamic_attributes_cache")

        std_attrs, dyn_attrs = \
            PoolExpChannelDevice.get_dynamic_attributes(self)

        if not cache_built:
            # For value attribute, listen to what the controller says for data
            # type (between long and float)
            value = std_attrs.get('value')
            if value is not None:
                _, data_info, attr_info = value
                ttype, _ = to_tango_type_format(attr_info.dtype)
                data_info[0][0] = ttype
        return std_attrs, dyn_attrs
Exemplo n.º 11
0
    def get_dynamic_attributes(self):
        cache_built = hasattr(self, "_dynamic_attributes_cache")

        std_attrs, dyn_attrs = \
            PoolExpChannelDevice.get_dynamic_attributes(self)

        if not cache_built:
            # For value attribute, listen to what the controller says for data
            # type (between long and float)
            value = std_attrs.get('value')
            if value is not None:
                attr_name, data_info, attr_info = value
                ttype, _ = to_tango_type_format(attr_info.dtype)
                data_info[0][0] = ttype

                # Add manually a 'CurrentValue' with the same time as 'Value'
                attr_name = 'CurrentValue'
                attr_info = attr_info.copy()
                attr_info.description = attr_name
                std_attrs[attr_name] = [attr_name, data_info, attr_info]

        return std_attrs, dyn_attrs
Exemplo n.º 12
0
    def get_dynamic_attributes(self):
        cache_built = hasattr(self, "_dynamic_attributes_cache")

        std_attrs, dyn_attrs = \
            PoolExpChannelDevice.get_dynamic_attributes(self)

        if not cache_built:
            # For value attribute, listen to what the controller says for data
            # type (between long and float)
            value = std_attrs.get('value')
            if value is not None:
                attr_name, data_info, attr_info = value
                ttype, _ = to_tango_type_format(attr_info.dtype)
                data_info[0][0] = ttype

                # Add manually a 'CurrentValue' with the same time as 'Value'
                attr_name = 'CurrentValue'
                attr_info = attr_info.copy()
                attr_info.description = attr_name
                std_attrs[attr_name] = [attr_name, data_info, attr_info]

        return std_attrs, dyn_attrs
Exemplo n.º 13
0
 def init(self, name):
     PoolExpChannelDevice.init(self, name)
Exemplo n.º 14
0
 def delete_device(self):
     PoolExpChannelDevice.delete_device(self)
     zerod = self.zerod
     if zerod is not None:
         zerod.remove_listener(self.on_zerod_changed)
Exemplo n.º 15
0
 def init(self, name):
     PoolExpChannelDevice.init(self, name)
Exemplo n.º 16
0
 def __init__(self, dclass, name):
     PoolExpChannelDevice.__init__(self, dclass, name)
Exemplo n.º 17
0
 def _is_allowed(self, req_type):
     return PoolExpChannelDevice._is_allowed(self, req_type)
Exemplo n.º 18
0
 def delete_device(self):
     PoolExpChannelDevice.delete_device(self)
     zerod = self.zerod
     if zerod is not None:
         zerod.remove_listener(self.on_zerod_changed)
Exemplo n.º 19
0
 def delete_device(self):
     PoolExpChannelDevice.delete_device(self)
     pseudo_counter = self.pseudo_counter
     if pseudo_counter is not None:
         pseudo_counter.remove_listener(self.on_pseudo_counter_changed)
Exemplo n.º 20
0
 def __init__(self, dclass, name):
     PoolExpChannelDevice.__init__(self, dclass, name)
Exemplo n.º 21
0
 def __init__(self, dclass, name):
     PoolExpChannelDevice.__init__(self, dclass, name)
     self._first_read_cache = False
Exemplo n.º 22
0
 def _is_allowed(self, req_type):
     return PoolExpChannelDevice._is_allowed(self, req_type)
Exemplo n.º 23
0
 def delete_device(self):
     PoolExpChannelDevice.delete_device(self)
     ct = self.ct
     if ct is not None:
         ct.remove_listener(self.on_ct_changed)
Exemplo n.º 24
0
 def __init__(self, dclass, name):
     PoolExpChannelDevice.__init__(self, dclass, name)
     self._first_read_cache = False
Exemplo n.º 25
0
 def delete_device(self):
     PoolExpChannelDevice.delete_device(self)
     oned = self.oned
     if oned is not None:
         oned.remove_listener(self.on_oned_changed)
Exemplo n.º 26
0
 def delete_device(self):
     PoolExpChannelDevice.delete_device(self)
     pseudo_counter = self.pseudo_counter
     if pseudo_counter is not None:
         pseudo_counter.remove_listener(self.on_pseudo_counter_changed)