[Task] Solve the issue with Bragg panel after resetting
Pin down the cause for the issue.
Traceback (most recent call last): File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/main.py", line 692, in evt_switch_bragg_unit rietveld_event_handler.switch_bragg_unit(main_window=self) File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/rietveld/event_handler.py", line 377, in switch_bragg_unit assert len(ws_group_list) > 0, 'At least 1 GSS file must be selected.' AssertionError: At least 1 GSS file must be selected. Aborted (core dumped)
It seems the program is expecting the number of workspaces (those shown in the
Bragg Workspacespanel) to be non-zero.
However, after resetting the GSAS-tab, the number of workspaces already become zero and therefore in this case we need to disable all the plot control buttons/checkboxes (just like when we first launch the GUI, all those buttons/checkboxes are greyed out before loading in any data).
Solve the issue.
- Locate where the unit selection dropdown menu is defined.
dSpacingin the codes -> from line-29 in
addie/initialization/widgets/rietveld_tab.py, we know it is one of the options in
comboBox_xUnitin the codes.
We know that definitely this
comboBox_xUnitshould have been disabled during the initialization stage, so we want to look into the codes to see how this was done.
At line-199 in
addie/rietveld/event_handler.py, we see
ui.comboBox_xUnit.setEnabled(enable_widgets)which is definitely what we want.
- We need to call
check_rietveld_widgetsmethod after resetting the GSAS-tab.
addie/rietveld/braggtree.pyand go to the end of
do_reset_gsas_tabmethod. We need to put the following lines to the end of
main_window._onCanvasGSSBankList =  event_handler.check_rietveld_widgets(main_window)
The first line added above is to reset the
_onCanvasGSSBankListvariable so that
check_rietveld_widgetsmethod knows that we have an empty workspace list.