Skip to content

Commit 39eb80b

Browse files
author
spielman
committed
Merge remote-tracking branch 'origin/master' into CameraAttributes
2 parents 6b33558 + 8de7a40 commit 39eb80b

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

docs/source/adding_devices.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,24 @@ If the functionality is similar enough, it may even be possible to simply sub-cl
1717

1818
Barring the above simple solution, one must work from scratch.
1919
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.
2121

2222
The `labscript_device` implements general configuration parameters, many of which are passed to the `BLACS_worker`.
2323
It also implements the `generate_code` method which converts **labscript** high-level instructions and saves them to the h5 file.
2424

2525
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).
2727
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.
2929

3030
The `BLACS_worker` handles communication with the hardware itself and often represents the bulk of the work required to implement a new labscript device.
3131
In general, it should provide five different methods:
3232

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.
3434
* `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.
3535
* `check_remote_values`: This method reads the current settings of the device, updating the `BLACS_tab` widgets to reflect these values.
3636
* `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.
3838

3939
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.
4040

@@ -47,7 +47,7 @@ The old style has the `labscript_device`, `BLACS_tab`, `BLACS_worker`, and `runv
4747

4848
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).
4949
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
5151

5252
.. code-block:: python
5353

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
autodoc_typehints = 'description'
5353
autoclass_content = 'both' # options: 'both', 'class', 'init'
54-
autodoc_mock_imports = ['PyDAQmx']
54+
autodoc_mock_imports = ['PyDAQmx','labscript_utils']
5555

5656
# Prefix each autosectionlabel with the name of the document it is in and a colon
5757
autosectionlabel_prefix_document = True

labscript_devices/IMAQdxCamera/blacs_tabs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def handler(self, data):
102102
# and not for the Qt event loop as a whole. In any case, this seems to fix it.
103103
# Manually calling this is usually a sign of bad coding, but I think it is the
104104
# right solution to this problem. This solves issue #36.
105-
QtGui.QApplication.instance().sendPostedEvents()
105+
QtWidgets.QApplication.instance().sendPostedEvents()
106106
return self.NO_RESPONSE
107107

108108

labscript_devices/NI_DAQmx/models/generate_subclasses.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
2020
python generate_subclasses.py
2121
22+
For proper formatting of the code, you will need to install the `black` python package.
2223
"""
2324
import os
2425
import warnings

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,4 @@ docs =
4949
sphinx-rtd-theme==0.5.2
5050
recommonmark==0.6.0
5151
m2r==0.2.1
52+
mistune<2.0.0

0 commit comments

Comments
 (0)