Added/updated docs

This commit is contained in:
Joel Collins 2019-01-24 14:05:57 +00:00
parent cb441201c6
commit 363094170e
3 changed files with 45 additions and 15 deletions

View file

@ -5,13 +5,17 @@ from openflexure_microscope.lock import StrictLock
# TODO: Implement lock on movement
class Stage(OpenFlexureStage):
def __init__(self, *args, **kwargs):
self.lock = StrictLock(timeout=2) #: Strict lock controlling thread access to camera hardware
"""
Subclass of :py:class:`openflexure_stage.stage.OpenFlexureStage`,
adding an instance of :py:class:`openflexure_microscope.lock.StrictLock` to regulate access.
"""
self.lock = StrictLock(timeout=2) #: :py:class:`openflexure_microscope.lock.StrictLock`: Strict lock controlling thread access to camera hardware
OpenFlexureStage.__init__(self, *args, **kwargs)
def _move_rel_nobacklash(self, *args, **kwargs):
"""
Overrides `OpenFlexureStage._move_rel_nobacklash` to acquire lock first.
Overrides :py:function:`openflexure_stage.stage.OpenFlexureStage._move_rel_nobacklash` to acquire lock first.
"""
with self.lock:
OpenFlexureStage._move_rel_nobacklash(self, *args, **kwargs)