Implemented draft of new background task system
This commit is contained in:
parent
7c121cd142
commit
e4a78046d7
11 changed files with 370 additions and 159 deletions
|
|
@ -4,6 +4,7 @@ from openflexure_microscope.devel import (
|
|||
JsonResponse,
|
||||
request,
|
||||
jsonify,
|
||||
taskify
|
||||
)
|
||||
|
||||
import logging
|
||||
|
|
@ -14,7 +15,7 @@ from .recalibrate_utils import recalibrate_camera, auto_expose_and_freeze_settin
|
|||
class RecalibrateAPIView(MicroscopeViewPlugin):
|
||||
def post(self):
|
||||
logging.info("Starting microscope recalibration...")
|
||||
task = self.microscope.task.start(self.plugin.recalibrate)
|
||||
task = taskify(self.plugin.recalibrate)
|
||||
|
||||
# Return a handle on the autofocus task
|
||||
return jsonify(task.state), 202
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue