Admin Mode

class ska_control_model.AdminMode(value)

Python enumerated type for device admin mode.

An admin mode represents user intent as to how the component under control will be used.

ENGINEERING = 2

The component under control can be used for engineering purposes, such as testing, debugging or commissioning, as part of an “engineering subarray”. It may not be used for normal operations.

While in this mode, the control system actively monitors and controls its component, but may only support a subset of normal functionality. Alarms and alerts will usually be suppressed.

ENGINEERING mode has different meaning for different components, depending on the context and functionality. Some entities may implement different behaviour when in ENGINEERING mode. For each Tango device, the difference in behaviour and functionality in ENGINEERING mode shall be documented.

NOT_FITTED = 3

The component cannot be used for any purposes because it is not fitted; for example, faulty equipment has been removed and not yet replaced, leaving nothing in situ to monitor.

While in this mode, the control system reports state DISABLED. All monitoring and control functionality is disabled because there is no component to monitor.

OFFLINE = 1

The component under control shall not be monitored or controlled by the control system.

Either the component under control shall not be used at all, or it is under external control (such as the local control of a field technician).

While in this mode, the control system reports its state as DISABLE. Since monitoring of the component is not occurring, the control system does not issue alarms, alerts and other events.

ONLINE = 0

The component under control can be used for normal operations, such as observing. While in this mode, the control system actively monitors and controls the component under control.

Control system elements that implement admin mode as a read-only attribute shall always report the admin mode to be ONLINE.

RESERVED = 4

The component is fitted, but only for redundancy purposes. It is additional equipment that does not take part in operations at this time, but is ready to take over when the operational equipment fails.

While in this mode, the control system reports state DISABLED. All monitoring and control functionality is disabled.

__new__(value)
class ska_control_model.AdminModeModel(logger, callback=None, state_machine_factory=<class 'ska_control_model.admin_mode._AdminModeMachine'>)

This class implements the state model for admin mode.

The model supports the five admin modes defined by the values of the AdminMode enum. It allows for:

  • any transition between the modes NOT_FITTED, RESERVED and OFFLINE (e.g. an unfitted device being fitted as a redundant or non-redundant device, a redundant device taking over when another device fails, etc.)

  • any transition between the modes OFFLINE, ENGINEERING and ONLINE (e.g. an online device being taken offline or put into engineering mode to diagnose a fault, a faulty device moving between engineering and offline mode as it undergoes sporadic periods of diagnosis.)

The actions supported are:

  • to_not_fitted

  • to_reserved

  • to_offline

  • to_engineering

  • to_online

A diagram of the admin mode model, as designed, is shown below

ONLINE --> ONLINE
ONLINE <-right-> ENGINEERING
ONLINE <-down-> OFFLINE
ENGINEERING -> ENGINEERING
ENGINEERING <-down-> OFFLINE
OFFLINE -> OFFLINE
OFFLINE <-down->NOT_FITTED
OFFLINE <-down->RESERVED
NOT_FITTED -> NOT_FITTED
NOT_FITTED <-right->RESERVED
RESERVED -> RESERVED

Diagram of the admin mode model

__init__(logger, callback=None, state_machine_factory=<class 'ska_control_model.admin_mode._AdminModeMachine'>)

Initialise the state model.

Parameters:
  • logger (Logger) – the logger to be used by this state model.

  • callback (Optional[Callable[[AdminMode], None]]) – A callback to be called when the state machine for admin_mode reports a change of state

  • state_machine_factory (Callable[..., LockedMachine]) – a callable that returns a state machine for this model to use

__weakref__

list of weak references to the object (if defined)

property admin_mode: AdminMode

Return the admin_mode.

Returns:

admin_mode of this state model

is_action_allowed(action, raise_if_disallowed=False)

Return whether a given action is allowed in the current state.

Parameters:
  • action (str) – an action, as given in the transitions table

  • raise_if_disallowed (bool) – whether to raise an exception if the action is disallowed, or merely return False (optional, defaults to False)

Raises:

StateModelError – if the action is unknown to the state machine

Return type:

bool

Returns:

whether the action is allowed in the current state

perform_action(action)

Perform an action on the state model.

Parameters:

action (str) – an action, as given in the transitions table

Return type:

None