mirror of
https://github.com/bec-project/ophyd_devices.git
synced 2025-06-02 18:10:40 +02:00
refactor(fgalil): cleanup
This commit is contained in:
parent
366f592e08
commit
b9e777c14e
@ -1,4 +1,3 @@
|
|||||||
import functools
|
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
|
|
||||||
@ -7,24 +6,21 @@ from bec_lib import bec_logger
|
|||||||
from ophyd import Component as Cpt
|
from ophyd import Component as Cpt
|
||||||
from ophyd import Device, PositionerBase, Signal
|
from ophyd import Device, PositionerBase, Signal
|
||||||
from ophyd.status import wait as status_wait
|
from ophyd.status import wait as status_wait
|
||||||
from ophyd.utils import LimitError, ReadOnlyError
|
from ophyd.utils import LimitError
|
||||||
from prettytable import PrettyTable
|
|
||||||
|
|
||||||
from ophyd_devices.galil.galil_ophyd import (
|
from ophyd_devices.galil.galil_ophyd import (
|
||||||
BECConfigError,
|
BECConfigError,
|
||||||
GalilAxesReferenced,
|
GalilAxesReferenced,
|
||||||
GalilCommunicationError,
|
|
||||||
GalilController,
|
GalilController,
|
||||||
GalilError,
|
GalilError,
|
||||||
GalilMotorIsMoving,
|
GalilMotorIsMoving,
|
||||||
GalilMotorResolution,
|
GalilMotorResolution,
|
||||||
GalilReadbackSignal,
|
|
||||||
GalilSetpointSignal,
|
GalilSetpointSignal,
|
||||||
GalilSignalRO,
|
GalilSignalRO,
|
||||||
retry_once,
|
retry_once,
|
||||||
)
|
)
|
||||||
from ophyd_devices.utils.controller import Controller, threadlocked
|
from ophyd_devices.utils.controller import threadlocked
|
||||||
from ophyd_devices.utils.socket import SocketIO, SocketSignal, raise_if_disconnected
|
from ophyd_devices.utils.socket import SocketIO, raise_if_disconnected
|
||||||
|
|
||||||
logger = bec_logger.logger
|
logger = bec_logger.logger
|
||||||
|
|
||||||
@ -310,7 +306,7 @@ class FlomniGalilMotor(Device, PositionerBase):
|
|||||||
def axis_Id(self, val):
|
def axis_Id(self, val):
|
||||||
if isinstance(val, str):
|
if isinstance(val, str):
|
||||||
if len(val) != 1:
|
if len(val) != 1:
|
||||||
raise ValueError(f"Only single-character axis_Ids are supported.")
|
raise ValueError("Only single-character axis_Ids are supported.")
|
||||||
self._axis_Id_alpha = val
|
self._axis_Id_alpha = val
|
||||||
self._axis_Id_numeric = ord(val.lower()) - 97
|
self._axis_Id_numeric = ord(val.lower()) - 97
|
||||||
else:
|
else:
|
||||||
@ -324,7 +320,7 @@ class FlomniGalilMotor(Device, PositionerBase):
|
|||||||
def axis_Id_numeric(self, val):
|
def axis_Id_numeric(self, val):
|
||||||
if isinstance(val, int):
|
if isinstance(val, int):
|
||||||
if val > 26:
|
if val > 26:
|
||||||
raise ValueError(f"Numeric value exceeds supported range.")
|
raise ValueError("Numeric value exceeds supported range.")
|
||||||
self._axis_Id_alpha = val
|
self._axis_Id_alpha = val
|
||||||
self._axis_Id_numeric = (chr(val + 97)).capitalize()
|
self._axis_Id_numeric = (chr(val + 97)).capitalize()
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user