macro
The macro submodule.
Classes
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
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
- 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
- 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