Migrated scan plugin

This commit is contained in:
Joel Collins 2019-12-18 11:06:02 +00:00
parent 480848b009
commit dee77c295a
13 changed files with 442 additions and 290 deletions

View file

@ -13,7 +13,6 @@ from openflexure_microscope.camera.mock import MockStreamer
from openflexure_microscope.utilities import serialise_array_b64
from openflexure_microscope.plugins import PluginLoader
from openflexure_microscope.task import TaskOrchestrator
from openflexure_microscope.common.lock import CompositeLock
from openflexure_microscope.config import user_settings
@ -46,9 +45,6 @@ class Microscope:
# Initialise with an empty composite lock
self.lock = CompositeLock([])
# Create a task orchestrator
self.task = TaskOrchestrator()
# Apply settings loaded from file
self.apply_settings(user_settings.load())
@ -151,26 +147,6 @@ class Microscope:
else:
return False
# Create unified state
@property
def state(self):
"""Dictionary of the basic microscope state.
Return:
dict: Dictionary containing position data,
and :py:attr:`openflexure_microscope.camera.base.BaseCamera.status`
"""
# DEPRECATED
logging.warning(
"Microscope.state is deprecated. Use Microscope.status instead. State will be removed in a future version."
)
state = {
"camera": self.camera.status,
"stage": self.stage.status,
"plugin": self.plugins.state,
"version": pkg_resources.get_distribution("openflexure_microscope").version,
}
return state
# Create unified status
@property
@ -256,22 +232,6 @@ class Microscope:
self.stage.save_settings()
user_settings.save(current_config, backup=True)
@property
def config(self) -> dict:
logging.warning(
"Reading microscope through config property is deprecated.\
Please use read_settings method instead."
)
return self.read_settings()
@config.setter
def config(self, config: dict) -> None:
logging.warning(
"Setting microscope through config property is deprecated.\
Please use apply_settings method instead."
)
self.apply_settings(config)
@property
def metadata(self):
"""