You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/adding_devices.rst
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -17,24 +17,24 @@ If the functionality is similar enough, it may even be possible to simply sub-cl
17
17
18
18
Barring the above simple solution, one must work from scratch.
19
19
It is best to begin by determining the **labscript** device class to inherit from: `Psuedoclock`, `Device`, `IntermediateDevice`.
20
-
The first is for implementing Psuedoclock devices, the second is for generic devices that are not hardware timed by a pseudoclock, and the last is for hardware timed device that are connected to another device controlled via labscript.
20
+
The first is for implementing Psuedoclock devices, the second is for generic devices that are not hardware timed by a pseudoclock, and the last is for hardware timed devices that are connected to another device controlled via labscript.
21
21
22
22
The `labscript_device` implements general configuration parameters, many of which are passed to the `BLACS_worker`.
23
23
It also implements the `generate_code` method which converts **labscript** high-level instructions and saves them to the h5 file.
24
24
25
25
The `BLACS_tab` defines the GUI widgets that control the device.
26
-
This typically takes the form of using standard widgets provided by **labscript** for controlling **labscript** output primitives (ie `AnalogOut`, `DigitalOut`,`DDS`, etc).
26
+
This typically takes the form of using standard widgets provided by **labscript** for controlling **labscript** output primitives (ie `AnalogOut`, `DigitalOut`,`DDS`, etc).
27
27
This configuration is done in the `initialiseGUI` method.
28
-
This also links directly to the appropriate BLACS workers.
28
+
This also specifies which BLACS workers to use and provides necessary instantiation arguments.
29
29
30
30
The `BLACS_worker` handles communication with the hardware itself and often represents the bulk of the work required to implement a new labscript device.
31
31
In general, it should provide five different methods:
32
32
33
-
* `init`: This method initialised communications with the device. Not to be confused with the standard python class `__init__` method.
33
+
* `init`: This method initialises communications with the device. Not to be confused with the standard python class `__init__` method.
34
34
* `program_manual`: This method allows for user control of the device via the `BLACS_tab`, setting outputs to the values set in the `BLACS_tab` widgets.
35
35
* `check_remote_values`: This method reads the current settings of the device, updating the `BLACS_tab` widgets to reflect these values.
36
36
* `transition_to_buffered`: This method transitions the device to buffered shot mode, reading the shot h5 file and taking the saved instructions from `labscript_device.generate_code` and sending the appropriate commands to the hardware.
37
-
* `transition_to_manual`: This method transitions the device from buffered to manual mode. It does any necessary configuration to take the device out of buffered mode and is used to read an measurements and save them to the shot h5 file as results.
37
+
* `transition_to_manual`: This method transitions the device from buffered to manual mode. It does any necessary configuration to take the device out of buffered mode and is used to read any measurements and save them to the shot h5 file as results.
38
38
39
39
The `runviewer_parser` takes shot h5 files, reads the saved instructions, and allows you to view them in **runviewer** in order to visualise experiment timing.
40
40
@@ -47,7 +47,7 @@ The old style has the `labscript_device`, `BLACS_tab`, `BLACS_worker`, and `runv
47
47
48
48
The new style allows for arbitrary code organization, but typically has a folder named after the `labscript_device` with each device component in a different file (ie `labscript_devices.py`, `BLACS_workers.py`, etc).
49
49
With this style, the folder requires an `__init__.py` file (which can be empty) as well as a `register_classes.py` file.
50
-
This file imports :obj:`<labscript-utils:labscript_utils.device_registry>` via
50
+
This file imports :mod:`labscript-utils:labscript_utils.device_registry` via
0 commit comments