Updated tasks nomenclature
This commit is contained in:
parent
56051f8863
commit
24398ba7dc
27 changed files with 100 additions and 136 deletions
|
|
@ -1,9 +1,6 @@
|
|||
from labthings.server.extensions import BaseExtension
|
||||
from labthings.server.find import find_component
|
||||
from labthings.server.view import View, ActionView
|
||||
|
||||
from labthings.server.schema import Schema
|
||||
from labthings.server import fields
|
||||
from labthings.extensions import BaseExtension
|
||||
from labthings import find_component, Schema, fields, update_action_progress
|
||||
from labthings.views import View, ActionView, PropertyView
|
||||
|
||||
from flask import send_file # Used to send images from our server
|
||||
import io # Used in our capture action
|
||||
|
|
@ -12,9 +9,6 @@ import time # Used in our timelapse function
|
|||
# Used in our timelapse function
|
||||
from openflexure_microscope.captures.capture_manager import generate_basename
|
||||
|
||||
# Used to run our timelapse in a background thread
|
||||
from labthings.core.tasks import update_task_progress
|
||||
|
||||
|
||||
## Extension methods
|
||||
|
||||
|
|
@ -49,7 +43,7 @@ def timelapse(microscope, n_images, t_between):
|
|||
|
||||
# Update task progress (only does anyting if the function is running in a LabThings task)
|
||||
progress_pct = ((n + 1) / n_images) * 100 # Progress, in percent
|
||||
update_task_progress(progress_pct)
|
||||
update_action_progress(progress_pct)
|
||||
|
||||
# Wait for the specified time
|
||||
time.sleep(t_between)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue