From c866385c77e3f0e4f9612ba70009174dcf89b864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20S=C3=A1nchez-Gallego?= Date: Tue, 28 May 2024 15:40:21 -0700 Subject: [PATCH] Check if configuration has been observed in auto-pilot preload --- CHANGELOG.md | 7 +++++++ src/hal/macros/auto_pilot.py | 9 ++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3534824..72e539c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## Next version + +### 🔧 Fixed + +* Fix an issue with the new auto-pilot loading a new design during an exposure when a fully loaded one was available. + + ## 1.2.0 - May 26th, 2024 ### 🚀 New diff --git a/src/hal/macros/auto_pilot.py b/src/hal/macros/auto_pilot.py index c7c7787..127e83b 100644 --- a/src/hal/macros/auto_pilot.py +++ b/src/hal/macros/auto_pilot.py @@ -107,10 +107,13 @@ async def prepare(self): if self.system_state.boss_exposure_state is None: raise MacroError("Cannot determine BOSS exposure state.") - time_remaining = self.system_state.exposure_time_remaining - if time_remaining > 0: + # Is there a configuration loaded and has it been observed? + configuration = self.helpers.jaeger.configuration + observed = configuration and configuration.observed + + if self.system_state.exposure_time_remaining > 0: # We are exposing. - if self.helpers.jaeger.preloaded: + if self.helpers.jaeger.preloaded or not observed: # There is already a preloaded configuration. Just wait # until the exposure is done. self._auto_pilot_message("Waiting for exposure before loading design")