Closing microscope checks if hardware is attached

This commit is contained in:
Joel Collins 2018-12-04 15:15:09 +00:00
parent f42dcf8b95
commit 88647962f4

View file

@ -42,8 +42,10 @@ class Microscope(object):
def close(self):
"""Shut down the microscope hardware."""
self.camera.close()
self.stage.close()
if self.camera:
self.camera.close()
if self.stage:
self.stage.close()
def attach(self, camera: StreamingCamera, stage: OpenFlexureStage, apply_config: bool=True):
"""