Commit f0a6736d authored by Thomas Vincent's avatar Thomas Vincent

rework check of multiple energy

parent 6e56cae0
......@@ -183,15 +183,14 @@ class AcqParamsWidget(Qt.QWidget):
:param List[float] energies:
"""
if len(energies) == 0:
nbEnergies = len(set(energies))
if nbEnergies == 0:
text = ''
elif nbEnergies == 1: # All energies are the same
text = "%g" % energies[0]
else:
if [nrj for nrj in energies if nrj != energies[0]]:
text = "[%g;%g]" % (min(energies), max(energies))
else: # All energies are the same
text = energies[0]
self.__beam_nrg_edit.setText(str(text))
text = "[%g;%g]" % (min(energies), max(energies))
self.__beam_nrg_edit.setText(text)
@property
def direct_beam_h(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment