TestModeOverrideMixin

This module implements testMode and test mode overrides as a mix-in class.

class ska_tango_base.test_mode_mixin.TestModeOverrideMixin[source]

Add Test Mode Attribute Overrides to a Tango device.

When testMode is TEST, clients can override the value of attributes using the test_mode_overrides attribute.

init_device() None[source]

Add our variables to the class we are extending.

_test_mode: Signal[ska_control_model.TestMode]

Signal for the test mode of the device.

Values are emitted for this signal whenever a client successfully changes to the testMode attribute.

testMode: attribute_from_signal

Test mode attribute of the device.

Either no test mode or an indication of the test mode.

read_testMode() TestMode | tuple[TestMode, float, AttrQuality][source]

Read the test mode of the device.

Subclasses can override this to change the behaviour of the testMode attribute.

write_testMode(mode: TestMode) None[source]

Write the test mode of the device.

Subclasses can override this to change the behaviour of the testMode attribute.

is_test_mode_overrides_allowed(request_type: AttReqType) bool[source]

Control access to test_mode_overrides attribute.

Writes to the attribute are allowed only if test mode is active.

Parameters:

request_type – Attribute request type

Returns:

If in test mode

read_test_mode_overrides() str | tuple[str, float, AttrQuality][source]

Read the current override configuration.

Returns:

JSON-encoded dictionary (attribute name: value)

write_test_mode_overrides(overrides: str) None[source]

Read the override configuration.

Parameters:

value_str – JSON-encoded dict of overrides (attribute name: value)

ska_tango_base.test_mode_mixin.overridable(func: Callable[[Concatenate[C, P]], Any] | None = None, *, name: str | None = None) Callable[[Concatenate[C, P]], Any][source]

Decorate attribute with test mode overrides.

Parameters:

func – Tango attribute

Returns:

Overridden value or original function