Device module (ska_low_mccs.device)

This module implements the MCCS Base Device, a base class for all MCCS devices.

class MccsDevice(*args, **kwargs)[source]

A base class for all Mccs Devices.

This is a subclass of ska_tango_base.SKABaseDevice.

ConstructDeviceProxyAddress(argin)[source]

Command to constrcut a device proxy address.

Parameters

argin – ‘DevString’

Returns

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Return type

(ResultCode, str)

class ConstructDeviceProxyAddressCommand(*args, **kwargs)[source]

Class for handling the ConstructDeviceProxyAddress(argin) command.

Todo

What does this command do? It sounds like it constructs an address, but if so it doesn’t return it.

do(argin)[source]

Stateless hook for implementation of ska_low_mccs.device.MccsDevice.ConstructDeviceProxyAddress() command functionality.

Parameters

argin (str) – TODO: what argument does this take

Returns

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Return type

(ResultCode, str)

DefaultAlarmOffCallback()[source]

Command called by default as a callback for when an alarm is turned off.

Todo

What does this command do?

Returns

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Return type

(ResultCode, str)

class DefaultAlarmOffCallbackCommand(*args, **kwargs)[source]

Class for handling the DefaultAlarmOffCallback command.

Todo

What is this command supposed to do? It takes no argument, and returns nothing.

do()[source]

Stateless hook for implementation of ska_low_mccs.device.MccsDevice.DefaultAlarmOffCallback() command functionality.

Returns

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Return type

(ResultCode, str)

DefaultAlarmOnCallback()[source]

Command called by default as a callback for when an alarm is turned on.

Todo

What does this command do?

Returns

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Return type

(ResultCode, str)

class DefaultAlarmOnCallbackCommand(*args, **kwargs)[source]

Class for handling the DefaultAlarmOnCallback command.

Todo

What is this command supposed to do? It takes no argument, and returns nothing.

do()[source]

Stateless hook for implementation of ska_low_mccs.device.MccsDevice.DefaultAlarmOnCallback() command functionality.

Returns

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Return type

(ResultCode, str)

ExceptionCallback()[source]

Command called as a callback when an exception occurs.

Todo

What does this command do?

Returns

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Return type

(ResultCode, str)

class ExceptionCallbackCommand(*args, **kwargs)[source]

Class for handling the ExceptionCallback command.

Todo

What is this command supposed to do? It takes no argument, and returns nothing.

do()[source]

Stateless hook for implementation of ska_low_mccs.device.MccsDevice.ExceptionCallback() command functionality.

Returns

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Return type

(ResultCode, str)

GetAttributeReport()[source]

Get an attribute report.

Returns

an attribute report

Return type

list(str)

class GetAttributeReportCommand(*args, **kwargs)[source]

Class for handling the GetAttributeReport() command.

do()[source]

Stateless hook for implementation of ska_low_mccs.device.MccsDevice.GetAttributeReport() command functionality.

Returns

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Return type

(ResultCode, str)

GetCommandReport()[source]

Get a command report.

Returns

a command report

Return type

list(str)

class GetCommandReportCommand(*args, **kwargs)[source]

Class for handling the GetCommandReport() command.

do()[source]

Stateless hook for implementation of ska_low_mccs.device.MccsDevice.GetCommandReport() command functionality.

Returns

a command report

Return type

list(str)

GetFullReport()[source]

Get a full report.

Returns

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Return type

(ResultCode, str)

class GetFullReportCommand(*args, **kwargs)[source]

Class for handling the GetFullReport() command.

do()[source]

Stateless hook for implementation of ska_low_mccs.device.MccsDevice.GetFullReport() command functionality.

Returns

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Return type

(ResultCode, str)

class InitCommand(*args, **kwargs)[source]

Class that implements device initialisation for the MCCS Base Device. State is managed under the hood; the basic sequence is:

  1. Device state is set to INIT

  2. The do() method is run

  3. Device state is set to the appropriate outgoing state, usually off

do()[source]

Stateless hook for device initialisation: initialises the attributes and properties of the MccsDevice.

Returns

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Return type

(ResultCode, str)

always_executed_hook()[source]

Method always executed before any TANGO command is executed.

buildState()[source]

The build state of this device.

Returns

the build state of this device

Return type

str

callCommFailed()[source]

Return a flag indicating whether this device has had a call fail due to communications failure.

Returns

whether this device has had a call fail due to communications failure

Return type

bool

callTimeout()[source]

Return a flag indicating whether this device has experienced a call timeout.

Returns

whether this device has had a call timeout

Return type

bool

calledDeadServer()[source]

Return a flag indicating whether this device has tried to call a dead server.

Returns

whether this device has tried to call a dead server

Return type

bool

calledInexistentCallback()[source]

Return a flag indicating whether this device has tried to call a nonexistent callback.

Returns

whether this device has tried to call a nonexistent callback

Return type

bool

calledNonRunningDevice()[source]

Return a flag indicating whether this device has tried to call a device that is not running.

Returns

whether this device has tried to call a device that is not running

Return type

bool

calledUndefinedDevice()[source]

Return a flag indicating whether this device has tried to call a device that is not defined in the device database.

Returns

whether this device has tried to call a device that is not defined in the device database

Return type

bool

delete_device()[source]

Hook to delete resources allocated in the do() method of the nested InitCommand class.

This method allows for any memory or other resources allocated in the do() method to be released. This method is called by the device destructor, and by the Init command when the Tango device server is re-initialised.

detectedDeadServer()[source]

Return a flag indicating whether this device has detected a dead server.

Returns

whether this device has detected a dead server

Return type

bool

diagMode()[source]

Return the diagMode attribute.

Todo

What does this mean?

Returns

the value of the diagMode attribute

Return type

bool

expectedReplyNotReady()[source]

Return a flag indicating whether this device has experienced an expected reply not being ready.

Returns

whether this device has experienced an expected reply not being ready

Return type

bool

experiencedSubscriptionFailure()[source]

Return a flag indicating whether this device has experienced a subscription failure.

Returns

whether this device has experienced a subscription failure

Return type

bool

init_command_objects()[source]

Set up the handler objects for Commands.

invalidAsynId()[source]

Return a flag indicating whether this device has had a call fail due to an invalid “asyn” id.

Todo

what is an “asyn” id?

Returns

whether this device has had a call fail due to an invalid asyn id

Return type

bool

invalidEventId()[source]

Return a flag indicating whether this device has errored due to an invalid event id.

Returns

whether this device has errored due to an invalid event id

Return type

bool

isHardwareDevice()[source]

Return whether this device manages hardware.

Returns

whether this device mamages hardware

Return type

bool

requestIdMismatch()[source]

Return a flag indicating whether this device has experienced a request id mismatch.

Returns

whether this device has experienced a request id mismatch

Return type

bool

versionId()[source]

The version id of this device.

Returns

the version_id of this device

Return type

str

main(args=None, **kwargs)[source]

Entry point for module.

Parameters
  • args (list) – positional arguments

  • kwargs (dict) – named arguments

Returns

exit code

Return type

int