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.DevFailed and other exceptions for all class methods. They get turned into fire.core.FireError exceptions.

classmethod fire_except(method: Callable) Callable[source]

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 – 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”

adminmode() str[source]

Show the admin mode.

Todo:

make writable

Returns:

the admin mode

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

controlmode() str[source]

Show the control mode.

Todo:

make writable

Returns:

control mode

healthstate() str[source]

Show the health state.

Returns:

health state

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

reset() str[source]

Reset the controller following a fatal error.

Returns:

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

simulationmode() str[source]

Show the control mode.

Todo:

make writable

Returns:

simulation mode

standbyfull() str[source]

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

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

main(*args: str, **kwargs: str) int[source]

Entry point for module.

Parameters:
  • args – positional arguments

  • kwargs – named arguments

Returns:

exit code