macroexecutor

Functions

Classes

  • BaseMacroExecutor

  • MacroExecutorFactory

TangoAttrCb

Inheritance diagram of TangoAttrCb
class TangoAttrCb(tango_macro_executor)[source]

An abstract callback class for Tango events

TangoResultCb

Inheritance diagram of TangoResultCb
class TangoResultCb(tango_macro_executor)[source]

Callback class for Tango events of the Result attribute

push_event(*args, **kwargs)[source]

callback method receiving the event

TangoLogCb

Inheritance diagram of TangoLogCb
class TangoLogCb(tango_macro_executor, log_name)[source]

Callback class for Tango events of the log attributes e.g. Output, Error, Critical

push_event(*args, **kwargs)[source]

callback method receiving the event

TangoStatusCb

Inheritance diagram of TangoStatusCb
class TangoStatusCb(tango_macro_executor)[source]

Callback class for Tango events of the MacroStatus attribute

START_STATES = ['start']
DONE_STATES = ['finish', 'stop', 'exception']
push_event(*args, **kwargs)[source]

callback method receiving the event

TangoMacroExecutor

Inheritance diagram of TangoMacroExecutor
class TangoMacroExecutor(door_name=None)[source]

Macro executor implemented using Tango communication with the Door device

getData()[source]

Returns the data object for the last executed macro

Returns:

(obj)

createCommonBuffer()

Create a common buffer, where all the registered logs will be stored.

getCommonBuffer()
Get common buffer.

Method getCommonBuffer can only be used if at least one buffer exists.

Returns:

(seq<str>) list of strings with messages from all log levels

getExceptionStr()

Get macro exception type representation (None if the macro state is not exception).

Returns:

(str)

getLog(log_level)

Get log messages.

Parameters:

log_level – (str) string indicating the log level

Returns:

(seq<str>) list of strings with log messages

getResult()

Get macro result.

Returns:

(seq<str>) list of strings with Result messages

getState()

Get macro execution state.

Returns:

(str)

getStateBuffer()

Get buffer (history) of macro execution states.

Returns:

(seq<str>)

log_levels = ['debug', 'output', 'info', 'warning', 'critical', 'error']
registerAll()

Register for macro result, all log levels and common buffer.

registerLog(log_level)

Start registering log messages.

Parameters:

log_level – (str) string indicating the log level

registerResult()

Register for macro result

run(macro_name, macro_params=None, sync=True, timeout=None)

Execute macro.

Parameters:
  • macro_name – (string) name of macro to be executed

  • macro_params – (list<string>) macro parameters (default is macro_params=None for macros without parameters or with the default values)

  • sync – (bool) whether synchronous or asynchronous call (default is sync=True)

  • timeout

    (float) timeout (in s) that will be passed to the wait

    method, in case of synchronous execution; None means wait infinitely

    In asyncrhonous execution method wait() has to be explicitly called.

stop(started_event_timeout=3.0)

Stop macro execution. Execute macro in synchronous way before using this method.

Parameters:

started_event_timeout – (float) waiting timeout for started event

unregisterAll()

Unregister macro result, all log levels and common buffer.

unregisterLog(log_level)

Stop registering log messages.

Parameters:

log_level – (str) string indicating the log level

unregisterResult()

Unregister macro result.

wait(timeout=None)

Wait until macro is done. Use it in asynchronous executions.

Parameters:

timeout – (float) waiting timeout (in s); None means wait infinitely