env
Environment related macros
- class lsenv(*args, **kwargs)[source]
Lists the environment in alphabetical order
- param_def = [['macro_list', [['macro', 'MacroClass', None, 'macro name'], {'min': 0}], None, 'List of macros to show environment']]
This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:
a simple parameter object
a parameter repetition object
A simple parameter object is a sequence of:
a string representing the parameter name
a member of
Macro.Type
representing the parameter data typea default value for the parameter or None if there is no default value
a string with the parameter description
Example:
param_def = ( ('value', Type.Float, None, 'a float parameter' ) )
A parameter repetition object is a sequence of:
a string representing the parameter repetition name
a sequence of parameter information objects
a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:
min - integer representing minimum number of repetitions or None for no minimum.
max - integer representing maximum number of repetitions or None for no maximum.
Default parameter repetition semantics is
{ 'min': 1, 'max' : None }
(in other words, “at least one repetition” semantics)
Example:
param_def = ( ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors') )
- class senv(*args, **kwargs)[source]
Sets the given environment variable to the given value
- param_def = [['name', 'Env', None, 'Environment variable name. Can be one of the following:\n - <name> - global variable\n - <full door name>.<name> - variable value for a specific door\n - <macro name>.<name> - variable value for a specific macro\n - <full door name>.<macro name>.<name> - variable value for a specific macro running on a specific door'], ['value_list', [['value', 'String', None, 'environment value item (string value which correspondsto a Python type e.g. int, float, Exception, etc. must be double enclosed in quotes e.g. "\'int\'"'], {'min': 1}], None, 'value(s). one item will eval to a single element. More than one item will eval to a tuple of elements']]
This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:
a simple parameter object
a parameter repetition object
A simple parameter object is a sequence of:
a string representing the parameter name
a member of
Macro.Type
representing the parameter data typea default value for the parameter or None if there is no default value
a string with the parameter description
Example:
param_def = ( ('value', Type.Float, None, 'a float parameter' ) )
A parameter repetition object is a sequence of:
a string representing the parameter repetition name
a sequence of parameter information objects
a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:
min - integer representing minimum number of repetitions or None for no minimum.
max - integer representing maximum number of repetitions or None for no maximum.
Default parameter repetition semantics is
{ 'min': 1, 'max' : None }
(in other words, “at least one repetition” semantics)
Example:
param_def = ( ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors') )
- class usenv(*args, **kwargs)[source]
Unsets the given environment variable
- param_def = [['environment_list', [['env', 'Env', None, 'Environment variable name'], {'min': 1}], None, 'List of environment items to be removed']]
This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:
a simple parameter object
a parameter repetition object
A simple parameter object is a sequence of:
a string representing the parameter name
a member of
Macro.Type
representing the parameter data typea default value for the parameter or None if there is no default value
a string with the parameter description
Example:
param_def = ( ('value', Type.Float, None, 'a float parameter' ) )
A parameter repetition object is a sequence of:
a string representing the parameter repetition name
a sequence of parameter information objects
a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:
min - integer representing minimum number of repetitions or None for no minimum.
max - integer representing maximum number of repetitions or None for no maximum.
Default parameter repetition semantics is
{ 'min': 1, 'max' : None }
(in other words, “at least one repetition” semantics)
Example:
param_def = ( ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors') )
- class genv(*args, **kwargs)[source]
Gets the given environment variable
- param_def = [['name', 'Env', None, 'Environment variable name. Can be one of the following:\n - <name> - global variable\n - <full door name>.<name> - variable value for a specific door\n - <macro name>.<name> - variable value for a specific macro\n - <full door name>.<macro name>.<name> - variable value for a specific macro running on a specific door']]
This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:
a simple parameter object
a parameter repetition object
A simple parameter object is a sequence of:
a string representing the parameter name
a member of
Macro.Type
representing the parameter data typea default value for the parameter or None if there is no default value
a string with the parameter description
Example:
param_def = ( ('value', Type.Float, None, 'a float parameter' ) )
A parameter repetition object is a sequence of:
a string representing the parameter repetition name
a sequence of parameter information objects
a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:
min - integer representing minimum number of repetitions or None for no minimum.
max - integer representing maximum number of repetitions or None for no maximum.
Default parameter repetition semantics is
{ 'min': 1, 'max' : None }
(in other words, “at least one repetition” semantics)
Example:
param_def = ( ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors') )
- class setvo(*args, **kwargs)[source]
Sets the given view option to the given value.
Available view options:
ShowDial: used by macro wm, pwm and wa. Default value
False
ShowCtrlAxis: used by macro wm, pwm and wa. Default value
False
PosFormat: used by macro wm, pwm, wa and umv. Default value
-1
OutputBlock: used by scan macros. Default value
False
DescriptionLength: used by lsdef. Default value
60
- param_def = [['name', 'String', None, 'View option name'], ['value', 'String', None, 'View option value']]
This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:
a simple parameter object
a parameter repetition object
A simple parameter object is a sequence of:
a string representing the parameter name
a member of
Macro.Type
representing the parameter data typea default value for the parameter or None if there is no default value
a string with the parameter description
Example:
param_def = ( ('value', Type.Float, None, 'a float parameter' ) )
A parameter repetition object is a sequence of:
a string representing the parameter repetition name
a sequence of parameter information objects
a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:
min - integer representing minimum number of repetitions or None for no minimum.
max - integer representing maximum number of repetitions or None for no maximum.
Default parameter repetition semantics is
{ 'min': 1, 'max' : None }
(in other words, “at least one repetition” semantics)
Example:
param_def = ( ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors') )
- class usetvo(*args, **kwargs)[source]
Resets the value of the given view option.
Available view options:
ShowDial: used by macro wm, pwm and wa. Default value
False
ShowCtrlAxis: used by macro wm, pwm and wa. Default value
False
PosFormat: used by macro wm, pwm, wa and umv. Default value
-1
OutputBlock: used by scan macros. Default value
False
DescriptionLength: used by lsdef. Default value
60
- param_def = [['name', 'String', None, 'View option name']]
This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:
a simple parameter object
a parameter repetition object
A simple parameter object is a sequence of:
a string representing the parameter name
a member of
Macro.Type
representing the parameter data typea default value for the parameter or None if there is no default value
a string with the parameter description
Example:
param_def = ( ('value', Type.Float, None, 'a float parameter' ) )
A parameter repetition object is a sequence of:
a string representing the parameter repetition name
a sequence of parameter information objects
a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:
min - integer representing minimum number of repetitions or None for no minimum.
max - integer representing maximum number of repetitions or None for no maximum.
Default parameter repetition semantics is
{ 'min': 1, 'max' : None }
(in other words, “at least one repetition” semantics)
Example:
param_def = ( ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors') )
- class lsgh(*args, **kwargs)[source]
List general hooks.
Note
The
lsgh
macro has been included in Sardana on a provisional basis. Backwards incompatible changes (up to and including its removal) may occur if deemed necessary by the core developers.
- class defgh(*args, **kwargs)[source]
Define general hook:
>>> defgh "mv [[mot02 9]]" pre-scan >>> defgh "ct 0.1" pre-scan >>> defgh lsm pre-scan >>> defgh "mv mot03 10" pre-scan >>> defgh "Print 'Hello world'" pre-scan
Note
The
defgh
macro has been included in Sardana on a provisional basis. Backwards incompatible changes (up to and including its removal) may occur if deemed necessary by the core developers.- param_def = [['macro_name', 'String', None, 'Macro name with parameters. Ex.: "mv exp_dmy01 10"'], ['hookpos_list', [['position', 'String', None, 'macro name'], {'min': 1}], None, 'List of positions where the hook has to be executed']]
This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:
a simple parameter object
a parameter repetition object
A simple parameter object is a sequence of:
a string representing the parameter name
a member of
Macro.Type
representing the parameter data typea default value for the parameter or None if there is no default value
a string with the parameter description
Example:
param_def = ( ('value', Type.Float, None, 'a float parameter' ) )
A parameter repetition object is a sequence of:
a string representing the parameter repetition name
a sequence of parameter information objects
a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:
min - integer representing minimum number of repetitions or None for no minimum.
max - integer representing maximum number of repetitions or None for no maximum.
Default parameter repetition semantics is
{ 'min': 1, 'max' : None }
(in other words, “at least one repetition” semantics)
Example:
param_def = ( ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors') )
- class udefgh(*args, **kwargs)[source]
Undefine general hook. Without arguments undefine all.
Note
The
lsgh
macro has been included in Sardana on a provisional basis. Backwards incompatible changes (up to and including its removal) may occur if deemed necessary by the core developers.- param_def = [['macro_name', 'String', 'all', 'General hook to be undefined'], ['hook_pos', 'String', 'all', 'Position to undefine the general hook from']]
This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:
a simple parameter object
a parameter repetition object
A simple parameter object is a sequence of:
a string representing the parameter name
a member of
Macro.Type
representing the parameter data typea default value for the parameter or None if there is no default value
a string with the parameter description
Example:
param_def = ( ('value', Type.Float, None, 'a float parameter' ) )
A parameter repetition object is a sequence of:
a string representing the parameter repetition name
a sequence of parameter information objects
a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:
min - integer representing minimum number of repetitions or None for no minimum.
max - integer representing maximum number of repetitions or None for no maximum.
Default parameter repetition semantics is
{ 'min': 1, 'max' : None }
(in other words, “at least one repetition” semantics)
Example:
param_def = ( ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors') )