Skip to content

Commit

Permalink
Newport picomotor controller 8742 (#312)
Browse files Browse the repository at this point in the history
* Support for Newport Picomotor Controller 8742

Full functionality for this controller in single-controller and
multi-controller mode (main / secondaries via RS-485) is implemented.
Only single-controller mode is tested with hardware at the moment.
Full test suite however includes tests for multi-controller modes.
Routines were documented in docstring and also in Sphinx
documentation.

Note: Control via USB is currently not functional, since
InstrumentKit has some issues with the real USB communications
class. Needs separate PR.

* Added a `read_raw` routine to `instrument.py`

Reading raw data from the instrument is required for the picomotor
control class, however, had so far to be done by directly accessing
a private argument of `instrument.py` (not pretty).

* Replaced extensive hypothesis filtering with parametrized tests

This type of filtering has previously resulted in health check failures
with hypothesis since too many values were filtered out. All these tests
do is ensure that the correct error is raised.

* Remove print statement
  • Loading branch information
trappitsch committed Jan 19, 2022
1 parent 6d216bd commit 73eff1c
Show file tree
Hide file tree
Showing 5 changed files with 2,039 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/source/apiref/newport.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,9 @@ Newport
:members:
:undoc-members:

:class:`PicoMotorController8742`
================================

.. autoclass:: PicoMotorController8742
:members:
:undoc-members:
12 changes: 12 additions & 0 deletions instruments/abstract_instruments/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,18 @@ def read(self, size=-1, encoding="utf-8"):
"""
return self._file.read(size, encoding)

def read_raw(self, size=-1):
"""
Read the raw last line.
:param int size: Number of bytes to be read. Default is read until
termination character is found.
:return: The result of the read as returned by the
connected instrument.
:rtype: `str`
"""
return self._file.read_raw(size)

# PROPERTIES #

@property
Expand Down
2 changes: 2 additions & 0 deletions instruments/newport/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
from .newportesp301 import (
NewportESP301, NewportESP301Axis, NewportESP301HomeSearchMode
)

from .newport_pmc8742 import PicoMotorController8742
Loading

0 comments on commit 73eff1c

Please sign in to comment.