Skip to content

Commit

Permalink
Merge pull request #1135 from slaclab/fix-PR1132
Browse files Browse the repository at this point in the history
bug fix for AxiSysMonUltraScale.py & Xadc.py when simpleViewList=None
  • Loading branch information
ruck314 authored Feb 15, 2024
2 parents 3526d48 + abd7355 commit 0060ce2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
19 changes: 10 additions & 9 deletions python/surf/xilinx/_AxiSysMonUltraScale.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ def __init__(
**kwargs):
super().__init__(description=description, **kwargs)

self.simpleViewList = simpleViewList[:]
if simpleViewList is not None:
self.simpleViewList = simpleViewList[:]
self.simpleViewList.append('enable')

def addPair(name, offset, bitSize, units, bitOffset, description, function, pollInterval=0):
self.add(pr.RemoteVariable(
Expand Down Expand Up @@ -528,8 +530,8 @@ def addPair(name, offset, bitSize, units, bitOffset, description, function, poll
)

# Default to simple view
self.simpleView()

if simpleViewList is not None:
self.simpleView()

@staticmethod
def convTempSYSMONE1(dev, var):
Expand Down Expand Up @@ -568,9 +570,8 @@ def convAuxVoltage(var):
return round(var.dependencies[0].value() * 244e-6,3)

def simpleView(self):
if self.simpleViewList is not None:
# Hide all the variable
self.hideVariables(hidden=True)
# Then unhide the most interesting ones
vars = self.simpleViewList
self.hideVariables(hidden=False, variables=vars)
# Hide all the variable
self.hideVariables(hidden=True)
# Then unhide the most interesting ones
vars = self.simpleViewList
self.hideVariables(hidden=False, variables=vars)
9 changes: 5 additions & 4 deletions python/surf/xilinx/_Xadc.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ def __init__(self,
if isinstance(auxChannels, int):
auxChannels = list(range(auxChannels))

self.simpleViewList = simpleViewList[:]
self.simpleViewList.append('enable')
if simpleViewList is not None:
self.simpleViewList = simpleViewList[:]
self.simpleViewList.append('enable')

def addPair(name, offset, bitSize, units, bitOffset, description, function, pollInterval=0):
self.add(pr.RemoteVariable(
Expand Down Expand Up @@ -572,8 +573,8 @@ def addPair(name, offset, bitSize, units, bitOffset, description, function, poll
)

# Default to simple view
self.simpleView()

if simpleViewList is not None:
self.simpleView()

@staticmethod
def convTemp(dev, var):
Expand Down

0 comments on commit 0060ce2

Please sign in to comment.