Ejemplo n.º 1
0
    def init_device(self):
        SKACapability.init_device(self)
        # PROTECTED REGION ID(Fsp.init_device) ENABLED START #
        """Inherit from SKA Capability; Initialize attributes. Set state to OFF."""
        self.set_state(tango.DevState.INIT)

        # defines self._proxy_correlation, self._proxy_pss, self._proxy_pst, self._proxy_vlbi,
        # and self._proxy_fsp_corr_subarray
        self.__get_capability_proxies()

        self._fsp_id = self.FspID

        # initialize attribute values
        self._function_mode = 0  # IDLE
        self._subarray_membership = []
        self._scan_id = 0
        self._config_id = ""
        self._jones_matrix = [[0.0] * 4 for _ in range(4)]
        self._delay_model = [[0.0] * 6 for _ in range(4)]
        self._timing_beam_weights = [[0.0] * 6 for _ in range(4)]

        # initialize FSP subarray group
        self._group_fsp_corr_subarray = tango.Group("FSP Subarray Corr")
        for fqdn in list(self.FspCorrSubarray):
            self._group_fsp_corr_subarray.add(fqdn)

        self._group_fsp_pss_subarray = tango.Group("FSP Subarray Pss")
        for fqdn in list(self.FspPssSubarray):
            self._group_fsp_pss_subarray.add(fqdn)

        self._group_fsp_pst_subarray = tango.Group("FSP Subarray Pst")
        for fqdn in list(self.FspPstSubarray):
            self._group_fsp_pst_subarray.add(fqdn)

        self.set_state(tango.DevState.OFF)
Ejemplo n.º 2
0
 def init_device(self):
     SKABaseDevice.init_device(self)
     # PROTECTED REGION ID(SKAPowerSupplyGroup.init_device) ENABLED START #
     self.tg = tango.Group('power supplies')
     self.setpoints = [0.0]
     # name of the group for the Power Supplies
     self.tg.add(self.PowerSupplyGroup)
Ejemplo n.º 3
0
def _build_group(definition):
    """Returns tango.Group object according to defined hierarchy.

    Used internally by `get_groups_from_json`.

    """
    group_name = definition['group_name']
    devices = definition.get('devices', [])
    subgroups = definition.get('subgroups', [])

    group = tango.Group(group_name)
    for device_name in devices:
        group.add(device_name)
    for subgroup_definition in subgroups:
        subgroup = _build_group(subgroup_definition)  # recurse
        group.add(subgroup)

    return group
Ejemplo n.º 4
0
import tango
import time
import traceback

tg = tango.Group('power supplies')
tg.add('ska/ps/*')
devs = tg.get_device_list()
buffer = []
eis = {}

proxies = dict((d, tango.DeviceProxy(d)) for d in devs)


def callback(event):
    try:
        print(time.time(), event.attr_name, event.err
              or event.attr_value.value)
        buffer.append((time.time(), event.attr_name,
                       event if event.err else event.attr_value.value))
    except:
        traceback.print_exc()


def read_attributes():
    r = tg.read_attributes(('State', 'Current', 'Voltage'))
    vs = []
    for rr in r:
        vs.append((rr.dev_name(), rr.has_failed()
                   or (rr.get_data().name, rr.get_data().value)))
    return vs