Skip to content

Commit

Permalink
fix: use the get method directly
Browse files Browse the repository at this point in the history
  • Loading branch information
maffettone committed Jan 3, 2024
1 parent 60450ff commit d69ee8f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions nslsii/motors/delta_tau.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,15 @@

from ophyd import Component as Cpt
from ophyd import Device, EpicsSignal, EpicsSignalRO, Kind
from ophyd.utils.epics_pvs import raise_if_disconnected


class PMACStatus(EpicsSignalRO):
"""
A signal to read the status of the PMAC-PC controller by checking the bit 11 of the status register.
"""

@raise_if_disconnected
def read(self):
value = self.get() >> 11 & 1 == 0
return {self.name: {"value": value, "timestamp": self.timestamp}}
def get(self):
return int(super().get() >> 11 & 1 == 0)


class PMACKillSwitch(Device):
Expand All @@ -40,3 +37,9 @@ def set(self, value, *args, **kwargs):
)
value = 1
self.kill.set(value, *args, **kwargs)

def get(self, *args, **kwargs):
"""
Get the value of the kill switch
"""
return self.status.get(*args, **kwargs)

0 comments on commit d69ee8f

Please sign in to comment.