Closed rodolakis closed 4 months ago
BTW, not a big deal, but when there is no content (like below in the no_mda_folder
), the tab in the field table view widget still shows the file name of the last file displayed.
This issue will help with the following event crash that occurs in auto-add mode:
KeyError
This is easy to prevent, but in reality this should not happen when the issue above is addresses since the tab would go away if there are no detector currently on the graph for the corresponding file (file is removed from the tabs)
========= Selected file: mda_0008.mda in /Users/fannysimoes/src/mdaviz/mdaviz/data/test_folder1
doPlot called: args=('add', {'X': 1, 'Y': [2]})
========= Selected file: mda_0007.mda in /Users/fannysimoes/src/mdaviz/mdaviz/data/test_folder1
Traceback (most recent call last):
File "/Users/fannysimoes/src/mdaviz/mdaviz/mda_folder.py", line 308, in doFileSelected
self.updateSelectionForNewPVs(oldPvList, newPvList, verbose)
File "/Users/fannysimoes/src/mdaviz/mdaviz/mda_folder.py", line 205, in updateSelectionForNewPVs
changes_made |= self.updateDetectorSelection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/fannysimoes/src/mdaviz/mdaviz/mda_folder.py", line 227, in updateDetectorSelection
for old_idx in self.selectionField()["Y"]:
~~~~~~~~~~~~~~~~~~~~~^^^^^
KeyError: 'Y'
Abort trap: 6
Tabs can be closed easily with
<property name="tabsClosable">
<bool>true</bool>
</property>
Related to this https://github.com/BCDA-APS/mdaviz/issues/39#issuecomment-1724230879 Related to https://github.com/BCDA-APS/mdaviz/issues/41
self.select_fields_tableview
, which is an instance from SelectFieldsTableView
, vs the tabWidget
that contains the actual table view /model:
SelectFieldsTableView
in MDA_MVC
, it creates the entire panels and load the UI file that contains the layout with the tabWidget
but also the mode
pull down menu and the clear
button, etc.tabWidget
with a new instance of table view/model for the newly selected fileSelectFieldsTableView
) vs what is specific to the tabWidget
/ selected file, e.g. the list of PV, which at the moment are attached to SelectFieldsTableView
(entire panel)Going home, getting closer but still some work to do:
Make sure to disable open the same file in multiple tabs (it is the case now)
Now when a new file and/or folder is selected, I would like to KEEP the table views tabs (in both
MDAFolderTableView
andSelectFieldsTableView
) as long as some content from this file/folder is displayed on the graph.For example in this picture, if I select mda_0024.mda, as long as there are some data from mda_0023 displayed on the plot, I would like to keep the tab for mda_0023.mda in my field table view, but add a new one for mda_0024 (and bring it in focus/front).
This will allow some manipulation on the file/folder (eg change normalization by I0, add a detector, etc.) without having to reopen/look for the previous folder/file.