From f2e63c2c55d49ed35cef73531be7d4bcceb42546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Malinowski?= <56644812+stan-dot@users.noreply.github.com> Date: Tue, 1 Oct 2024 11:01:27 +0100 Subject: [PATCH] 707 add visr b01 1 as a beamline with devices (#708) * b01-1 draft * trying to conntect a panda * fix pv value * delete panda2 * fix the values * fix panda missing colon * fix ruff * another ruff change * respond to PR feedback * switch up the module name to be valid Python * respond to the ophyd-async changes * fix imports * for visr allow overriding the pv * remove print * directly set the beamline name * note explaining connection only on the bl network --- src/dodal/beamlines/b01_1.py | 77 ++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 src/dodal/beamlines/b01_1.py diff --git a/src/dodal/beamlines/b01_1.py b/src/dodal/beamlines/b01_1.py new file mode 100644 index 0000000000..abc4e91b27 --- /dev/null +++ b/src/dodal/beamlines/b01_1.py @@ -0,0 +1,77 @@ +from pathlib import Path + +from ophyd_async.epics.adaravis import AravisDetector +from ophyd_async.fastcs.panda import HDFPanda + +from dodal.common.beamlines.beamline_utils import ( + device_instantiation, + get_path_provider, + set_path_provider, +) +from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline +from dodal.common.visit import LocalDirectoryServiceClient, StaticVisitPathProvider +from dodal.devices.synchrotron import Synchrotron +from dodal.log import set_beamline as set_log_beamline + +BL = "c01" +set_log_beamline(BL) +set_utils_beamline(BL) + +set_path_provider( + StaticVisitPathProvider( + BL, + Path("/dls/b01-1/data/"), + client=LocalDirectoryServiceClient(), + ) +) + +""" +NOTE: Due to ArgoCD and the k8s cluster configuration those PVs are not available remotely. +You need to be on the beamline-local network to access them. +The simplest way to do this is to `ssh b01-1-ws001` and run `dodal connect b01_1` from there. +remember about the underscore in the beamline name. + +See the IOC status here: +https://argocd.diamond.ac.uk/applications?showFavorites=false&proj=&sync=&autoSync=&health=&namespace=&cluster=&labels= +""" + + +def panda( + wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False +) -> HDFPanda: + return device_instantiation( + device_factory=HDFPanda, + name="panda", + prefix="-EA-PANDA-01:", + wait=wait_for_connection, + fake=fake_with_ophyd_sim, + path_provider=get_path_provider(), + ) + + +def synchrotron( + wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False +) -> Synchrotron: + return device_instantiation( + Synchrotron, + "synchrotron", + "", + wait_for_connection, + fake_with_ophyd_sim, + bl_prefix=False, + ) + + +def manta( + wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False +) -> AravisDetector: + return device_instantiation( + AravisDetector, + "manta", + "-DI-DCAM-02:", + wait_for_connection, + fake_with_ophyd_sim, + path_provider=get_path_provider(), + drv_suffix="CAM:", + hdf_suffix="HDF5:", + )