diff --git a/pyzebra/app/app.py b/pyzebra/app/app.py index 21973d3..d8460a5 100644 --- a/pyzebra/app/app.py +++ b/pyzebra/app/app.py @@ -10,6 +10,7 @@ import panel_ccl_integrate import panel_hdf_anatric import panel_hdf_viewer import panel_param_study +import panel_spind doc = curdoc() @@ -29,10 +30,11 @@ tab_hdf_viewer = panel_hdf_viewer.create() tab_hdf_anatric = panel_hdf_anatric.create() tab_ccl_integrate = panel_ccl_integrate.create() tab_param_study = panel_param_study.create() +tab_spind = panel_spind.create() doc.add_root( 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"), ) ) diff --git a/pyzebra/app/panel_spind.py b/pyzebra/app/panel_spind.py new file mode 100644 index 0000000..04cc1e6 --- /dev/null +++ b/pyzebra/app/panel_spind.py @@ -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")