Add results output widget for anatric
This commit is contained in:
parent
24f083e585
commit
bd3efd698a
@ -286,6 +286,14 @@ class AnatricConfig:
|
|||||||
|
|
||||||
self._tree.find("ReflectionPrinter").attrib["format"] = value
|
self._tree.find("ReflectionPrinter").attrib["format"] = value
|
||||||
|
|
||||||
|
@property
|
||||||
|
def reflectionPrinter_file(self):
|
||||||
|
return self._tree.find("ReflectionPrinter").attrib["file"]
|
||||||
|
|
||||||
|
@reflectionPrinter_file.setter
|
||||||
|
def reflectionPrinter_file(self, value):
|
||||||
|
self._tree.find("ReflectionPrinter").attrib["file"] = value
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def algorithm(self):
|
def algorithm(self):
|
||||||
return self._tree.find("Algorithm").attrib["implementation"]
|
return self._tree.find("Algorithm").attrib["implementation"]
|
||||||
|
@ -346,7 +346,7 @@ def create():
|
|||||||
|
|
||||||
def process_button_callback():
|
def process_button_callback():
|
||||||
with tempfile.TemporaryDirectory() as temp_dir:
|
with tempfile.TemporaryDirectory() as temp_dir:
|
||||||
temp_file = temp_dir + "/temp.xml"
|
temp_file = temp_dir + "/config.xml"
|
||||||
config.save_as(temp_file)
|
config.save_as(temp_file)
|
||||||
if doc.anatric_path:
|
if doc.anatric_path:
|
||||||
pyzebra.anatric(temp_file, anatric_path=doc.anatric_path)
|
pyzebra.anatric(temp_file, anatric_path=doc.anatric_path)
|
||||||
@ -356,10 +356,14 @@ def create():
|
|||||||
with open(config.logfile) as f_log:
|
with open(config.logfile) as f_log:
|
||||||
output_log.value = f_log.read()
|
output_log.value = f_log.read()
|
||||||
|
|
||||||
|
with open(config.reflectionPrinter_file) as f_res:
|
||||||
|
output_res.value = f_res.read()
|
||||||
|
|
||||||
process_button = Button(label="Process", button_type="primary")
|
process_button = Button(label="Process", button_type="primary")
|
||||||
process_button.on_click(process_button_callback)
|
process_button.on_click(process_button_callback)
|
||||||
|
|
||||||
output_log = TextAreaInput(title="Logfile output:", height=320, width=465, disabled=True)
|
output_log = TextAreaInput(title="Logfile output:", height=320, width=465, disabled=True)
|
||||||
|
output_res = TextAreaInput(title="Result output:", height=320, width=465, disabled=True)
|
||||||
output_config = TextAreaInput(title="Current config:", height=320, width=465, disabled=True)
|
output_config = TextAreaInput(title="Current config:", height=320, width=465, disabled=True)
|
||||||
|
|
||||||
general_params_layout = column(
|
general_params_layout = column(
|
||||||
@ -383,12 +387,12 @@ def create():
|
|||||||
tab_layout = row(
|
tab_layout = row(
|
||||||
general_params_layout,
|
general_params_layout,
|
||||||
column(output_config, algorithm_params, row(process_button)),
|
column(output_config, algorithm_params, row(process_button)),
|
||||||
output_log,
|
column(output_log, output_res),
|
||||||
)
|
)
|
||||||
|
|
||||||
async def update_config():
|
async def update_config():
|
||||||
with tempfile.TemporaryDirectory() as temp_dir:
|
with tempfile.TemporaryDirectory() as temp_dir:
|
||||||
temp_file = temp_dir + "/debug.xml"
|
temp_file = temp_dir + "/config.xml"
|
||||||
config.save_as(temp_file)
|
config.save_as(temp_file)
|
||||||
with open(temp_file) as f_config:
|
with open(temp_file) as f_config:
|
||||||
output_config.value = f_config.read()
|
output_config.value = f_config.read()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user