Added route to download logfile

This commit is contained in:
Joel Collins 2019-05-15 15:30:28 +01:00
parent d54a35e197
commit 63c0492022
2 changed files with 33 additions and 35 deletions

View file

@ -1,27 +0,0 @@
from openflexure_stage import OpenFlexureStage
from openflexure_microscope.lock import StrictLock
import logging
class Stage(OpenFlexureStage):
def __init__(self, *args, **kwargs):
"""
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 :py:function:`openflexure_stage.stage.OpenFlexureStage._move_rel_nobacklash` to acquire lock first.
"""
if self._ser:
with self.lock:
OpenFlexureStage._move_rel_nobacklash(self, *args, **kwargs)
else:
logging.warning("Unable to move stage. Serial communication unavailable.")