Fall back to mock stage if Sangastage is missing

This commit is contained in:
Joel Collins 2020-03-11 10:48:55 +00:00
parent 465e52d705
commit bf4cb24cb3

View file

@ -88,7 +88,11 @@ class Microscope:
stage_type = configuration["stage"].get("type") stage_type = configuration["stage"].get("type")
stage_port = configuration["stage"].get("port") stage_port = configuration["stage"].get("port")
if stage_type in ("SangaBoard", "SangaStage"): if stage_type in ("SangaBoard", "SangaStage"):
self.stage = SangaStage(port=stage_port) try:
self.stage = SangaStage(port=stage_port)
except Exception as e:
logging.error(e)
logging.warning("No compatible Sangaboard hardware found.")
### Fallbacks ### Fallbacks
if not self.camera: if not self.camera: