Skip to content

Commit

Permalink
Changes to get plans working on test rigs
Browse files Browse the repository at this point in the history
  • Loading branch information
olliesilvester authored and callumforrester committed Aug 12, 2024
1 parent 30ccd8b commit 5aef8d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/htss_rig_bluesky/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class BacklightPower(str, Enum):


class Backlight(Device):
def __init__(self, prefix: str, name: str = "") -> None:
def __init__(self, prefix: str, name: str = ""):
self.power = epics_signal_rw(BacklightPower, prefix + "State")
super().__init__(name)

Expand Down Expand Up @@ -61,14 +61,13 @@ def det(name: str = "det") -> AravisDetector:
"""

dir_prov = StaticDirectoryProvider("/exports/mybeamline/data")
det = AravisDetector(
return AravisDetector(
name=name,
prefix=f"{pv_prefix()}-EA-DET-01:",
directory_provider=dir_prov,
hdf_suffix="HDF5:",
drv_suffix="DET:",
)
return det


def beam(name: str = "beam") -> Backlight:
Expand Down
7 changes: 5 additions & 2 deletions src/htss_rig_bluesky/startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
import matplotlib
import matplotlib.pyplot as plt # noqa: F401
import numpy as np # noqa: F401
from bluesky import RunEngine
from bluesky.callbacks.best_effort import BestEffortCallback
from bluesky.run_engine import RunEngine
from dodal.utils import make_all_devices
from ophyd_async.core import DeviceCollector # noqa: F401

import htss_rig_bluesky.devices as devices
from htss_rig_bluesky.devices import beam, det, sample # noqa: F401
from htss_rig_bluesky.plans.calibration import scan_center, scan_exposure # noqa: F401
from htss_rig_bluesky.plans.detector import ( # noqa: F401
Roi,
Expand Down Expand Up @@ -46,6 +48,8 @@

matplotlib.use("QtAgg")

RE = RunEngine()

successful_devices, errors = make_all_devices(devices)
if len(errors) > 0:
print(f"The following devices failed to connect{errors}")
Expand All @@ -54,7 +58,6 @@

bec = BestEffortCallback()

RE = RunEngine()
RE.subscribe(bec)

if os.environ.get("MINIMAL", False):
Expand Down

0 comments on commit 5aef8d9

Please sign in to comment.