This commit is contained in:
Erik Frojdh 2020-08-20 12:27:30 +02:00
parent 1f811dfabd
commit f6cde374c4
2 changed files with 5 additions and 17 deletions

View File

@ -6,22 +6,17 @@ Created on Wed Dec 6 11:51:18 2017
@author: l_frojdh
"""
from .detector import Detector
from .temperature import Temperature, DetectorTemperature
from .dacs import DetectorDacs
import _slsdet
dacIndex = _slsdet.slsDetectorDefs.dacIndex
from .detector_property import DetectorProperty
# from .utils import element_if_equal
# from sls_detector.errors import DetectorValueError, DetectorError
class EigerVcmp:
"""
Convenience class to be able to loop over vcmp for Eiger
.. todo::
Support single assignment and perhaps unify with Dac class

View File

@ -1,6 +1,8 @@
from functools import partial
from collections.abc import Iterable
class Temperature:
degree_sign = u"\N{DEGREE SIGN}"
def __init__(self, name, enum, detector):
self.name = name
self.enum = enum
@ -19,16 +21,9 @@ class Temperature:
def __repr__(self):
"""String representation for a single temperature in all modules"""
degree_sign = u"\N{DEGREE SIGN}"
# r_str = ["{:14s}: ".format(self.name)]
# r_str += [
# "{:6.2f}{:s}C, ".format(self.get(i) / 1000, degree_sign)
# for i in range(self.get_nmod())
# ]
tempstr = ''.join([f'{item:5d}{degree_sign}C' for item in self.get()])
tempstr = ''.join([f'{item:5d}{self.degree_sign}C' for item in self.get()])
return f'{self.name:15s}:{tempstr}'
# return "".join(r_str).strip(", ")
class DetectorTemperature:
"""
@ -43,7 +38,5 @@ class DetectorTemperature:
"""String representation of all temps all mods"""
r_str = '\n'.join([repr(temp) for temp in self])
return r_str
# dacstr = ''.join([f'{item:5d}' for item in self.get()])
# return f'{self.__name__:10s}:{dacstr}'
# return "\n".join([str(t) for t in self])