mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-28 09:10:01 +02:00
Merge branch 'developer' into g2continuous
This commit is contained in:
commit
5540f16116
@ -35,6 +35,7 @@ set( PYTHON_FILES
|
|||||||
gotthard.py
|
gotthard.py
|
||||||
gotthard2.py
|
gotthard2.py
|
||||||
moench.py
|
moench.py
|
||||||
|
jsonproxy.py
|
||||||
ctb.py
|
ctb.py
|
||||||
jungfrau.py
|
jungfrau.py
|
||||||
mythen3.py
|
mythen3.py
|
||||||
|
@ -84,6 +84,7 @@ intentionally_missing = [
|
|||||||
'update', #use updateServerAndFirmare
|
'update', #use updateServerAndFirmare
|
||||||
'udp_validate', #use validateUdpConfiguration
|
'udp_validate', #use validateUdpConfiguration
|
||||||
'udp_reconfigure', #use reconfigureUdpDestination
|
'udp_reconfigure', #use reconfigureUdpDestination
|
||||||
|
'emin', #use rx_jsonpara
|
||||||
]
|
]
|
||||||
|
|
||||||
pycmd += intentionally_missing
|
pycmd += intentionally_missing
|
||||||
|
@ -11,6 +11,7 @@ detectorType = slsDetectorDefs.detectorType
|
|||||||
from .utils import element_if_equal, all_equal, get_set_bits, list_to_bitmask
|
from .utils import element_if_equal, all_equal, get_set_bits, list_to_bitmask
|
||||||
from .utils import Geometry, to_geo, element, reduce_time, is_iterable
|
from .utils import Geometry, to_geo, element, reduce_time, is_iterable
|
||||||
from . import utils as ut
|
from . import utils as ut
|
||||||
|
from .jsonproxy import JsonProxy
|
||||||
from .registers import Register, Adc_register
|
from .registers import Register, Adc_register
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
|
|
||||||
@ -275,9 +276,7 @@ class Detector(CppDetectorApi):
|
|||||||
v = float(v)
|
v = float(v)
|
||||||
self.setExptime(i, v)
|
self.setExptime(i, v)
|
||||||
else:
|
else:
|
||||||
if isinstance(t, int):
|
ut.set_time_using_dict(self.setExptime, t)
|
||||||
t = float(t)
|
|
||||||
self.setExptime(t)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -305,7 +304,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@period.setter
|
@period.setter
|
||||||
def period(self, t):
|
def period(self, t):
|
||||||
self.setPeriod(t)
|
ut.set_time_using_dict(self.setPeriod, t)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@element
|
@element
|
||||||
@ -1168,13 +1167,33 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def rx_jsonpara(self):
|
def rx_jsonpara(self):
|
||||||
raise NotImplementedError('use d.getAdditionalJsonParameter(\'key\')')
|
"""
|
||||||
|
Get the receiver additional json parameter. In case the parameter is different between
|
||||||
|
the modules a list of strings will be returned. On setting the value is automatically
|
||||||
|
converted to a string.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
-----------
|
||||||
|
|
||||||
|
>>> d.rx_jsonpara['emin']
|
||||||
|
'4500'
|
||||||
|
|
||||||
|
>>> d.rx_jsonpara['emin'] = 5000
|
||||||
|
|
||||||
|
"""
|
||||||
|
return JsonProxy(self)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@rx_jsonpara.setter
|
@rx_jsonpara.setter
|
||||||
def rx_jsonpara(self, args):
|
def rx_jsonpara(self, args):
|
||||||
for key, value in args.items():
|
for key, value in args.items():
|
||||||
self.setAdditionalJsonParameter(key, str(value))
|
self.setAdditionalJsonParameter(key, str(value))
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def rx_jsonaddheader(self):
|
||||||
|
return self.getAdditionalJsonHeader()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def frameindex(self):
|
def frameindex(self):
|
||||||
@ -1264,7 +1283,8 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@subexptime.setter
|
@subexptime.setter
|
||||||
def subexptime(self, t):
|
def subexptime(self, t):
|
||||||
self.setSubExptime(t)
|
ut.set_time_using_dict(self.setSubExptime, t)
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def subdeadtime(self):
|
def subdeadtime(self):
|
||||||
@ -1289,8 +1309,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@subdeadtime.setter
|
@subdeadtime.setter
|
||||||
def subdeadtime(self, t):
|
def subdeadtime(self, t):
|
||||||
self.setSubDeadTime(t)
|
ut.set_time_using_dict(self.setSubDeadTime, t)
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@element
|
@element
|
||||||
@ -2201,3 +2220,6 @@ class Detector(CppDetectorApi):
|
|||||||
:setter: Not implemented
|
:setter: Not implemented
|
||||||
"""
|
"""
|
||||||
return self.getMeasuredCurrent(dacIndex.I_POWER_IO)
|
return self.getMeasuredCurrent(dacIndex.I_POWER_IO)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -116,3 +116,14 @@ def set_using_dict(func, args):
|
|||||||
func(value, [key])
|
func(value, [key])
|
||||||
else:
|
else:
|
||||||
func(args)
|
func(args)
|
||||||
|
|
||||||
|
def set_time_using_dict(func, args):
|
||||||
|
if isinstance(args, dict):
|
||||||
|
for key, value in args.items():
|
||||||
|
if isinstance(value, int):
|
||||||
|
value = float(value)
|
||||||
|
func(value, [key])
|
||||||
|
else:
|
||||||
|
if isinstance(args, int):
|
||||||
|
args = float(args)
|
||||||
|
func(args)
|
Loading…
x
Reference in New Issue
Block a user