Moved lock submodule into 'common' and updated docs

This commit is contained in:
jtc42 2019-11-01 18:10:04 +00:00
parent 8ec9368988
commit 625b03fae3
10 changed files with 35 additions and 36 deletions

View file

@ -5,4 +5,4 @@ from .microscope import Microscope
from . import config
from . import utilities
from . import task
from . import lock
from . import common

View file

@ -10,7 +10,7 @@ from abc import ABCMeta, abstractmethod
from .capture import CaptureObject
from openflexure_microscope.utilities import entry_by_id
from openflexure_microscope.lock import StrictLock
from openflexure_microscope.common.lock import StrictLock
BASE_CAPTURE_PATH = os.path.join(os.path.expanduser("~"), "micrographs")
@ -94,7 +94,7 @@ class BaseCamera(metaclass=ABCMeta):
Attributes:
thread: Background thread reading frames from camera
camera: Camera object
lock (:py:class:`openflexure_microscope.lock.StrictLock`): Strict lock controlling thread
lock (:py:class:`openflexure_microscope.common.lock.StrictLock`): Strict lock controlling thread
access to stage hardware
frame (bytes): Current frame is stored here by background thread
last_access (time): Time of last client access to the camera

View file

@ -41,7 +41,7 @@ class StrictLock(object):
class CompositeLock(object):
"""
Class that behaves like a :py:class:`openflexure_microscope.lock.StrictLock`,
Class that behaves like a :py:class:`openflexure_microscope.common.lock.StrictLock`,
but allows multiple locks to be acquired and released.
Args:

View file

@ -6,15 +6,14 @@ import logging
import pkg_resources
import uuid
from .stage.base import BaseStage
from openflexure_microscope.stage.base import BaseStage
from .camera.base import BaseCamera
from openflexure_microscope.camera.base import BaseCamera
from .plugins import PluginMount
from .utilities import axes_to_array
from .task import TaskOrchestrator
from .lock import CompositeLock
from .config import OpenflexureSettingsFile, settings_to_json
from openflexure_microscope.plugins import PluginMount
from openflexure_microscope.task import TaskOrchestrator
from openflexure_microscope.common.lock import CompositeLock
from openflexure_microscope.config import OpenflexureSettingsFile, settings_to_json
class Microscope:
@ -26,7 +25,7 @@ class Microscope:
Attributes:
settings_file (:py:class:`openflexure_microscope.config.OpenflexureSettingsFile`): Runtime-config object,
automatically created if None.
lock (:py:class:`openflexure_microscope.lock.CompositeLock`): Composite lock controlling thread access
lock (:py:class:`openflexure_microscope.common.lock.CompositeLock`): Composite lock controlling thread access
to multiple pieces of hardware.
camera (:py:class:`openflexure_microscope.camera.base.BaseCamera`): Camera object
stage (:py:class:`openflexure_microscope.stage.base.BaseStage`): Stage object

View file

@ -1,11 +1,11 @@
from abc import ABCMeta, abstractmethod
from openflexure_microscope.lock import StrictLock
from openflexure_microscope.common.lock import StrictLock
class BaseStage(metaclass=ABCMeta):
"""
Attributes:
lock (:py:class:`openflexure_microscope.lock.StrictLock`): Strict lock controlling thread
lock (:py:class:`openflexure_microscope.common.lock.StrictLock`): Strict lock controlling thread
access to camera hardware
"""