Source code for ophyd_async.fastcs.panda._control

import asyncio

from ophyd_async.core import (
    DetectorControl,
    DetectorTrigger,
    wait_for_value,
)
from ophyd_async.core._detector import TriggerInfo
from ophyd_async.core._status import AsyncStatus

from ._block import PcapBlock


[docs] class PandaPcapController(DetectorControl): def __init__(self, pcap: PcapBlock) -> None: self.pcap = pcap self._arm_status: AsyncStatus | None = None
[docs] def get_deadtime(self, exposure: float) -> float: return 0.000000008
[docs] async def prepare(self, trigger_info: TriggerInfo): assert trigger_info.trigger in ( DetectorTrigger.constant_gate, DetectorTrigger.variable_gate, ), "Only constant_gate and variable_gate triggering is supported on the PandA"
[docs] async def arm(self): self._arm_status = self.pcap.arm.set(True) await wait_for_value(self.pcap.active, True, timeout=1)
[docs] async def wait_for_idle(self): pass
[docs] async def disarm(self): await asyncio.gather(self.pcap.arm.set(False)) await wait_for_value(self.pcap.active, False, timeout=1)