Handle DataFactory for 3 possible detectors
This commit is contained in:
parent
3db7dca7ba
commit
5eedd14b3f
@ -236,12 +236,37 @@ class AnatricConfig:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def dataFactory_dist1(self):
|
def dataFactory_dist1(self):
|
||||||
return self._tree.find("DataFactory").find("dist1").attrib["value"]
|
elem = self._tree.find("DataFactory").find("dist1")
|
||||||
|
if elem is not None:
|
||||||
|
return elem.attrib["value"]
|
||||||
|
return None
|
||||||
|
|
||||||
@dataFactory_dist1.setter
|
@dataFactory_dist1.setter
|
||||||
def dataFactory_dist1(self, value):
|
def dataFactory_dist1(self, value):
|
||||||
self._tree.find("DataFactory").find("dist1").attrib["value"] = value
|
self._tree.find("DataFactory").find("dist1").attrib["value"] = value
|
||||||
|
|
||||||
|
@property
|
||||||
|
def dataFactory_dist2(self):
|
||||||
|
elem = self._tree.find("DataFactory").find("dist2")
|
||||||
|
if elem is not None:
|
||||||
|
return elem.attrib["value"]
|
||||||
|
return None
|
||||||
|
|
||||||
|
@dataFactory_dist2.setter
|
||||||
|
def dataFactory_dist2(self, value):
|
||||||
|
self._tree.find("DataFactory").find("dist2").attrib["value"] = value
|
||||||
|
|
||||||
|
@property
|
||||||
|
def dataFactory_dist3(self):
|
||||||
|
elem = self._tree.find("DataFactory").find("dist3")
|
||||||
|
if elem is not None:
|
||||||
|
return elem.attrib["value"]
|
||||||
|
return None
|
||||||
|
|
||||||
|
@dataFactory_dist3.setter
|
||||||
|
def dataFactory_dist3(self, value):
|
||||||
|
self._tree.find("DataFactory").find("dist3").attrib["value"] = value
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def reflectionPrinter_format(self):
|
def reflectionPrinter_format(self):
|
||||||
return self._tree.find("ReflectionPrinter").attrib["format"]
|
return self._tree.find("ReflectionPrinter").attrib["format"]
|
||||||
|
@ -44,7 +44,12 @@ def create():
|
|||||||
ub_textareainput.value = config.crystal_UB
|
ub_textareainput.value = config.crystal_UB
|
||||||
|
|
||||||
dataFactory_implementation_select.value = config.dataFactory_implementation
|
dataFactory_implementation_select.value = config.dataFactory_implementation
|
||||||
|
if config.dataFactory_dist1 is not None:
|
||||||
dataFactory_dist1_textinput.value = config.dataFactory_dist1
|
dataFactory_dist1_textinput.value = config.dataFactory_dist1
|
||||||
|
if config.dataFactory_dist2 is not None:
|
||||||
|
dataFactory_dist2_textinput.value = config.dataFactory_dist2
|
||||||
|
if config.dataFactory_dist3 is not None:
|
||||||
|
dataFactory_dist3_textinput.value = config.dataFactory_dist3
|
||||||
reflectionPrinter_format_select.value = config.reflectionPrinter_format
|
reflectionPrinter_format_select.value = config.reflectionPrinter_format
|
||||||
|
|
||||||
set_active_widgets(config.algorithm)
|
set_active_widgets(config.algorithm)
|
||||||
@ -200,9 +205,21 @@ def create():
|
|||||||
def dataFactory_dist1_textinput_callback(_attr, _old, new):
|
def dataFactory_dist1_textinput_callback(_attr, _old, new):
|
||||||
config.dataFactory_dist1 = new
|
config.dataFactory_dist1 = new
|
||||||
|
|
||||||
dataFactory_dist1_textinput = TextInput(title="dist1:", width=145)
|
dataFactory_dist1_textinput = TextInput(title="dist1:", width=75)
|
||||||
dataFactory_dist1_textinput.on_change("value", dataFactory_dist1_textinput_callback)
|
dataFactory_dist1_textinput.on_change("value", dataFactory_dist1_textinput_callback)
|
||||||
|
|
||||||
|
def dataFactory_dist2_textinput_callback(_attr, _old, new):
|
||||||
|
config.dataFactory_dist2 = new
|
||||||
|
|
||||||
|
dataFactory_dist2_textinput = TextInput(title="dist2:", width=75)
|
||||||
|
dataFactory_dist2_textinput.on_change("value", dataFactory_dist2_textinput_callback)
|
||||||
|
|
||||||
|
def dataFactory_dist3_textinput_callback(_attr, _old, new):
|
||||||
|
config.dataFactory_dist3 = new
|
||||||
|
|
||||||
|
dataFactory_dist3_textinput = TextInput(title="dist3:", width=75)
|
||||||
|
dataFactory_dist3_textinput.on_change("value", dataFactory_dist3_textinput_callback)
|
||||||
|
|
||||||
# ---- BackgroundProcessor
|
# ---- BackgroundProcessor
|
||||||
|
|
||||||
# ---- DetectorEfficency
|
# ---- DetectorEfficency
|
||||||
@ -369,7 +386,12 @@ def create():
|
|||||||
row(lambda_textinput, zeroOM_textinput),
|
row(lambda_textinput, zeroOM_textinput),
|
||||||
row(zeroSTT_textinput, zeroCHI_textinput),
|
row(zeroSTT_textinput, zeroCHI_textinput),
|
||||||
ub_textareainput,
|
ub_textareainput,
|
||||||
row(dataFactory_implementation_select, dataFactory_dist1_textinput),
|
row(
|
||||||
|
dataFactory_implementation_select,
|
||||||
|
dataFactory_dist1_textinput,
|
||||||
|
dataFactory_dist2_textinput,
|
||||||
|
dataFactory_dist3_textinput,
|
||||||
|
),
|
||||||
reflectionPrinter_format_select,
|
reflectionPrinter_format_select,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user