mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-05-14 05:55:35 +02:00
removed hard coded dac names in python NamedDacs and NamedPowers
This commit is contained in:
@@ -53,10 +53,7 @@ class NamedDacs:
|
||||
def _dacnames(self):
|
||||
if self._detector.size() == 0:
|
||||
raise RuntimeError("No modules added")
|
||||
if hasattr(self._detector, 'daclist'):
|
||||
return [n.replace(" ", "") for n in self._detector.daclist]
|
||||
else:
|
||||
return [f"DAC{i}" for i in range(18)]
|
||||
return [n.replace(" ", "") for n in self._detector.daclist]
|
||||
|
||||
def __getattr__(self, name):
|
||||
if name in self._dacnames:
|
||||
|
||||
@@ -81,7 +81,7 @@ class NamedPowers:
|
||||
if hasattr(self._detector, 'powerlist'):
|
||||
return [n.replace(" ", "") for n in self._detector.powerlist]
|
||||
else:
|
||||
return ["VA", "VB", "VC", "VD", "VIO"]
|
||||
raise RuntimeError("Detector does not have powerlist attribute")
|
||||
|
||||
def __getattr__(self, name):
|
||||
if name in self._powernames:
|
||||
|
||||
Reference in New Issue
Block a user