Implemented root API v2 routes

This commit is contained in:
jtc42 2019-11-14 16:33:00 +00:00
parent 5aa783c269
commit 6581612312
27 changed files with 1205 additions and 148 deletions

View file

@ -37,10 +37,10 @@ class Plugin(MicroscopePlugin):
"""
scamera = self.microscope.camera
with scamera.lock:
assert not scamera.state[
assert not scamera.status[
"record_active"
], "Can't recalibrate while recording!"
streaming = scamera.state["stream_active"]
streaming = scamera.status["stream_active"]
if streaming:
logging.info("Stopping stream before recalibration")
scamera.stop_stream_recording(resolution=(640, 480))
@ -51,7 +51,7 @@ class Plugin(MicroscopePlugin):
recalibrate_camera(scamera.camera)
finally:
scamera.camera.resolution = old_resolution
self.microscope.save_config()
self.microscope.save_settings()
if streaming:
logging.info("Restarting stream after recalibration")
scamera.start_stream_recording()