Update slic/utils/pv.py
Run CI Tests / test (push) Successful in 1m29s

This commit is contained in:
2025-08-09 01:48:48 +02:00
parent 100d0c2fc1
commit 731b895f8d
+3 -15
View File
@@ -2,26 +2,15 @@ from contextlib import contextmanager
import epics
from slic.utils import typename
from slic.utils.rangebar import RangeBar
import time
class PV(epics.PV):
def __init__(self, pvname, *args, connection_timeout=2.0, **kwargs):
super().__init__(pvname, *args, **kwargs)
if not self.wait_for_connection(timeout=connection_timeout):
raise TimeoutError(f"PV {pvname} not connected in {connection_timeout}s")
def put(self, value, *args, show_progress=False, **kwargs):
if not show_progress:
# Simple put with verification
result = super().put(value, *args, **kwargs)
return result
return super().put(value, *args, **kwargs)
kwargs["wait"] = True
kwargs["wait"] = True # enforce wait to show progress
start = self.get()
stop = value
@@ -31,8 +20,7 @@ class PV(epics.PV):
rbar.show(value)
with self.use_callback(on_change):
result = super().put(stop, *args, **kwargs)
return result
return super().put(stop, *args, **kwargs)
@contextmanager