diff --git a/PyMca5/PyMcaGui/io/hdf5/HDF5Selection.py b/PyMca5/PyMcaGui/io/hdf5/HDF5Selection.py index 3b10de8fa..f8a8b5786 100644 --- a/PyMca5/PyMcaGui/io/hdf5/HDF5Selection.py +++ b/PyMca5/PyMcaGui/io/hdf5/HDF5Selection.py @@ -1,5 +1,5 @@ #/*########################################################################## -# Copyright (C) 2004-2014 V.A. Sole, European Synchrotron Radiation Facility +# Copyright (C) 2004-2021 European Synchrotron Radiation Facility # # This file is part of the PyMca X-ray Fluorescence Toolkit developed at # the ESRF by the Software group. @@ -23,7 +23,7 @@ # THE SOFTWARE. # #############################################################################*/ -__author__ = "V.A. Sole - ESRF Data Analysis" +__author__ = "V.A. Sole" __contact__ = "sole@esrf.fr" __license__ = "MIT" __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" @@ -40,7 +40,7 @@ def __init__(self, parent=None): self.mainLayout.setSpacing(2) self.selectionWidgetsDict = {} row = 0 - for key in ['x', 'y', 'm']: + for key in ['entry', 'x', 'y', 'm']: label = qt.QLabel(self) label.setText(key+":") line = qt.QLineEdit(self) @@ -54,7 +54,7 @@ def setSelection(self, selection): if 'cntlist' in selection: # "Raw" selection cntlist = selection['cntlist'] - for key in ['x', 'y', 'm']: + for key in ['entry', 'x', 'y', 'm']: if key not in selection: self.selectionWidgetsDict[key].setText("") continue @@ -70,7 +70,7 @@ def setSelection(self, selection): self.selectionWidgetsDict[key].setText(text) else: # "Digested" selection - for key in ['x', 'y', 'm']: + for key in ['entry', 'x', 'y', 'm']: if key not in selection: self.selectionWidgetsDict[key].setText("") continue @@ -86,7 +86,7 @@ def setSelection(self, selection): def getSelection(self): selection = {} - for key in ['x', 'y', 'm']: + for key in ['entry', 'x', 'y', 'm']: selection[key] = [] text = safe_str(self.selectionWidgetsDict[key].text()) text = text.replace(" ","") diff --git a/PyMca5/PyMcaGui/pymca/PyMcaBatch.py b/PyMca5/PyMcaGui/pymca/PyMcaBatch.py index 5f902b7c3..fa2c9a7ec 100644 --- a/PyMca5/PyMcaGui/pymca/PyMcaBatch.py +++ b/PyMca5/PyMcaGui/pymca/PyMcaBatch.py @@ -1,6 +1,6 @@ #!/usr/bin/env python #/*########################################################################## -# Copyright (C) 2004-2020 European Synchrotron Radiation Facility +# Copyright (C) 2004-2021 European Synchrotron Radiation Facility # # This file is part of the PyMca X-ray Fluorescence Toolkit developed at # the ESRF by the Software group. @@ -24,7 +24,7 @@ # THE SOFTWARE. # #############################################################################*/ -__author__ = "V.A. Sole - ESRF Data Analysis" +__author__ = "V.A. Sole" __contact__ = "sole@esrf.fr" __license__ = "MIT" __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" @@ -1000,7 +1000,9 @@ def _hdf5Selection(self, filename): self.showMessage(text) self.__listView.clear() return selection + entryList = nexusWidget.getSelectedEntries() datasource = None + selection['entry'] = [] selection['x'] = [] selection['y'] = [] selection['m'] = [] @@ -1008,6 +1010,8 @@ def _hdf5Selection(self, filename): if len(cntSelection[key]): for idx in cntSelection[key]: selection[key].append(cntlist[idx]) + for item in entryList: + selection['entry'].append(item[0]) return selection def showMessage(self, text): diff --git a/PyMca5/PyMcaIO/HDF5Stack1D.py b/PyMca5/PyMcaIO/HDF5Stack1D.py index 06d060031..d7279efe6 100644 --- a/PyMca5/PyMcaIO/HDF5Stack1D.py +++ b/PyMca5/PyMcaIO/HDF5Stack1D.py @@ -2,7 +2,7 @@ # # The PyMca X-Ray Fluorescence Toolkit # -# Copyright (c) 2004-2020 European Synchrotron Radiation Facility +# Copyright (c) 2004-2021 European Synchrotron Radiation Facility # # This file is part of the PyMca X-ray Fluorescence Toolkit developed at # the ESRF by the Software group. @@ -77,6 +77,11 @@ def loadFileList(self, filelist, selection, scanlist=None): _logger.info("filelist = %s", filelist) _logger.info("selection = %s", selection) _logger.info("scanlist = %s", scanlist) + + if scanlist is not None: + if type(scanlist) not in (type([]), type(())): + scanlist = [scanlist] + # all the files in the same source hdfStack = NexusDataSource.NexusDataSource(filelist)