Controller Cli
The command line interface for the MCCS Controller device server.
- class CliMeta(name: str, bases: tuple[type], attrs: dict)[source]
Metaclass to catch exceptions.
Dissect
tango.DevFailedand other exceptions for all class methods. They get turned intofire.core.FireErrorexceptions.- classmethod fire_except(method: Callable) Callable[source]
Wrap a Tango exception and raise a FireError.
Wraps the method so that any
tango.DevFailedexception raised by a method is converted to afire.core.FireError, so that the CLI framework handles it nicely.- Parameters:
method – the method to be wrapped
- Returns:
the wrapped method
- class MccsControllerCli(trl: str = 'low-mccs/control/control')[source]
Command-line interface to the MccsController tango device.
- __init__(trl: str = 'low-mccs/control/control') None[source]
Initialise a new CLI instance.
- Parameters:
trl – the TRL of the controller device. Optional: defaults to “low-mccs/control/control”
- allocate(subarray_id: int = 0, station_ids: list[list[int]] | None = None, subarray_beam_ids: list[int] | None = None, channel_blocks: list[int] | None = None) str[source]
Allocate stations to a subarray.
- Parameters:
subarray_id – the subarray id, defaults to 1
station_ids – the station ids, defaults to [[1]]
subarray_beam_ids – the subarray_beam ids, defaults to [1]
channel_blocks – the nos. of channel_blocks, defaults to [1]
- Returns:
a result message
- logginglevel(level: str | None = None) str[source]
Get and/or set the logging level of the device.
- Parameters:
level – the logging level, defaults to None (only print the level)
- Returns:
logging level value
- off() str[source]
Turn the controller (and hence all of MCCS) off.
- Returns:
A return code and a string message indicating status converted into a two line string
- on() str[source]
Turn the controller (and hence all of MCCS) on.
- Returns:
A return code and a string message indicating status converted into a two line string
- release(subarray_id: int = 0) str[source]
Release resources from a subarray.
- Parameters:
subarray_id – the subarray id, defaults to 0
- Returns:
A return code and a string message indicating status converted into a two line string
- format_wrapper(method: Callable) Callable[[tuple[ska_tango_base.commands.ResultCode, str]], str][source]
Wrap the return message as a two line string.
Wraps a method with a wrapper that ensures that the method returns results formatted as a two-line string.
- Parameters:
method – the method to be wrapped
- Returns:
the wrapped method