This commit is contained in:
Erik Frojdh
2019-10-17 17:09:01 +02:00
parent 0a3905802f
commit 59a7a462ab
2 changed files with 59 additions and 41 deletions

View File

@ -56,9 +56,17 @@ class ExperimentalDetector(CppDetectorApi):
def __len__(self):
return self.size()
def __repr__(self):
return '{}(id = {})'.format(self.__class__.__name__,
self.getShmId())
def free(self):
self.freeSharedMemory()
@property
def config(self):
return NotImplementedError("config is set only")
@ -109,6 +117,14 @@ class ExperimentalDetector(CppDetectorApi):
def detector_type(self):
return element_if_equal(self.getDetectorType())
@property
def dr(self):
return element_if_equal(self.getDynamicRange())
@dr.setter
def dr(self, dr):
self.setDynamicRange(dr)
@property
def module_geometry(self):
return to_geo(self.getModuleGeometry())
@ -175,44 +191,9 @@ class ExperimentalDetector(CppDetectorApi):
self.setPeriod(t)
else:
self.setPeriod(dt.timedelta(seconds=t))
# Acq
@property
def busy(self):
"""
Checks if the detector is acquiring. Can also be set but should only be used if the acquire fails and
leaves the detector with busy == True
.. note ::
Only works when the measurement is launched using acquire, not with status start!
Returns
--------
bool
:py:obj:`True` if the detector is acquiring otherwise :py:obj:`False`
Examples
----------
::
d.busy
>> True
#If the detector is stuck reset by:
d.busy = False
"""
return self.getAcquiringFlag()
@busy.setter
def busy(self, value):
self.setAcquiringFlag(value)
# Configuration
# Time
@ -429,4 +410,12 @@ class ExperimentalDetector(CppDetectorApi):
@zmqip.setter
def zmqip(self, ip):
self.setClientZmqIp(ip)
self.setClientZmqIp(ip)
@property
def vhighvoltage(self):
return element_if_equal(self.getHighVoltage())
@vhighvoltage.setter
def vhighvoltage(self, v):
self.setHighVoltage(v)