From bf4cb24cb3f8dccaa3b4506395833d8537ad1499 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Wed, 11 Mar 2020 10:48:55 +0000 Subject: [PATCH] Fall back to mock stage if Sangastage is missing --- openflexure_microscope/microscope.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openflexure_microscope/microscope.py b/openflexure_microscope/microscope.py index b1d8d00d..3ed73568 100644 --- a/openflexure_microscope/microscope.py +++ b/openflexure_microscope/microscope.py @@ -88,7 +88,11 @@ class Microscope: stage_type = configuration["stage"].get("type") stage_port = configuration["stage"].get("port") 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 if not self.camera: