Skip to content

Commit

Permalink
Pressure jump adc initial attempt based on area detector.
Browse files Browse the repository at this point in the history
  • Loading branch information
barnettwilliam committed Sep 17, 2024
1 parent 1c77f3c commit 4456dd2
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/dodal/beamlines/p38.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from dodal.devices.i22.fswitch import FSwitch
from dodal.devices.linkam3 import Linkam3
from dodal.devices.pressure_jump_cell import PressureJumpCell
from dodal.devices.pressure_jump_cell_adc import PressureJumpCellADC, PressureJumpAdcConfigParams
from dodal.devices.slits import Slits
from dodal.devices.tetramm import TetrammDetector
from dodal.devices.undulator import Undulator
Expand Down Expand Up @@ -333,3 +334,17 @@ def high_pressure_xray_cell(
cell_prefix="-HPXC-01:",
adc_prefix="-ADC",
)

def high_pressure_xray_cell_adc(
wait_for_connection: bool = True,
fake_with_ophyd_sim: bool = False,
params: PressureJumpAdcConfigParams | None = None,
) -> PressureJumpCellADC:
return device_instantiation(
PressureJumpCellADC,
"high_pressure_xray_cell_adc",
"",
wait_for_connection,
fake_with_ophyd_sim,
params=params or None,
)
63 changes: 63 additions & 0 deletions src/dodal/devices/pressure_jump_cell_adc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
from enum import Enum
from functools import partial

from ophyd_async.core import (
ConfigSignal,
DeviceVector,
SignalR,
StandardReadable,
)
from ophyd_async.epics.signal import epics_signal_r, epics_signal_rw

from ophyd import ADComponent as ADC
from ophyd import (
AreaDetector,
CamBase,
Component,
Device,
EpicsSignal,
HDF5Plugin,
OverlayPlugin,
ProcessPlugin,
ROIPlugin,
StatsPlugin,
Signal,
StatusBase,
)

class PressureJumpAdcConfigParams:
pass

class PressureJumpCellADC(AreaDetector):
"""
High pressure X-ray cell fast ADC, used to capture pressure jumps.
"""
cam = ADC(CamBase, "-EA-HPXC-01:CAM:")
scale = ADC(ROIPlugin, "-EA-HPXC-01:SCALE:")
# trig = # TODO support module adUtil NDPluginReframe?
# arr = # TODO support module ADCore NDPluginStdArrays? required?
hdf5 = ADC(HDF5Plugin, "-DI-OAV-01:HDF5:")

p1Roi = ADC(ROIPlugin, "-EA-HPXC-01:ROIP1:")
p1Proc = ADC(ProcessPlugin, "-EA-HPXC-01:PROCP1:")
p1Stats = ADC(StatsPlugin, "-EA-HPXC-01:STATP1:")

p2Roi = ADC(ROIPlugin, "-EA-HPXC-01:ROIP2:")
p2Proc = ADC(ProcessPlugin, "-EA-HPXC-01:PROCP2:")
p2Stats = ADC(StatsPlugin, "-EA-HPXC-01:STATP2:")

p3Roi = ADC(ROIPlugin, "-EA-HPXC-01:ROIP3:")
p3Proc = ADC(ProcessPlugin, "-EA-HPXC-01:PROCP3:")
p3Stats = ADC(StatsPlugin, "-EA-HPXC-01:STATP3:")

def __init__(self, *args, params: PressureJumpAdcConfigParams, **kwargs):
super().__init__(*args, **kwargs)
self.parameters = params
self.snapshot.oav_params = params
self.subscription_id = None
self._snapshot_trigger_subscription_id = None

Check warning on line 58 in src/dodal/devices/pressure_jump_cell_adc.py

View check run for this annotation

Codecov / codecov/patch

src/dodal/devices/pressure_jump_cell_adc.py#L57-L58

Added lines #L57 - L58 were not covered by tests

def wait_for_connection(self, all_signals=False, timeout=2):
connected = super().wait_for_connection(all_signals, timeout)
return connected

Check warning on line 62 in src/dodal/devices/pressure_jump_cell_adc.py

View check run for this annotation

Codecov / codecov/patch

src/dodal/devices/pressure_jump_cell_adc.py#L61-L62

Added lines #L61 - L62 were not covered by tests

0 comments on commit 4456dd2

Please sign in to comment.