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.
- MAINTENANCE = 2
The component under control can be used for maintainance purposes, such as testing, debugging or commissioning, as part of a “maintenance 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.
MAINTENANCE
mode has different meaning for different components, depending on the context and functionality. Some entities may implement different behaviour when inMAINTENANCE
mode. For each Tango device, the difference in behaviour and functionality inMAINTENANCE
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.
- 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, MAINTENANCE and ONLINE (e.g. an online device being taken offline or put into maintenance mode to diagnose a fault, a faulty device moving between maintenance and offline mode as it undergoes sporadic periods of diagnosis.)
The actions supported are:
to_not_fitted
to_reserved
to_offline
to_maintenance
to_online
A diagram of the admin mode model, as designed, is shown below
- __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 statestate_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)
- is_action_allowed(action, raise_if_disallowed=False)
Return whether a given action is allowed in the current state.
- Parameters:
- Raises:
StateModelError – if the action is unknown to the state machine
- Return type:
- Returns:
whether the action is allowed in the current state