mirror of
https://github.com/bec-project/ophyd_devices.git
synced 2025-05-25 01:40:40 +02:00
fix: tie h5proxy config to properties
This commit is contained in:
parent
7abd21233f
commit
8fd17c53d7
@ -39,6 +39,7 @@ class H5ImageReplayProxy(DeviceProxy):
|
||||
|
||||
@file_source.setter
|
||||
def file_source(self, file_source: str) -> None:
|
||||
self.config[list(self.config.keys())[0]]["file_source"] = file_source
|
||||
self._file_source = file_source
|
||||
|
||||
@property
|
||||
@ -48,6 +49,7 @@ class H5ImageReplayProxy(DeviceProxy):
|
||||
|
||||
@h5_entry.setter
|
||||
def h5_entry(self, h5_entry: str) -> None:
|
||||
self.config[list(self.config.keys())[0]]["h5_entry"] = h5_entry
|
||||
self._h5_entry = h5_entry
|
||||
|
||||
def _update_device_config(self, config: dict) -> None:
|
||||
|
@ -453,6 +453,23 @@ def test_slitproxy(slitproxy_fixture):
|
||||
assert (img[:, edges[1] :] == 0).all()
|
||||
|
||||
|
||||
def test_proxy_config_and_props_stay_in_sync(h5proxy_fixture: tuple[H5ImageReplayProxy, SimCamera]):
|
||||
h5proxy, cam = h5proxy_fixture
|
||||
h5proxy._update_device_config(
|
||||
{
|
||||
cam.name: {
|
||||
"signal_name": "image",
|
||||
"file_source": "test first thing",
|
||||
"h5_entry": "/entry/data/data",
|
||||
}
|
||||
}
|
||||
)
|
||||
h5proxy.file_source = "test different thing"
|
||||
assert h5proxy.config[cam.name]["file_source"] == h5proxy.file_source
|
||||
h5proxy.h5_entry = "/entry/data/data_000001"
|
||||
assert h5proxy.config[cam.name]["h5_entry"] == h5proxy.h5_entry
|
||||
|
||||
|
||||
def test_cam_stage_h5writer(camera):
|
||||
"""Test the H5Writer class"""
|
||||
with (
|
||||
|
Loading…
x
Reference in New Issue
Block a user