Skip to content

Commit

Permalink
Add pulses and sources to Zebra device (#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
noemifrisina authored Feb 14, 2024
1 parent 5b8ef3e commit 10a16f9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
19 changes: 18 additions & 1 deletion src/dodal/devices/zebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
AND4 = 35
OR1 = 36
PULSE1 = 52
PULSE2 = 53
SOFT_IN1 = 60
SOFT_IN2 = 61
SOFT_IN3 = 62

# Instrument specific
Expand Down Expand Up @@ -66,6 +69,11 @@ class ArmDemand(IntEnum):
DISARM = 0


class FastShutterAction(IntEnum):
OPEN = 1
CLOSE = 0


class ArmingDevice(Device):
"""A useful device that can abstract some of the logic of arming.
Allows a user to just call arm.set(ArmDemand.ARM)"""
Expand All @@ -90,12 +98,14 @@ class PositionCompare(Device):
gate_input = epics_signal_put_wait("PC_GATE_INP")
gate_width = epics_signal_put_wait("PC_GATE_WID")
gate_start = epics_signal_put_wait("PC_GATE_START")
gate_step = epics_signal_put_wait("PC_GATE_STEP")

pulse_source = epics_signal_put_wait("PC_PULSE_SEL")
pulse_input = epics_signal_put_wait("PC_PULSE_INP")
pulse_start = epics_signal_put_wait("PC_PULSE_START")
pulse_width = epics_signal_put_wait("PC_PULSE_WID")
pulse_step = epics_signal_put_wait("PC_PULSE_STEP")
pulse_max = epics_signal_put_wait("PC_PULSE_MAX")

dir = Component(EpicsSignal, "PC_DIR")
arm_source = epics_signal_put_wait("PC_ARM_SEL")
Expand All @@ -107,8 +117,15 @@ def is_armed(self) -> bool:
return self.arm.armed.get() == 1


class PulseOutput(Device):
input = epics_signal_put_wait("_INP")
delay = epics_signal_put_wait("_DLY")
width = epics_signal_put_wait("_WID")


class ZebraOutputPanel(Device):
pulse_1_input = epics_signal_put_wait("PULSE1_INP")
pulse_1 = Component(PulseOutput, "PULSE1")
pulse_2 = Component(PulseOutput, "PULSE2")

out_1 = epics_signal_put_wait("OUT1_TTL")
out_2 = epics_signal_put_wait("OUT2_TTL")
Expand Down
2 changes: 1 addition & 1 deletion tests/beamlines/unit_tests/test_i24.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ def test_device_creation():


def teardown_module():
beamline_utils.set_beamline("i03")
beamline_utils.set_beamline("i24")
beamline_utils.clear_devices()

0 comments on commit 10a16f9

Please sign in to comment.