diff --git a/slic/devices/general/motor.py b/slic/devices/general/motor.py index 095e29bc..42ccd3fe 100644 --- a/slic/devices/general/motor.py +++ b/slic/devices/general/motor.py @@ -47,7 +47,7 @@ STATUS_MESSAGES = { class Motor(Adjustable, SpecConvenienceProgress): - def __init__(self, pvname, ID=None, name=None, internal=False): + def __init__(self, pvname, ID=None, name=None, units=None, internal=False): self.pvname = pvname self._motor = motor = EpicsMotor(pvname) @@ -61,13 +61,24 @@ class Motor(Adjustable, SpecConvenienceProgress): ) ID = ID or pvname - units = self.pvs.units.value super().__init__(ID, name=name, units=units, internal=internal) self.status = None self.status_message = None + @property + def units(self): + units = self._units + if units is not None: + return units + return self.pvs.units.value + + @units.setter + def units(self, value): + self._units = value + + def get_current_value(self, readback=True, pos_type="user"): check_pos_type(pos_type) kwargs = POS_TYPE_KWARGS[pos_type]