Add spind panel

This commit is contained in:
usov_i 2020-12-14 15:04:55 +01:00
parent 559e18ed5d
commit fdb2027fd4
2 changed files with 48 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import panel_ccl_integrate
import panel_hdf_anatric import panel_hdf_anatric
import panel_hdf_viewer import panel_hdf_viewer
import panel_param_study import panel_param_study
import panel_spind
doc = curdoc() doc = curdoc()
@ -29,10 +30,11 @@ tab_hdf_viewer = panel_hdf_viewer.create()
tab_hdf_anatric = panel_hdf_anatric.create() tab_hdf_anatric = panel_hdf_anatric.create()
tab_ccl_integrate = panel_ccl_integrate.create() tab_ccl_integrate = panel_ccl_integrate.create()
tab_param_study = panel_param_study.create() tab_param_study = panel_param_study.create()
tab_spind = panel_spind.create()
doc.add_root( doc.add_root(
column( column(
Tabs(tabs=[tab_hdf_viewer, tab_hdf_anatric, tab_ccl_integrate, tab_param_study]), Tabs(tabs=[tab_hdf_viewer, tab_hdf_anatric, tab_ccl_integrate, tab_param_study, tab_spind]),
row(stdout_textareainput, bokeh_log_textareainput, sizing_mode="scale_both"), row(stdout_textareainput, bokeh_log_textareainput, sizing_mode="scale_both"),
) )
) )

View File

@ -0,0 +1,45 @@
import tempfile
from bokeh.layouts import column, row
from bokeh.models import (
Button,
Panel,
Spinner,
TextAreaInput,
TextInput,
)
def create():
selection_list = TextAreaInput(title="ROIs:", rows=7)
lattice_const_textinput = TextInput(title="Lattice constants:")
max_res_spinner = Spinner(title="max-res", value=2, step=0.01)
seed_pool_size_spinner = Spinner(title="seed-pool-size", value=5, step=0.01)
seed_len_tol_spinner = Spinner(title="seed-len-tol", value=0.02, step=0.01)
seed_angle_tol_spinner = Spinner(title="seed-angle-tol", value=1, step=0.01)
eval_hkl_tol_spinner = Spinner(title="eval-hkl-tol", value=0.15, step=0.01)
def process_button_callback():
with tempfile.TemporaryDirectory() as temp_dir:
temp_file = temp_dir + "/temp.xml"
process_button = Button(label="Process", button_type="primary")
process_button.on_click(process_button_callback)
output_textarea = TextAreaInput(title="Output UB matrix:", rows=7)
tab_layout = row(
column(
selection_list,
lattice_const_textinput,
max_res_spinner,
seed_pool_size_spinner,
seed_len_tol_spinner,
seed_angle_tol_spinner,
eval_hkl_tol_spinner,
process_button,
),
output_textarea,
)
return Panel(child=tab_layout, title="spind")