cbf_command package
Module contents
Module containing client code for interactions with CBF devices.
- class ska_mid_cbf_int_tests.cbf_command.ControllerClient(device_fqdn: str, test_observer: TestObserver)[source]
Bases:
DeviceClientAPI Client for controlling the MCS CBF Controller. Implemented commands generally follow https://developer.skao.int/projects/ska-mid-cbf-mcs/en/latest/guide/interfaces/lmc_mcs_interface.html
- __init__(device_fqdn: str, test_observer: TestObserver)[source]
Create instance of ControllerClient.
- Parameters:
device_fqdn – FQDN of controller tango device
test_observer – TestObserver to log to and associate events with
- init_sys_param(init_sys_param_str: str)[source]
Send given init_sys_param_str to the controller.
- Parameters:
init_sys_param_str – json string containing initial system parameters for the controller. Format and info should be according to a supported schema in https://developer.skao.int/projects/ska-telmodel/en/latest/schemas/midcbf/initsysparam/index.html
- Raises:
AssertionError – error if test_observer is ASSERTING and LRC ok message is not received
- class ska_mid_cbf_int_tests.cbf_command.SubarrayClient(device_fqdn: str, test_observer: TestObserver)[source]
Bases:
DeviceClientAPI Client for controlling an MCS subarray device. Implemented commands generally follow https://developer.skao.int/projects/ska-mid-cbf-mcs/en/latest/guide/interfaces/lmc_mcs_interface.html and for success observing states should follow state machine in https://developer.skao.int/projects/ska-control-model/en/latest/obs_state.html
- __init__(device_fqdn: str, test_observer: TestObserver)[source]
Create instance of SubarrayClient.
- Parameters:
device_fqdn – FQDN of subarray tango device
test_observer – TestObserver to log to and associate events with
- abort()[source]
Aborts current stage of subarray from ObsState.IDLE/CONFIGURING/READY/SCANNING. On success, subarray should go to ObsState.ABORTED.
- Raises:
AssertionError – error if test_observer is ASSERTING and (subarray does not change to ObsState.ABORTED or LRC ok message is not received)
- assign_resources(resources_str: str)[source]
Assign resources to the subarray. On success, subarray should go to ObsState.IDLE.
- Parameters:
resources_str – json string containing receptors to add to the subarray. Format and info should be according to a supported schema in https://developer.skao.int/projects/ska-schemas/en/latest/schemas/csp/mid/assignresources/index.html
- Raises:
AssertionError – error if test_observer is ASSERTING and (subarray does not change to ObsState.IDLE or LRC ok message is not received)
- configure_scan(configure_str: str)[source]
Configure the scan of the subarray. On success, subarray should go to ObsState.READY.
- Parameters:
configure_str – json string containing configuration for subarray to configure scan towards. Format and info should be according to a supported schema in https://developer.skao.int/projects/ska-schemas/en/latest/schemas/csp/mid/configurescan/index.html
- Raises:
AssertionError – error if test_observer is ASSERTING and (subarray does not change to ObsState.READY or LRC ok message is not received)
- end_scan(end_scan_str: str)[source]
Ends the scan of the subarray. On success, subarray should go to ObsState.READY.
- Parameters:
end_scan_str – json string describing scan to end. Format and info should be according to a supported schema in https://developer.skao.int/projects/ska-schemas/en/latest/schemas/csp/mid/endscan/index.html
- Raises:
AssertionError – error if test_observer is ASSERTING and (subarray does not change to ObsState.READY or LRC ok message is not received)
- get_obsstate() ObsState[source]
Get current ObsState of subarray.
- Returns:
current ObsState of subarray.
- get_receptors() List[str][source]
Get current receptors assigned to subarray.
- Returns:
current receptors assigned to subarray.
- go_to_idle()[source]
Sends the subarray to idle. On success, subarray should go to ObsState.IDLE.
- Raises:
AssertionError – error if test_observer is ASSERTING and (subarray does not change to ObsState.IDLE or LRC ok message is not received)
- obsreset()[source]
Resets current stage of subarray from ObsState.FAULT/ABORTED keeping assigned receptors. On success, subarray should go to ObsState.IDLE.
- Raises:
AssertionError – error if test_observer is ASSERTING and (subarray does not change to ObsState.IDLE or LRC ok message is not received)
- release_all_resources()[source]
Remove all receptors from the subarray. On success, subarray should go to ObsState.EMPTY.
- Raises:
AssertionError – error if test_observer is ASSERTING and (subarray does not change to ObsState.EMPTY or LRC ok message is not received)
- release_resources(resources_str: str)[source]
Remove given receptors from the subarray. On success, subarray should go to ObsState.IDLE if not all receptors are removed or ObsState.EMPTY if all receptors are removed.
- Parameters:
resources_str – json string containing receptors to release in the subarray. Format and info should be according to a supported schema in https://developer.skao.int/projects/ska-schemas/en/latest/schemas/csp/mid/releaseresources/index.html
- Raises:
AssertionError – error if test_observer is ASSERTING and (subarray does not change to ObsState.EMPTY/IDLE or LRC ok message is not received)
- restart()[source]
Restarts current stage of subarray from ObsState.FAULT/ABORTED not keeping assigned receptors. On success, subarray should go to ObsState.EMPTY.
- Raises:
AssertionError – error if test_observer is ASSERTING and (subarray does not change to ObsState.ABORTED or LRC ok message is not received)
- scan(scan_str: str)[source]
Starts the scan of the subarray. On success, subarray should go to ObsState.SCANNING.
- Parameters:
scan_str – json string describing scan to initiate. Format and info should be according to a supported schema in https://developer.skao.int/projects/ska-schemas/en/latest/schemas/csp/mid/scan/index.html
- Raises:
AssertionError – error if test_observer is ASSERTING and (subarray does not change to ObsState.SCANNING or LRC ok message is not received)
- send_to_empty()[source]
Follows observing state machine https://developer.skao.int/projects/ska-control-model/en/latest/obs_state.html to bring subarray to ObsState.EMPTY from any current observing state.
- Raises:
AssertionError – error if test_observer is ASSERTING and (subarray does not change to expected state or LRC ok message is not received)