Explicitally acquire camera lock
This commit is contained in:
parent
5c86c7f350
commit
cb441201c6
1 changed files with 11 additions and 9 deletions
|
|
@ -114,16 +114,18 @@ class ListAPI(MicroscopeView):
|
||||||
else:
|
else:
|
||||||
abort(400)
|
abort(400)
|
||||||
|
|
||||||
output = self.microscope.camera.new_image(
|
# Explicitally acquire lock (prevents empty files being created if lock is unavailable)
|
||||||
write_to_file=True,
|
with self.microscope.camera.lock:
|
||||||
temporary=temporary,
|
output = self.microscope.camera.new_image(
|
||||||
filename=filename)
|
write_to_file=True,
|
||||||
|
temporary=temporary,
|
||||||
|
filename=filename)
|
||||||
|
|
||||||
self.microscope.camera.capture(
|
self.microscope.camera.capture(
|
||||||
output,
|
output,
|
||||||
use_video_port=use_video_port,
|
use_video_port=use_video_port,
|
||||||
resize=resize,
|
resize=resize,
|
||||||
bayer=bayer)
|
bayer=bayer)
|
||||||
|
|
||||||
return jsonify(output.state)
|
return jsonify(output.state)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue