AFL.automation.instrument.NicosScriptClient#
ToDo - Add support for reading h5 data written by nicos
get list of files, load data by file name or data title
Classes
|
A client for interacting with a NICOS server from python scripts or the command line. |
- class AFL.automation.instrument.NicosScriptClient.NicosScriptClient(*args: Any, **kwargs: Any)[source]#
A client for interacting with a NICOS server from python scripts or the command line.
- livedata#
Dictionary to store live data from the NICOS server. This will only show data generated after the client has connected.
- Type:
- livedata = {}#
- status = 'idle'#
- signal(name, data=None, exc=None)[source]#
Handle signals from the NICOS server.
- Parameters:
name (str) – The name of the signal.
data (any, optional) – The data associated with the signal.
exc (any, optional) – Additional data for the signal.
- connect(host, port, user, password)[source]#
Connect to a NICOS server.
- Parameters:
- Raises:
RuntimeError – If the NICOS server protocol version is incompatible.
- get(parameter)[source]#
Get the value of a parameter or array
- Parameters:
parameter (str) – The name of the parameter.
- Returns:
The value of the parameter.
- Return type:
any
- blockForIdle(timeout=1800, initial_delay=5)[source]#
Block execution until the client status is ‘idle’ or a timeout occurs.
- Parameters:
Notes
This method will block the execution of the script until the client’s status becomes ‘idle’ or the specified timeout is reached. It checks the status every 0.1 seconds after the initial delay.
- stop(after_command=True, after_scan_point=False, emergency=False)[source]#
Stop the client based on the specified conditions.
- Parameters:
Notes
This method allows stopping the client in different ways: - If emergency is True, an emergency stop is performed. - If after_command is True, the client stops after the current command. - If after_scan_point is True, the client stops after the current scan point.