|
2 | 2 | # |
3 | 3 | # The PyMca X-Ray Fluorescence Toolkit |
4 | 4 | # |
5 | | -# Copyright (c) 2004-2023 European Synchrotron Radiation Facility |
| 5 | +# Copyright (c) 2004-2025 European Synchrotron Radiation Facility |
6 | 6 | # |
7 | 7 | # This file is part of the PyMca X-ray Fluorescence Toolkit developed at |
8 | 8 | # the ESRF. |
@@ -94,11 +94,11 @@ def __init__(self, parent=None, name="Attenuators Tab", |
94 | 94 | if rheight > 40: |
95 | 95 | self.table.setMinimumHeight(10*rheight) |
96 | 96 | else: |
97 | | - self.table.setMinimumHeight(13*rheight) |
| 97 | + self.table.setMinimumHeight(14*rheight) |
98 | 98 | else: |
99 | 99 | self.editor = MaterialEditor.MaterialEditor(graph=graph) |
100 | | - self.table.setMinimumHeight(13*rheight) |
101 | | - self.table.setMaximumHeight(13*rheight) |
| 100 | + self.table.setMinimumHeight(14*rheight) |
| 101 | + self.table.setMaximumHeight(14*rheight) |
102 | 102 | self.userAttenuators = TransmissionTableGui.TransmissionTableGui() |
103 | 103 | self.mainTab.addTab(self.editor, "Material Editor") |
104 | 104 | self.mainTab.addTab(self.userAttenuators, "User Attenuators") |
@@ -322,9 +322,12 @@ class AttenuatorsTableWidget(QTable): |
322 | 322 | def __init__(self, parent=None, name="Attenuators Table", |
323 | 323 | attenuators=None, matrixmode=None, compoundmode=None, |
324 | 324 | layerindex=0, funnyfilters=False): |
| 325 | + |
| 326 | + beamFilters0 = ["BeamFilter1", "BeamFilter2", "BeamFilter3"] # this needs to be synchronized with FitParam.py |
325 | 327 | attenuators0 = ["Atmosphere", "Air", "Window", "Contact", "DeadLayer", |
326 | | - "Filter5", "Filter6", "Filter7", "BeamFilter1", |
327 | | - "BeamFilter2", "Detector", "Matrix"] |
| 328 | + "Filter5", "Filter6", "Filter7"] + beamFilters0 + ["Detector", "Matrix"] |
| 329 | + self.__attenuators0 = attenuators0 |
| 330 | + self.__beamFilters0 = beamFilters0 |
328 | 331 |
|
329 | 332 | QTable.__init__(self, parent) |
330 | 333 | self.setWindowTitle(name) |
@@ -385,12 +388,12 @@ def __init__(self, parent=None, name="Attenuators Table", |
385 | 388 |
|
386 | 389 | self.sigValueChanged[int,int].connect(self.mySlot) |
387 | 390 |
|
388 | | - def __build(self, nfilters=12): |
| 391 | + def __build(self, nfilters=13): |
389 | 392 | n = 0 |
390 | 393 | if (not self.matrixMode) and (not self.compoundMode): |
391 | | - n = 4 |
| 394 | + n = len(self.__beamFilters0) + 2 |
392 | 395 | #self.setNumRows(nfilters+n) |
393 | | - self.setRowCount(12) |
| 396 | + self.setRowCount(len(self.__attenuators0)) |
394 | 397 | else: |
395 | 398 | self.setRowCount(nfilters) |
396 | 399 | rheight = self.horizontalHeader().sizeHint().height() |
@@ -457,10 +460,11 @@ def __build(self, nfilters=12): |
457 | 460 | #self.setItem(idx,2,combo) |
458 | 461 | combo.sigMaterialComboBoxSignal.connect(self._comboSlot) |
459 | 462 |
|
460 | | - for i in range(2): |
| 463 | + nBeamFilters = len(self.__beamFilters0) |
| 464 | + for i in range(nBeamFilters): |
461 | 465 | #BeamFilter(i) |
462 | 466 | item = qt.QCheckBox(self) |
463 | | - idx = self.rowCount() - (4 - i) |
| 467 | + idx = self.rowCount() - (n - i) |
464 | 468 | self.setCellWidget(idx, 0, item) |
465 | 469 | text = "BeamFilter%d" % i |
466 | 470 | item.setText(text) |
|
0 commit comments