From 4e880acb8c4b1fe575abc83ec7673420bce8cea9 Mon Sep 17 00:00:00 2001 From: appleb_m Date: Wed, 18 Feb 2026 10:55:14 +0100 Subject: [PATCH] DAQ: tidy up my_motor.p --- src/aare/devices/my_motor.py | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/src/aare/devices/my_motor.py b/src/aare/devices/my_motor.py index 4ece9715..d7938948 100644 --- a/src/aare/devices/my_motor.py +++ b/src/aare/devices/my_motor.py @@ -4,6 +4,7 @@ from epics import Motor class MyMotor(Motor): + """Wrapper for the EPICS motor PV.""" def __init__(self, name, timeout=5.0): super().__init__(name.upper(), timeout=timeout) @@ -99,34 +100,3 @@ class MyMotor(Motor): await asyncio.sleep(poll_rate) if time.time() - start_time > timeout: raise RuntimeError(f"Timeout waiting for motor {self.name} to stop") - - # def pv_wait(pv: Union[PV, Motor], target: Union[str, int, float], timeout: float = 30.0, - # polling: float = 0.1, tolerance: float | None = None): - # """ - # Unified wait function for Motors and PVs (Strings, Enums, Floats). - # """ - # start_time = time.monotonic() - # end_time = start_time + timeout - # - # # Handle Motors - # if isinstance(pv, Motor): - # if tolerance is None: - # # Try to get the motor resolution/deadband - # tolerance = pv.get("RDBD") or 0.01 - # - # while time.monotonic() < end_time: - # if pv.done_moving and abs(pv.readback - target) <= tolerance: - # return - # - # raise ValueWaitTimeout( - # f"Motor {pv.name} timeout. Target: {target}, Current: {pv.readback}, Done: {pv.done_moving}" - # ) - # - # def wait_for_movement_to_finish(*motors: Motor, timeout: float = 60.0): - # """Wait for a group of motors to stop moving.""" - # start_time = time.time() - # while not all(m.done_moving for m in motors): - # if time.time() - start_time > timeout: - # moving = [m.name for m in motors if not m.done_moving] - # raise TimeoutError(f"Timeout waiting for motors: {', '.join(moving)}") - # poll(0.1) \ No newline at end of file