macro

The macro submodule.

Classes

Macro

Inheritance diagram of Macro
class Macro(door, name, id, xml_obj)[source]

Bases: object

Ready = tango._tango.DevState.ON
Init = tango._tango.DevState.INIT
Running = tango._tango.DevState.RUNNING
Pause = tango._tango.DevState.STANDBY
Fault = tango._tango.DevState.FAULT
Finished = tango._tango.DevState.ON
Abort = tango._tango.DevState.ALARM
getID()[source]
getRange()[source]
getStep()[source]
getInfo()[source]
setResult(res)[source]
getResult()[source]

MacroInfo

Inheritance diagram of MacroInfo
class MacroInfo(from_json_str=None, from_json=None)[source]

Bases: object

Contains all information about a macro: name, documentation, parameters, result, etc

hasParams()[source]

Determines if the macro has parameters

Returns:

(bool) True if the macro has parameters or False otherwise

getParamList()[source]

Returs the list of parameters

Returns:

(sequence) a list of parameters

getParam(idx=0)[source]

Gets the parameter for the given index

Parameters:

idx – (int) the index (default is 0)

Returns:

(object) the parameter or None if the macro does not have the desired parameter

getPossibleParams(idx, parameters=None)[source]

Gets the possible parameters for the given index

Parameters:
  • idx – (int) parameter index

  • parameters – (sequence) sequence of parameter information (default is None which means use the macro parameters)

Returns:

(sequence) list of possible parameters

getParamStr()[source]
Returns the string line representing the macro parameters.

For example, if a macro has a motor parameter followed by a list of numbers it will return: ‘<motor> [ <number> ]’

Returns:

(str) a string representing the macro parameter line

getParamDescr()[source]

Returns the list of strings, each one documenting each macro parameter

Returns:

(sequence<str>) list of parameter lines

hasResult()[source]

Determines if the macro has a result

Returns:

(bool) True if the macro has a result or False otherwise

getResultList()[source]

Returns the list of results

Returns:

(sequence) a list of results

getResult(idx=0)[source]

Gets the result for the given index

Parameters:

idx – (int) the index (default is 0)

Returns:

(object) the result or None if the macro does not have the desired result

getResultStr()[source]
Returns the string line representing the macro results.

For example, if a macro returns a number, this method it will return: ‘<number>’

Returns:

(str) a string representing the macro result line

getResultDescr()[source]

Returns the list of strings, each one documenting each macro result

Returns:

(sequence<str>) list of result lines

formatResult(result)[source]
allowsHooks()[source]

Checks whether the macro allows hooks

Returns:

True or False depending if the macro allows hooks

Return type:

bool

getAllowedHooks()[source]

Gets allowed hooks

Returns:

list with the allowed hooks or empty list if the macro does not allow hooks

Return type:

list[str]