mirror of
https://github.com/bec-project/ophyd_devices.git
synced 2025-05-25 09:50:41 +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
|
@file_source.setter
|
||||||
def file_source(self, file_source: str) -> None:
|
def file_source(self, file_source: str) -> None:
|
||||||
|
self.config[list(self.config.keys())[0]]["file_source"] = file_source
|
||||||
self._file_source = file_source
|
self._file_source = file_source
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -48,6 +49,7 @@ class H5ImageReplayProxy(DeviceProxy):
|
|||||||
|
|
||||||
@h5_entry.setter
|
@h5_entry.setter
|
||||||
def h5_entry(self, h5_entry: str) -> None:
|
def h5_entry(self, h5_entry: str) -> None:
|
||||||
|
self.config[list(self.config.keys())[0]]["h5_entry"] = h5_entry
|
||||||
self._h5_entry = h5_entry
|
self._h5_entry = h5_entry
|
||||||
|
|
||||||
def _update_device_config(self, config: dict) -> None:
|
def _update_device_config(self, config: dict) -> None:
|
||||||
|
@ -453,6 +453,23 @@ def test_slitproxy(slitproxy_fixture):
|
|||||||
assert (img[:, edges[1] :] == 0).all()
|
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):
|
def test_cam_stage_h5writer(camera):
|
||||||
"""Test the H5Writer class"""
|
"""Test the H5Writer class"""
|
||||||
with (
|
with (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user