Skip to content

KAR-455 Added the DS achievedPointing attribute to be monitored

This adds the DS achievedPointing attribute to the list of monitored attributes by the component manager.The value from this monitored attribute is used to update the achievedPointing attribute on the DishManager. This is a workaround to not using Tango forwarded attributes.

Attrbutes of array types usually return the values as numpy arrays, which the _update_component_state method in the ska-tango-base doesn't handle when checking for state changes. It raises this error,

device-server 1|2022-09-20T13:53:04.556Z|ERROR|ThreadPoolExecutor-1_1|_update_state_from_event|tango_device_cm.py#199|tango-device:mid_d0001/elt/master|Error updating co │
│ device-server Traceback (most recent call last):                                                                                                                          │
│ device-server   File "/app/src/ska_mid_dish_manager/component_managers/tango_device_cm.py", line 196, in _update_state_from_event                                         │
│ device-server     self._update_component_state(**{attr_name: value})
│ device-server   File "/app/src/ska_mid_dish_manager/component_managers/ds_cm.py", line 63, in _update_component_state                                                     │
│ device-server     super()._update_component_state(**kwargs)
│ device-server   File "/usr/local/lib/python3.7/dist-packages/ska_tango_base/base/component_manager.py", line 254, in _update_component_state                              │
│ device-server     if self._component_state[state] != kwargs[state]:                                                                                                       │
│ device-server ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

So to work around this we convert the numpy array to a list.

Signed-off-by: Katleho Madisa katleho.madisa47@gmail.com

Edited by Katleho Madisa

Merge request reports