Updated tasks nomenclature
This commit is contained in:
parent
56051f8863
commit
24398ba7dc
27 changed files with 100 additions and 136 deletions
|
|
@ -1,8 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
from labthings.server import monkey
|
||||
|
||||
monkey.patch_all()
|
||||
|
||||
import sys
|
||||
import time
|
||||
import atexit
|
||||
|
|
@ -37,8 +33,8 @@ from openflexure_microscope.paths import (
|
|||
logs_file_path,
|
||||
)
|
||||
|
||||
from labthings.server.quick import create_app
|
||||
from labthings.server.extensions import find_extensions
|
||||
from labthings import create_app
|
||||
from labthings.extensions import find_extensions
|
||||
|
||||
from openflexure_microscope.api.microscope import default_microscope as api_microscope
|
||||
|
||||
|
|
@ -205,7 +201,7 @@ atexit.register(cleanup)
|
|||
|
||||
# Start the app
|
||||
if __name__ == "__main__":
|
||||
from labthings.server.wsgi import Server
|
||||
from labthings import Server
|
||||
logging.info("Starting OpenFlexure Microscope Server...")
|
||||
server = Server(app)
|
||||
server.run(host="::", port=5000, debug=False, zeroconf=True)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
from labthings.server.find import find_component
|
||||
from labthings.server.extensions import BaseExtension
|
||||
from labthings.server.view import View, ActionView, PropertyView
|
||||
from labthings.server import fields
|
||||
from labthings import fields, find_component
|
||||
from labthings.extensions import BaseExtension
|
||||
from labthings.views import View, ActionView, PropertyView
|
||||
|
||||
from openflexure_microscope.devel import JsonResponse, request, abort
|
||||
from openflexure_microscope.utilities import set_properties
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
from labthings.server.extensions import BaseExtension
|
||||
from labthings.server.view import View, PropertyView
|
||||
from labthings.server import fields
|
||||
from labthings.server.find import find_component
|
||||
from labthings.extensions import BaseExtension
|
||||
from labthings.views import View, PropertyView
|
||||
from labthings import fields, find_component
|
||||
|
||||
from openflexure_microscope.paths import settings_file_path, check_rw
|
||||
from openflexure_microscope.config import OpenflexureSettingsFile
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from labthings.server.view import View, ActionView
|
||||
from labthings.server.find import find_component
|
||||
from labthings.server.extensions import BaseExtension
|
||||
from labthings import find_component
|
||||
from labthings.views import View, ActionView
|
||||
from labthings.extensions import BaseExtension
|
||||
|
||||
from flask import abort
|
||||
|
||||
|
|
|
|||
|
|
@ -6,14 +6,13 @@ from typing import Tuple
|
|||
from functools import reduce
|
||||
|
||||
from openflexure_microscope.captures.capture_manager import generate_basename
|
||||
from labthings.server.find import find_component, find_extension
|
||||
from labthings.server.extensions import BaseExtension
|
||||
from labthings.server import fields
|
||||
from labthings.actions import current_action
|
||||
|
||||
from openflexure_microscope.devel import abort, update_task_progress
|
||||
from labthings import fields, find_component, find_extension, current_action, update_action_progress
|
||||
from labthings.views import View, ActionView
|
||||
from labthings.extensions import BaseExtension
|
||||
|
||||
from openflexure_microscope.devel import abort
|
||||
|
||||
from labthings.server.view import View, ActionView
|
||||
import time
|
||||
|
||||
|
||||
|
|
@ -209,7 +208,7 @@ class ScanExtension(BaseExtension):
|
|||
)
|
||||
# Update task progress
|
||||
self._images_captured_so_far += 1
|
||||
update_task_progress(self.progress())
|
||||
update_action_progress(self.progress())
|
||||
else:
|
||||
logging.debug("Entering z-stack")
|
||||
self.stack(
|
||||
|
|
@ -279,7 +278,7 @@ class ScanExtension(BaseExtension):
|
|||
)
|
||||
# Update task progress
|
||||
self._images_captured_so_far += 1
|
||||
update_task_progress(self.progress())
|
||||
update_action_progress(self.progress())
|
||||
if current_action() and current_action().stopped:
|
||||
return
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
from openflexure_microscope.devel import (
|
||||
JsonResponse,
|
||||
request,
|
||||
update_task_progress,
|
||||
)
|
||||
|
||||
from flask import send_file, abort, url_for
|
||||
|
|
@ -12,12 +11,11 @@ import zipfile
|
|||
import tempfile
|
||||
import logging
|
||||
|
||||
from labthings.server.find import find_component
|
||||
from labthings.server.view import View, ActionView, PropertyView
|
||||
from labthings.server.schema import Schema, pre_dump
|
||||
from labthings.server import fields
|
||||
from labthings.server.extensions import BaseExtension
|
||||
from labthings.server.utilities import description_from_view
|
||||
from labthings import fields, find_component, update_action_progress
|
||||
from labthings.views import View, ActionView, PropertyView
|
||||
from labthings.schema import Schema, pre_dump
|
||||
from labthings.extensions import BaseExtension
|
||||
from labthings.utilities import description_from_view
|
||||
|
||||
|
||||
class ZipObjectSchema(Schema):
|
||||
|
|
@ -107,7 +105,7 @@ class ZipManager:
|
|||
)
|
||||
zipObj.write(file_path, arcname=rel_path)
|
||||
# Update task progress
|
||||
update_task_progress(int((index / n_files) * 100))
|
||||
update_action_progress(int((index / n_files) * 100))
|
||||
|
||||
session_id = str(uuid.uuid4())
|
||||
session_description = ZipObjectDescription(
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
from labthings.server.extensions import BaseExtension
|
||||
from labthings.server.view import ActionView
|
||||
|
||||
from labthings.server import fields
|
||||
from labthings import fields
|
||||
from labthings.extensions import BaseExtension
|
||||
from labthings.views import ActionView
|
||||
|
||||
import logging
|
||||
import time
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ Top-level representation of enabled actions
|
|||
from flask import url_for
|
||||
from . import camera, stage, system
|
||||
|
||||
from labthings.server.view import View
|
||||
from labthings.server.find import current_labthing
|
||||
from labthings.server.utilities import description_from_view
|
||||
from labthings import current_labthing
|
||||
from labthings.views import View
|
||||
from labthings.utilities import description_from_view
|
||||
|
||||
_actions = {
|
||||
"capture": {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
from openflexure_microscope.api.utilities import get_bool, JsonResponse
|
||||
from labthings.server.view import View, ActionView
|
||||
from labthings.server.find import find_component
|
||||
from labthings.views import View, ActionView
|
||||
from labthings import find_component, fields
|
||||
|
||||
from labthings.server import fields
|
||||
from openflexure_microscope.utilities import filter_dict
|
||||
|
||||
from openflexure_microscope.api.v2.views.captures import CaptureSchema
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
from openflexure_microscope.api.utilities import JsonResponse
|
||||
from labthings.server.view import View, ActionView
|
||||
from labthings.server.find import find_component
|
||||
from labthings.server import fields
|
||||
from labthings.views import View, ActionView
|
||||
from labthings import find_component, fields
|
||||
|
||||
from openflexure_microscope.utilities import axes_to_array, filter_dict
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from labthings.server.view import View, ActionView
|
||||
from labthings.views import View, ActionView
|
||||
import subprocess
|
||||
import os
|
||||
from sys import platform
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
from openflexure_microscope.api.utilities import JsonResponse
|
||||
|
||||
from labthings.core.utilities import get_by_path, set_by_path, create_from_path
|
||||
|
||||
from labthings.server.find import find_component
|
||||
from labthings.server.view import View, PropertyView
|
||||
from labthings import find_component
|
||||
from labthings.views import View, PropertyView
|
||||
from labthings.utilities import get_by_path, set_by_path, create_from_path
|
||||
|
||||
from flask import request, abort
|
||||
import logging
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
from openflexure_microscope.api.utilities import gen, JsonResponse
|
||||
|
||||
from labthings.core.utilities import get_by_path, set_by_path, create_from_path
|
||||
from labthings import find_component
|
||||
from labthings.utilities import get_by_path, set_by_path, create_from_path
|
||||
from labthings.views import View, PropertyView
|
||||
|
||||
from labthings.server.find import find_component
|
||||
from labthings.server.view import View, PropertyView
|
||||
from labthings.server.responses import Response
|
||||
from flask import Response
|
||||
|
||||
|
||||
class MjpegStream(PropertyView):
|
||||
|
|
|
|||
|
|
@ -9,9 +9,7 @@ import threading
|
|||
|
||||
from abc import ABCMeta, abstractmethod
|
||||
|
||||
|
||||
from labthings.core.lock import StrictLock
|
||||
from labthings.core.event import ClientEvent
|
||||
from labthings import StrictLock, ClientEvent
|
||||
|
||||
|
||||
class BaseCamera(metaclass=ABCMeta):
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import shutil
|
|||
import logging
|
||||
from collections import OrderedDict
|
||||
|
||||
from labthings.core.lock import StrictLock
|
||||
from labthings import StrictLock
|
||||
|
||||
from openflexure_microscope.utilities import entry_by_uuid
|
||||
from openflexure_microscope.paths import data_file_path
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ as well as some Flask imports to simplify API route development
|
|||
from openflexure_microscope.api.utilities import JsonResponse
|
||||
|
||||
# Task management
|
||||
from labthings.core.tasks import (
|
||||
current_task,
|
||||
update_task_progress,
|
||||
update_task_data,
|
||||
from labthings import (
|
||||
current_action as current_task,
|
||||
update_action_progress as update_task_progress,
|
||||
update_action_data as update_task_data,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ from openflexure_microscope.camera.mock import MissingCamera
|
|||
from openflexure_microscope.utilities import serialise_array_b64, Timer
|
||||
from openflexure_microscope.config import user_settings, user_configuration
|
||||
|
||||
from labthings.core.lock import CompositeLock
|
||||
from labthings import CompositeLock
|
||||
|
||||
|
||||
class Microscope:
|
||||
|
|
@ -49,7 +49,7 @@ class Microscope:
|
|||
self.extension_settings = {}
|
||||
|
||||
# Initialise with an empty composite lock
|
||||
#: :py:class:`labthings.lock.CompositeLock`: Composite lock for locking both camera and stage
|
||||
#: :py:class:`labthings.CompositeLock`: Composite lock for locking both camera and stage
|
||||
self.lock = CompositeLock([])
|
||||
|
||||
self.camera = None #: Currently connected camera object
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import numpy as np
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from labthings.core.lock import StrictLock
|
||||
from labthings import StrictLock
|
||||
|
||||
|
||||
class BaseStage(metaclass=ABCMeta):
|
||||
"""
|
||||
Attributes:
|
||||
lock (:py:class:`labthings.lock.StrictLock`): Strict lock controlling thread
|
||||
lock (:py:class:`labthings.StrictLock`): Strict lock controlling thread
|
||||
access to camera hardware
|
||||
"""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue