Controller Cli

The command line interface for the MCCS Controller device server.

class CliMeta(name: str, bases: tuple[type], attrs: dict)

Metaclass to catch exceptions.

Dissect tango.DevFailed and other exceptions for all class methods. They get turned into fire.core.FireError exceptions.

classmethod fire_except(method)

Wrap a Tango exception and raise a FireError.

Wraps the method so that any tango.DevFailed exception raised by a method is converted to a fire.core.FireError, so that the CLI framework handles it nicely.

Parameters:

method (Callable) – the method to be wrapped

Return type:

Callable

Returns:

the wrapped method

class MccsControllerCli(trl='low-mccs/control/control')

Command-line interface to the MccsController tango device.

__init__(trl='low-mccs/control/control')

Initialise a new CLI instance.

Parameters:

trl (str) – the TRL of the controller device. Optional: defaults to “low-mccs/control/control”

adminmode()

Show the admin mode.

Todo:

make writable

Return type:

str

Returns:

the admin mode

allocate(subarray_id=0, station_ids=None, subarray_beam_ids=None, channel_blocks=None)

Allocate stations to a subarray.

Parameters:
  • subarray_id (int) – the subarray id, defaults to 1

  • station_ids (Optional[list[list[int]]]) – the station ids, defaults to [[1]]

  • subarray_beam_ids (Optional[list[int]]) – the subarray_beam ids, defaults to [1]

  • channel_blocks (Optional[list[int]]) – the nos. of channel_blocks, defaults to [1]

Return type:

str

Returns:

a result message

controlmode()

Show the control mode.

Todo:

make writable

Return type:

str

Returns:

control mode

healthstate()

Show the health state.

Return type:

str

Returns:

health state

logginglevel(level=None)

Get and/or set the logging level of the device.

Parameters:

level (Optional[str]) – the logging level, defaults to None (only print the level)

Return type:

str

Returns:

logging level value

off()

Turn the controller (and hence all of MCCS) off.

Return type:

str

Returns:

A return code and a string message indicating status converted into a two line string

on()

Turn the controller (and hence all of MCCS) on.

Return type:

str

Returns:

A return code and a string message indicating status converted into a two line string

release(subarray_id=0)

Release resources from a subarray.

Parameters:

subarray_id (int) – the subarray id, defaults to 0

Return type:

str

Returns:

A return code and a string message indicating status converted into a two line string

reset()

Reset the controller following a fatal error.

Return type:

str

Returns:

A return code and a string message indicating status converted into a two line string

simulationmode()

Show the control mode.

Todo:

make writable

Return type:

str

Returns:

simulation mode

standbyfull()

Put the controller (and hence all of MCCS) into full-power standby mode.

Return type:

str

Returns:

A return code and a string message indicating status converted into a two line string

format_wrapper(method)

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 (Callable) – the method to be wrapped

Return type:

Callable[[tuple[ResultCode, str]], str]

Returns:

the wrapped method

main(*args, **kwargs)

Entry point for module.

Parameters:
  • args (str) – positional arguments

  • kwargs (str) – named arguments

Return type:

int

Returns:

exit code