Mid.CBF Controller Component
- class ska_csp_lmc_mid.controller.mid_ctrl_component.MidCbfControllerComponent(*args: Any, **kwargs: Any)
Bases:
CbfControllerComponent
Specialize the CBF Controller Component class for the Mid.CSP LMC.
This class works as a cache and adaptor towards the real Mid device.
- __init__(fqdn: str, logger: Logger | None = None) None
Initialize the MidCbfControllerComponent.
- Parameters:
fqdn – The Mid.CBF controller TANGO Device Fully Qualified Domain Name.
logger – The device or python logger if default is None.
- property vcc_state: List[tango.DevState]
Return the operational state (State) of the VCCs organized as a list where the element index corresponds to the (vcc_id -1).
Example:
vcc_state = [ON, ON, FAULT, UNKNOWN] VCC 1 -> ON VCC 2 -> ON VCC 3 -> FAULT VCC 4 -> UNKNOWN
- Returns:
a list with the VCCs’ healthState.
- property vcc_health: List[ska_control_model.HealthState]
Return the healthState of the VCCs organized as a list where the element index corresponds to the (vcc_id -1).
Example:
vcc_health = [OK, OK, FAILED, UNKNOWN] VCC 1 -> OK VCC 2 -> OK VCC 3 -> FAILED VCC 4 -> UNKNOWN
- Returns:
a list with the VCCs’ healthState.
- property vcc_affiliation: List[int]
Return the affiliation of the VCCs to the Mid.CSP subarrays, organized as a list where.
the position of the element is the receptor_id - 1 and the value is the subarray ID owing that resource. 0 means the current resource is not assigned, yet
Example:
vcc_affiliation = [1,0,0,2] VCC 1 -> subarray 1 VCC 2 -> not assigned VCC 3 -> not assigned VCC 4 -> subarray 2
- Returns:
A list with the receptors’ affiliation to subarrays
- property vcc_to_receptor_map: Dict[str, str]
Return the map vcc-id -receptor-id for all the usable (deployed) receptors as a dictionary.
The format of the attribute is the following one:
{vcc_id: receptor_id,...} Example: vcc_to_receptor_map = {"1":"SKA002", "2":"SKA004", "3":"SKA001", "4":"SKA003" }
- Returns:
the associations between vcc_id and receptors_id organized as a dictionary.
- property vcc_to_receptor: List[str]
Return the value of the Mid.CBF Controller vccToReceptor attribute storing a list with the map of all (vcc_id:receptor_index) associations (ordered by vcc id). The receptor index is the (array index + 1) of a full list of 197 receptors. The format of the attribute is the following one:
[‘vcc_id:receptor_index’,…]
Example:
vcc_to_receptor = [‘1:2’, ‘2:1’, ‘3:3’, ‘4:75’]
- Returns:
the list with the associations (vcc_id:receptor_index) for each deployed VCC.
- property receptor_to_vcc: List[str]
Return the value of the Mid.CBF Controller receptorToVcc attribute storing a list with the map of all (receptor_id:vcc_id) associations. (ordered by receptor id). The receptor index is the (array index + 1) of a full list of 197 receptors. The format of the attribute is the following one:
['receptor_id:vcc_id',...] Example: receptor_to_vcc = ['1:2', '2:1', '3:3', '4:75']
- Returns:
the list with the associations (receptor_index:vcc_id) for each deployed VCC.
- property list_of_receptors: List[str]
Return the ordered list of all the usable (deployed) receptors IDs.
Example:
If there are only 4 VCC devices deployed: list_of_receptors = ['SKA001','SKA022','SKA103','MKT002']
- property linked_receptors: Dict[str, str]
Return information about the receptors IDs with a valid connection to the VCC. Valid receptor ids are in [SKA001,..,SKA133] and [MKT000,MKT63] range. A receptor_id = DIDINV means the link connection between the receptor and the VCC is off. NOTE: Right now, the receptor ID contains always a value, since it is the theoretical connection coming from the TM. In order to be able to check the receptor ID vs VCC link (receptor_id != “DIDINV”), it should be needed to verify the VCC capability attributes.
note:
Example: list_of_receptors = ["SKA001","SKA002","SKA003","SKA004"] vcc_state = [ON, UNKNOWN, ON, ON] vcc_to_receptor_map = {'1':"SKA002", '2':"SKA004", '3':"SKA001", '4':"SKA003" } linked_receptors = ['1':"SKA002", '3':"SKA001"]
- Returns:
the map of the valid (vcc_id, receptor_id) associations.
- property unassigned_receptors: List[str]
Return the not ordered list of availbale receptors IDs. The list includes all the receptors that are not assigned to any subarray and, from the side of CSP, are considered “full working”. This means:
a valid link connection receptor-VCC
the connected VCC healthState OK
Example:
linked_receptors = ["1":"SKA002", "3":"SKA001"] vcc_affiliation = [1, 0, 0, 3] unassigned_receptors = ["SKA001"]
- TODO: Check which is the criteria to establish when a VCC is available
(working): check the healthState (OK) and the state (ON)?
- Returns:
The list of the unassigned (available) receptors IDs on success, otherwise an empty list.
- Raise:
ValueError if an error is caught during CBF attributes reading.
- property unassigned_vcc: List[str]
Return the list of availbale VCC IDs.
- Returns:
The list of the unassigned (available) VCC IDs on success, otherwise an empty list.
- property receptors_affiliation: List[int]
Build the list reporting the receptors affiliation to subarray, if any. The element index corresponds to (receptor_id -1) and the value stored is the number of the subarray to which the receptor belongs.
Example:
vcc_affiliation = [subid=1, subid=2, ... ] vcctoReceptor_map = [vccId1:SKA035, vccId2:SKA054] receptor_list = [SKA001, SKA035,SKA054,...] receptors_affiliation = [0,1,2,0] receptors_affiliation = [1,0,0,2] receptor 1 -> subarray 1 receptor 2 -> not assigned receptor 3 -> not assigned receptor 4 -> subarray 2
- Returns:
A list with the receptors’ affiliation to subarrays
- Returns:
The receptors affiliation to subarray_state on success, otherwise an empty list.
- property dish_vcc_config: str
Return the information about mapping between DishID and VCCs.
- Returns:
The DishID-VCC mapping
- property source_dish_vcc_config: str
Return the information about mapping between DishID and VCCs.
- Returns:
The DishID-VCC mapping source
- get_vcc_receptor_map()
Build the map between VCC-id and Receptor-id and viceversa. The funciton stores them in instance attributes.
- _get_vcc_to_receptor_map()
Get VCC-id vs Receptor-index map from CBF and convert it to a dictionary.
- _get_receptor_to_vcc_map()
Get Receptor-index vs VCC-id map from CBF and convert it to a dictionary.
- connect() ska_csp_lmc_common.connector.Connector
Establish a connection with the Mid CBF Controller. On successfull connection , the VCCs/receptors mapping is retrieved.
- Returns:
An instance of the Connector class on success, otherwise None.
- loaddishcfg(resources: str, async_flag: bool = False) None
Invoke the Mid CBF Controller command to load the DishID-VCC mapping file
- loaddishcfg_completed(cmd_succeded) None
Method invoked when command On completes on the sub-system.
On command completion, the client side timeout is reset to the default value (3 sec).
- on(resources: Any | None = None, callback: Callable | None = None) None
Define the behavior of the On command for a component. Override this method as required. This method has been specialized to work with Mid CBF controller device. In the current version (0.11.0) of Mid CBF MCS, the On command on Mid CBF controllers takes more than 3 secs to be completed. This command is executed in synchronous way by the Mid CBF Controller. This causes a CORBA Timeout exception. To avoid this, the TANGO client (Mid Csp Controller) has to set the timeout on client side to a value grater than 3 secs.
- Parameters:
resources – the client side timeout value in sec.
callback – callable object invoked when command completes on the target TANGO Device.
- on_completed(result_status: bool) None
Method invoked when command On completes on the sub-system.
On command completion, the client side timeout is reset to the default value (3 sec).
- _push_event(recv_event: tango.EventData, device_attr_name=None) None
Extend the component event callback to specifie the correct attribute name in case there is a mismach between the CBF component and CPS tango device
Mid.PSS Controller Component
- class ska_csp_lmc_mid.controller.mid_ctrl_component.MidPssControllerComponent(*args: Any, **kwargs: Any)
Bases:
PssControllerComponent
Specialization of the PssController component class for the Mid.CSP.
- __init__(fqdn: str, logger: Logger | None = None) None
Initialize the MidPssControllerComponent.
- Parameters:
fqdn – The Mid.CBF controller TANGO Device Fully Qualified Domain Name.
logger – The device or python logger if default is None.
- property list_of_beams
Return the list of PSS beams IDs.