Loading docs/source/plugins/example/plugin.py +1 −1 Original line number Diff line number Diff line Loading @@ -142,4 +142,4 @@ class TimelapseAPI(MicroscopeViewPlugin): self.timelapse_task = taskify(self.plugin.timelapse)(n_images) # Return the state of the task (will show ID, start time, and status before the task has finished) return jsonify(self.timelapse_task.state), 202 return jsonify(self.timelapse_task.state), 201 docs/source/plugins/hardware.rst +2 −2 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ An example of a long running task may look like: def post(self): # Attach the long-running method as a microscope task self.my_task = taskify(self.plugin.long_running_function)() return jsonify(self.my_task.state), 202 return jsonify(self.my_task.state), 201 After some time, once the task has completed, it could be retreived using: Loading Loading @@ -132,7 +132,7 @@ For example, a timelapse plugin may look like: self.timelapse_task = taskify(self.plugin.timelapse)(n_images) # Return the state of the task (will show ID, start time, and status before the task has finished) return jsonify(self.timelapse_task.state), 202 return jsonify(self.timelapse_task.state), 201 Notice that even though we never use the stage here, we still acquire the lock. This means that during the timelapse, Loading openflexure_microscope/plugins/default/autofocus/api.py +2 −2 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ class AutofocusAPI(MicroscopeViewPlugin): task = taskify(self.plugin.autofocus)(dz) # return a handle on the autofocus task return jsonify(task.state), 202 return jsonify(task.state), 201 else: abort(503, "No stage connected. Unable to autofocus.") Loading @@ -50,7 +50,7 @@ class FastAutofocusAPI(MicroscopeViewPlugin): task = taskify(self.plugin.fast_autofocus)(dz, backlash=backlash) # return a handle on the autofocus task return jsonify(task.state), 202 return jsonify(task.state), 201 else: abort(503, "No stage connected. Unable to autofocus.") openflexure_microscope/plugins/default/camera_calibration/plugin.py +1 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ class RecalibrateAPIView(MicroscopeViewPlugin): task = taskify(self.plugin.recalibrate)() # Return a handle on the autofocus task return jsonify(task.state), 202 return jsonify(task.state), 201 class Plugin(MicroscopePlugin): Loading openflexure_microscope/plugins/default/scan/api.py +1 −1 Original line number Diff line number Diff line Loading @@ -60,4 +60,4 @@ class TileScanAPI(MicroscopeViewPlugin): ) # return a handle on the scan task return jsonify(task.state), 202 return jsonify(task.state), 201 Loading
docs/source/plugins/example/plugin.py +1 −1 Original line number Diff line number Diff line Loading @@ -142,4 +142,4 @@ class TimelapseAPI(MicroscopeViewPlugin): self.timelapse_task = taskify(self.plugin.timelapse)(n_images) # Return the state of the task (will show ID, start time, and status before the task has finished) return jsonify(self.timelapse_task.state), 202 return jsonify(self.timelapse_task.state), 201
docs/source/plugins/hardware.rst +2 −2 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ An example of a long running task may look like: def post(self): # Attach the long-running method as a microscope task self.my_task = taskify(self.plugin.long_running_function)() return jsonify(self.my_task.state), 202 return jsonify(self.my_task.state), 201 After some time, once the task has completed, it could be retreived using: Loading Loading @@ -132,7 +132,7 @@ For example, a timelapse plugin may look like: self.timelapse_task = taskify(self.plugin.timelapse)(n_images) # Return the state of the task (will show ID, start time, and status before the task has finished) return jsonify(self.timelapse_task.state), 202 return jsonify(self.timelapse_task.state), 201 Notice that even though we never use the stage here, we still acquire the lock. This means that during the timelapse, Loading
openflexure_microscope/plugins/default/autofocus/api.py +2 −2 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ class AutofocusAPI(MicroscopeViewPlugin): task = taskify(self.plugin.autofocus)(dz) # return a handle on the autofocus task return jsonify(task.state), 202 return jsonify(task.state), 201 else: abort(503, "No stage connected. Unable to autofocus.") Loading @@ -50,7 +50,7 @@ class FastAutofocusAPI(MicroscopeViewPlugin): task = taskify(self.plugin.fast_autofocus)(dz, backlash=backlash) # return a handle on the autofocus task return jsonify(task.state), 202 return jsonify(task.state), 201 else: abort(503, "No stage connected. Unable to autofocus.")
openflexure_microscope/plugins/default/camera_calibration/plugin.py +1 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ class RecalibrateAPIView(MicroscopeViewPlugin): task = taskify(self.plugin.recalibrate)() # Return a handle on the autofocus task return jsonify(task.state), 202 return jsonify(task.state), 201 class Plugin(MicroscopePlugin): Loading
openflexure_microscope/plugins/default/scan/api.py +1 −1 Original line number Diff line number Diff line Loading @@ -60,4 +60,4 @@ class TileScanAPI(MicroscopeViewPlugin): ) # return a handle on the scan task return jsonify(task.state), 202 return jsonify(task.state), 201