macroexecutor
¶
Functions
Classes
|
|
TangoAttrCb¶
TangoResultCb¶
TangoLogCb¶
TangoStatusCb¶
TangoMacroExecutor¶
-
class
TangoMacroExecutor
(door_name=None)[source]¶ Macro executor implemented using Tango communication with the Door device
-
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 See also
-
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=inf)¶ 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
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=inf)¶ Wait until macro is done. Use it in asynchronous executions.
Parameters: timeout – (float) waiting timeout (in s)
-