Skip to content

Commit

Permalink
Moved the default timeout calculation earlier to re-enable multiple t…
Browse files Browse the repository at this point in the history
…riggers.
  • Loading branch information
yannachen committed Nov 22, 2024
1 parent 73fd25b commit 41c52af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/haven/devices/ion_chamber.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,15 +303,15 @@ async def trigger(self, record_dark_current=False):
if record_dark_current:
await self.record_dark_current()
return
# Calculate expected timeout value
timeout = await self.default_timeout()
# Check if we've seen this signal before
signal = self.mcs.scaler.count
last_status = self._trigger_statuses.get(signal.source)
# Previous trigger is still going, so wait for that instead
if last_status is not None and not last_status.done:
await last_status
return
# Calculate expected timeout value
timeout = await self.default_timeout()
# Nothing to wait on yet, so trigger the scaler and stash the result
st = signal.set(True, timeout=timeout)
self._trigger_statuses[signal.source] = st
Expand Down

0 comments on commit 41c52af

Please sign in to comment.