Skip to content

Commit

Permalink
Move trigger logic into dedicated plan stub (#175)
Browse files Browse the repository at this point in the history
This streamlines the preparation of the flyer and any detectors by delegating the responsibility for making TriggerInfo (required by detectors) and sequence tables (required by the TriggerLogic in the flyer to a plan stub. This can be called within a plan to prepare a flyer and many detectors. This is a specific use case and more will need to be made for different situations.
  • Loading branch information
abbiemery authored and evalott100 committed Apr 12, 2024
1 parent b1d148d commit 7d601de
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ophyd_async/panda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@
"TimeUnits",
"DataBlock",
"CommonPandABlocks",
"TimeUnits",
]
22 changes: 22 additions & 0 deletions tests/triggers/test_static_seq_table_trigger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import pytest

from ophyd_async.core.device import DeviceCollector
from ophyd_async.panda import PandA
from ophyd_async.panda.trigger import StaticSeqTableTriggerLogic


@pytest.fixture
async def panda():
async with DeviceCollector(sim=True):
sim_panda = PandA("PANDAQSRV:", "sim_panda")

assert sim_panda.name == "sim_panda"
yield sim_panda


def test_trigger_logic_has_given_methods(panda: PandA):
trigger_logic = StaticSeqTableTriggerLogic(panda.seq[1])
assert hasattr(trigger_logic, "prepare")
assert hasattr(trigger_logic, "kickoff")
assert hasattr(trigger_logic, "complete")
assert hasattr(trigger_logic, "stop")

0 comments on commit 7d601de

Please sign in to comment.