Alarm Handler

This module implements SKAAlarmHandler, a generic base device for Alarms for SKA. It exposes SKA alarms and SKA alerts as TANGO attributes. SKA Alarms and SKA/Element Alerts are rules-based configurable conditions that can be defined over multiple attribute values and quality factors, and are separate from the “built-in” TANGO attribute alarms.

Tango Device Class

class ska_tango_base.SKAAlarmHandler(*args: Any, **kwargs: Any)[source]

A generic base device for Alarms for SKA.

SubAlarmHandlers = tango.server.device_property(dtype=('str',))
AlarmConfigFile = tango.server.device_property(dtype=str)
statsNrAlerts = tango.server.attribute(dtype=int, doc=Number of active Alerts)

Device attribute.

statsNrAlarms = tango.server.attribute(dtype=int, doc=Number of active Alarms)

Device attribute.

statsNrNewAlarms = tango.server.attribute(dtype=int, doc=Number of New active alarms)

Device attribute.

statsNrUnackAlarms = tango.server.attribute(dtype=double, doc=Number of unacknowledged alarms)

Device attribute.

statsNrRtnAlarms = tango.server.attribute(dtype=double, doc=Number of returned alarms)

Device attribute.

activeAlerts = tango.server.attribute(dtype=('str',), max_dim_x=10000, doc=List of active alerts)

Device attribute.

activeAlarms = tango.server.attribute(dtype=('str',), max_dim_x=10000, doc=List of active alarms)

Device attribute.

init_command_objects()[source]

Sets up the command objects

always_executed_hook()[source]

Method that is always executed before any device command gets executed.

delete_device()[source]

Method to cleanup when device is stopped.

read_statsNrAlerts()[source]

Reads number of active alerts. :return: Number of active alerts

read_statsNrAlarms()[source]

Reads number of active alarms. :return: Number of active alarms

read_statsNrNewAlarms()[source]

Reads number of new active alarms. :return: Number of new active alarms

read_statsNrUnackAlarms()[source]

Reads number of unacknowledged alarms. :return: Number of unacknowledged alarms.

read_statsNrRtnAlarms()[source]

Reads number of returned alarms. :return: Number of returned alarms

read_activeAlerts()[source]

Reads list of active alerts. :return: List of active alerts

read_activeAlarms()[source]

Reads list of active alarms. :return: List of active alarms

class GetAlarmRuleCommand(target, state_model, logger=None)[source]

A class for the SKAAlarmHandler’s GetAlarmRule() command.

Creates a new BaseCommand object for a device.

Parameters
  • state_model (SKABaseClassStateModel or a subclass of same) – the state model that this command uses, for example to raise a fatal error if the command errors out.

  • target (object) – the object that this base command acts upon. For example, the device that this BaseCommand implements the command for.

  • logger (a logger that implements the standard library logger interface) – the logger to be used by this Command. If not provided, then a default module logger will be used.

do(argin)[source]

Stateless hook for SKAAlarmHandler GetAlarmRule() command.

Returns

Alarm configuration info: rule, actions, etc.

Return type

JSON string

class GetAlarmDataCommand(target, state_model, logger=None)[source]

A class for the SKAAlarmHandler’s GetAlarmData() command.

Creates a new BaseCommand object for a device.

Parameters
  • state_model (SKABaseClassStateModel or a subclass of same) – the state model that this command uses, for example to raise a fatal error if the command errors out.

  • target (object) – the object that this base command acts upon. For example, the device that this BaseCommand implements the command for.

  • logger (a logger that implements the standard library logger interface) – the logger to be used by this Command. If not provided, then a default module logger will be used.

do(argin)[source]

Stateless hook for SKAAlarmHandler GetAlarmData() command.

Returns

Alarm data

Return type

JSON string

class GetAlarmAdditionalInfoCommand(target, state_model, logger=None)[source]

A class for the SKAAlarmHandler’s GetAlarmAdditionalInfo() command.

Creates a new BaseCommand object for a device.

Parameters
  • state_model (SKABaseClassStateModel or a subclass of same) – the state model that this command uses, for example to raise a fatal error if the command errors out.

  • target (object) – the object that this base command acts upon. For example, the device that this BaseCommand implements the command for.

  • logger (a logger that implements the standard library logger interface) – the logger to be used by this Command. If not provided, then a default module logger will be used.

do(argin)[source]

Stateless hook for SKAAlarmHandler GetAlarmAdditionalInfo() command.

Returns

Alarm additional info

Return type

JSON string

class GetAlarmStatsCommand(target, state_model, logger=None)[source]

A class for the SKAAlarmHandler’s GetAlarmStats() command.

Creates a new BaseCommand object for a device.

Parameters
  • state_model (SKABaseClassStateModel or a subclass of same) – the state model that this command uses, for example to raise a fatal error if the command errors out.

  • target (object) – the object that this base command acts upon. For example, the device that this BaseCommand implements the command for.

  • logger (a logger that implements the standard library logger interface) – the logger to be used by this Command. If not provided, then a default module logger will be used.

do()[source]

Stateless hook for SKAAlarmHandler GetAlarmStats() command.

Returns

Alarm stats

Return type

JSON string

class GetAlertStatsCommand(target, state_model, logger=None)[source]

A class for the SKAAlarmHandler’s GetAlertStats() command.

Creates a new BaseCommand object for a device.

Parameters
  • state_model (SKABaseClassStateModel or a subclass of same) – the state model that this command uses, for example to raise a fatal error if the command errors out.

  • target (object) – the object that this base command acts upon. For example, the device that this BaseCommand implements the command for.

  • logger (a logger that implements the standard library logger interface) – the logger to be used by this Command. If not provided, then a default module logger will be used.

do()[source]

Stateless hook for SKAAlarmHandler GetAlertStats() command.

Returns

Alert stats

Return type

JSON string

GetAlarmRule(argin)[source]

Get all configuration info of the alarm, e.g. rule, defined action, etc.

To modify behaviour for this command, modify the do() method of the command class.

Parameters

argin – Name of the alarm

Returns

JSON string containing configuration information of the alarm

GetAlarmData(argin)[source]

Get list of current value, quality factor and status of all attributes participating in the alarm rule.

To modify behaviour for this command, modify the do() method of the command class.

Parameters

argin – Name of the alarm

Returns

JSON string containing alarm data

GetAlarmAdditionalInfo(argin)[source]

Get additional alarm information.

To modify behaviour for this command, modify the do() method of the command class.

Parameters

argin – Name of the alarm

Returns

JSON string containing additional alarm information

GetAlarmStats()[source]

Get current alarm stats.

To modify behaviour for this command, modify the do() method of the command class.

Returns

JSON string containing alarm statistics

GetAlertStats()[source]

Get current alert stats.

To modify behaviour for this command, modify the do() method of the command class.

Returns

JSON string containing alert statistics