mirror of
https://github.com/bec-project/ophyd_devices.git
synced 2026-02-20 17:28:42 +01:00
wip improve status and tests
This commit is contained in:
@@ -199,8 +199,9 @@ class PSIDeviceBase(Device):
|
|||||||
to be stopped when the device is stopped.
|
to be stopped when the device is stopped.
|
||||||
"""
|
"""
|
||||||
for status in self._stoppable_status_objects:
|
for status in self._stoppable_status_objects:
|
||||||
if not status.done:
|
with status._lock:
|
||||||
status.set_exception(DeviceStoppedError(f"Device {self.name} has been stopped"))
|
if not status.done:
|
||||||
|
status.set_exception(DeviceStoppedError(f"Device {self.name} has been stopped"))
|
||||||
self._clear_stoppable_status_objects()
|
self._clear_stoppable_status_objects()
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ def patch_dual_pvs(device):
|
|||||||
continue
|
continue
|
||||||
if walk.item._read_pv.pvname != walk.item._write_pv.pvname:
|
if walk.item._read_pv.pvname != walk.item._write_pv.pvname:
|
||||||
walk.item._read_pv = walk.item._write_pv
|
walk.item._read_pv = walk.item._write_pv
|
||||||
|
if walk.item.pvname != walk.item.setpoint_pvname:
|
||||||
|
walk.item._setpoint_pvname = walk.item.pvname
|
||||||
|
|
||||||
|
|
||||||
def patch_functions_required_for_connection(device):
|
def patch_functions_required_for_connection(device):
|
||||||
@@ -288,7 +290,8 @@ class MockPV:
|
|||||||
as_namespace=False,
|
as_namespace=False,
|
||||||
):
|
):
|
||||||
"""Get MOCKPV data together with metadata"""
|
"""Get MOCKPV data together with metadata"""
|
||||||
|
if as_string:
|
||||||
|
return {"value": str(self.mock_data)}
|
||||||
return {"value": self.mock_data}
|
return {"value": self.mock_data}
|
||||||
|
|
||||||
def get(
|
def get(
|
||||||
|
|||||||
Reference in New Issue
Block a user