Skip to content

Commit

Permalink
Correctly set the configuration that has been observed
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed May 28, 2024
1 parent c866385 commit 82cb06e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### 🔧 Fixed

* Fix an issue with the new auto-pilot loading a new design during an exposure when a fully loaded one was available.
* Correctly set the observed configuration if the a new one has been loaded.


## 1.2.0 - May 26th, 2024
Expand Down
2 changes: 1 addition & 1 deletion src/hal/actor/commands/auto_pilot.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ async def auto_pilot(
break

await asyncio.sleep(0.1)

break
if macro.cancelled:
# Cancelled macros return result=True
break
Expand Down
15 changes: 13 additions & 2 deletions src/hal/macros/expose.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,19 @@
from dataclasses import dataclass
from time import time

from typing import TYPE_CHECKING

import numpy

from hal import config
from hal.exceptions import MacroError
from hal.macros import Macro


if TYPE_CHECKING:
from hal.helpers.jaeger import Configuration


__all__ = ["ExposeMacro"]


Expand Down Expand Up @@ -430,6 +436,11 @@ class ExposeMacro(Macro):
expose_helper: ExposeHelper
_pause_event = asyncio.Event()

def __init__(self):
super().__init__()

self.configuration: Configuration | None = None

def _reset_internal(self, **opts):
"""Reset the exposure status."""

Expand Down Expand Up @@ -601,8 +612,8 @@ async def cleanup(self):
else:
self.command.warning("BOSS exposure is running. Not cancelling it.")

if not self.failed and not self.cancelled and self.helpers.jaeger.configuration:
self.helpers.jaeger.configuration.observed = True
if not self.failed and not self.cancelled and self.configuration:
self.configuration.observed = True

async def _pause(self):
"""Pauses the execution of the macro."""
Expand Down

0 comments on commit 82cb06e

Please sign in to comment.