expert
¶
Expert macros
-
class
defmeas
(*args, **kwargs)[source]¶ Create a new measurement group. First channel in channel_list MUST be an internal sardana channel. At least one channel MUST be a Counter/Timer (by default, the first Counter/Timer in the list will become the master).
-
class
defctrl
(*args, **kwargs)[source]¶ Creates a new controller ‘role_prop’ is a sequence of roles and/or properties. - A role is defined as <role name>=<role value> (only applicable to pseudo controllers) - A property is defined as <property name> <property value>
If both roles and properties are supplied, all roles must come before properties. All controller properties that don’t have default values must be given.
Example of creating a motor controller (with a host and port properties):
[1]: defctrl SuperMotorController myctrl host homer.springfield.com port 5000
Example of creating a Slit pseudo motor (sl2t and sl2b motor roles, Gap and Offset pseudo motor roles):
[1]: defctrl Slit myslit sl2t=mot01 sl2b=mot02 Gap=gap01 Offset=offset01
-
class
edctrlcls
(*args, **kwargs)[source]¶ Returns the contents of the library file which contains the given controller code.
-
class
commit_ctrllib
(*args, **kwargs)[source]¶ Puts the contents of the given data in a file inside the pool
-
class
relctrllib
(*args, **kwargs)[source]¶ Reloads the given controller library code from the pool server filesystem.
-
class
addctrllib
(*args, **kwargs)[source]¶ Adds the given controller library code to the pool server filesystem.
-
class
relctrlcls
(*args, **kwargs)[source]¶ Reloads the given controller class code from the pool server filesystem.
-
class
rellib
(*args, **kwargs)[source]¶ Reloads the given python library code from the macro server filesystem.
Warning
use with extreme care! Accidentally reloading a system module or an installed python module may lead to unpredictable behavior
Warning
Prior to the Sardana version 1.6.0 this macro was successfully reloading python libraries located in the MacroPath. The MacroPath is not a correct place to locate your python libraries. They may be successfully loaded on the MacroServer startup, but this can not be guaranteed. In order to use python libraries within your macro code, locate them in either of valid system PYTHONPATH or MacroServer PythonPath property (of the host where MacroServer runs). In order to achieve the previous behavior, just configure the the same directory in both system PYTHONPATH (or MacroServer’s PythonPath) and MacroPath.
Note
if python module is used by any macro, don’t forget to reload the corresponding macros afterward so the changes take effect.
-
class
relmaclib
(*args, **kwargs)[source]¶ Reloads the given macro library code from the macro server filesystem.
-
class
addmaclib
(*args, **kwargs)[source]¶ Loads a new macro library.
Warning
Keep in mind that macros from the new library can override macros already present in the system.