From 5319beb735b4d2509ea8c30ae7ee5194e1163ec9 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Fri, 6 Nov 2020 17:11:07 +0000 Subject: [PATCH] Removed port scanning warning --- openflexure_microscope/rescue/check_sangaboard.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/openflexure_microscope/rescue/check_sangaboard.py b/openflexure_microscope/rescue/check_sangaboard.py index de8c480b..13470ed2 100644 --- a/openflexure_microscope/rescue/check_sangaboard.py +++ b/openflexure_microscope/rescue/check_sangaboard.py @@ -15,17 +15,11 @@ def main(): stage_type = configuration["stage"].get("type") stage_port = configuration["stage"].get("port") - error_sources.append( - WarningSource( - "Stage serial port is not specified in configuration. Application will scan ports for a Sangaboard." - ) - ) - # If any Sangaboard-based stage is configured for use if stage_type in ("SangaBoard", "SangaStage", "SangaDeltaStage"): # Try connecting on the specified port try: - _ = Sangaboard(stage_port) + stage = Sangaboard(stage_port) except FileNotFoundError as e: if stage_port: error_sources.append( @@ -39,6 +33,8 @@ def main(): f"No {stage_type} device was found during port scanning." ) ) + else: + stage.close() else: error_sources.append( ErrorSource(