Example #1
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
Example #2
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
Example #3
0
    def get_dynamic_attributes(self):
        cache_built = hasattr(self, "_dynamic_attributes_cache")

        std_attrs, dyn_attrs = \
            PoolElementDevice.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
Example #4
0
    def get_dynamic_attributes(self):
        cache_built = hasattr(self, "_dynamic_attributes_cache")

        std_attrs, dyn_attrs = \
            PoolElementDevice.get_dynamic_attributes(self)

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

        std_attrs, dyn_attrs = \
            PoolElementDevice.get_dynamic_attributes(self)

        if not cache_built:
            # For value attribute, listen to what the controller says for data
            # type (between long, float or bool)
            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
Example #6
0
    def get_dynamic_attributes(self):
        cache_built = hasattr(self, "_dynamic_attributes_cache")

        std_attrs, dyn_attrs = \
            PoolTimerableDevice.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 length
            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
                shape = attr_info.maxdimsize
                data_info[0][3] = shape[0]
        return std_attrs, dyn_attrs
Example #7
0
    def get_dynamic_attributes(self):
        cache_built = hasattr(self, "_dynamic_attributes_cache")

        std_attrs, dyn_attrs = \
            PoolTimerableDevice.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 length
            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
                shape = attr_info.maxdimsize
                data_info[0][3] = shape[0]
                data_info[0][4] = shape[1]
        return std_attrs, dyn_attrs
Example #8
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
Example #9
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
Example #10
0
            return False
        return True

    def read_DataSource(self, attr):
        data_source = self.twod.get_data_source()
        if data_source is None:
            data_source = "tango://{0}/value".format(self.get_full_name())
        attr.set_value(data_source)

    def Start(self):
        self.twod.start_acquisition()


_DFT_VALUE_INFO = TwoDController.standard_axis_attributes['Value']
_DFT_VALUE_MAX_SHAPE = _DFT_VALUE_INFO[MaxDimSize]
_DFT_VALUE_TYPE, _DFT_VALUE_FORMAT = to_tango_type_format(_DFT_VALUE_INFO[Type], DataFormat.TwoD)

class TwoDExpChannelClass(PoolElementDeviceClass):

    #    Class Properties
    class_property_list = {
    }

    #    Device Properties
    device_property_list = {
    }
    device_property_list.update(PoolElementDeviceClass.device_property_list)

    #    Command definitions
    cmd_list = {
        'Start' :   [ [DevVoid, ""], [DevVoid, ""] ],
Example #11
0
    def write_AccumulationType(self, attr):
        self.zerod.set_accumulation_type(attr.get_write_value())

    def _is_allowed(self, req_type):
        return PoolExpChannelDevice._is_allowed(self, req_type)

    is_Value_allowed = _is_allowed
    is_CurrentValue_allowed = _is_allowed
    is_AccumulationType_allowed = _is_allowed
    is_ValueBuffer_allowed = _is_allowed
    is_AccumulationBuffer_allowed = _is_allowed
    is_TimeBuffer_allowed = _is_allowed


_DFT_VALUE_INFO = ZeroDController.standard_axis_attributes['Value']
_DFT_VALUE_TYPE, _DFT_VALUE_FORMAT = to_tango_type_format(
    _DFT_VALUE_INFO[Type], DataFormat.Scalar)


class ZeroDExpChannelClass(PoolExpChannelDeviceClass):

    #    Class Properties
    class_property_list = {}

    #    Device Properties
    device_property_list = {}
    device_property_list.update(PoolExpChannelDeviceClass.device_property_list)

    #    Command definitions
    cmd_list = {
        'Start': [[DevVoid, ""], [DevVoid, ""]],
    }