Skip to content

Commit

Permalink
DEVICES.RF.BUG: Fix system_nickname property
Browse files Browse the repository at this point in the history
  • Loading branch information
murilobalves committed Oct 1, 2024
1 parent e8965a6 commit dcc245e
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions siriuspy/siriuspy/devices/rf.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,19 +589,23 @@ def __new__(cls, devname, props2init='all'):
raise NotImplementedError(devname)

if 'SI' in devname:
return _BaseLLRF(devname, props2init=props2init)
obj = _BaseLLRF(devname, props2init)
elif 'BO' in devname:
return BOLLRF(devname, props2init=props2init)
obj = _BOLLRF(devname, props2init)

@property
def system_nickname(self):
obj.system_nickname = cls.get_system_nickname(devname)
return obj

@staticmethod
def get_system_nickname(devname):
"""."""
if self.devname == ASLLRF.DEVICES.BO:
if devname == ASLLRF.DEVICES.BO:
return "BO"
if self.devname == ASLLRF.DEVICES.SIA:
return "SIA"
if self.devname == ASLLRF.DEVICES.SIB:
return "SIB"
if devname == ASLLRF.DEVICES.SIA:
return "SI-A"
if devname == ASLLRF.DEVICES.SIB:
return "SI-B"
return ""


class _BaseLLRF(_Device):
Expand Down Expand Up @@ -915,7 +919,7 @@ def cmd_reset_interlock(self, wait=1):
self['IntlkReset-Cmd'] = 0


class BOLLRF(_BaseLLRF):
class _BOLLRF(_BaseLLRF):
"""."""

# fieldflatness properties that are exclusive for P5Cav at BO
Expand Down Expand Up @@ -1148,6 +1152,7 @@ def system_nickname(self):
return "A"
if self.devname == ASLLRF.DEVICES.SIB:
return "B"
return ""

@property
def status(self):
Expand Down

0 comments on commit dcc245e

Please sign in to comment.