Index: src/sas/qtgui/Calculators/SldPanel.py
===================================================================
--- src/sas/qtgui/Calculators/SldPanel.py (revision 82efbe9d2e628f06211f3d20ea072d4ec60fc9f8)
+++ src/sas/qtgui/Calculators/SldPanel.py (revision 9f3db13258452eac6ec0463b48d10984ec70a8d0)
@@ -1,3 +1,4 @@
# global
+import numpy as np
import logging
from PyQt5 import QtCore
@@ -120,4 +121,7 @@
#self.ui.editMolecularFormula.setValidator(GuiUtils.FormulaValidator(self.ui.editMolecularFormula))
+ # No need for recalculate
+ self.ui.recalculateButton.setVisible(False)
+
rx = QtCore.QRegExp("[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?")
self.ui.editMassDensity.setValidator(QtGui.QRegExpValidator(rx, self.ui.editMassDensity))
@@ -143,5 +147,5 @@
self.model.setItem(key, QtGui.QStandardItem())
- self.model.dataChanged.connect(self.dataChanged)
+ #self.model.dataChanged.connect(self.dataChanged)
self.ui.editMassDensity.textChanged.connect(self.recalculateSLD)
@@ -188,5 +192,5 @@
return ("%-5.3g" % value).strip()
- if neutronWavelength:
+ if neutronWavelength and float(neutronWavelength) > np.finfo(float).eps:
results = neutronSldAlgorithm(str(formula), float(density), float(neutronWavelength))
@@ -214,5 +218,5 @@
self.ui.editNeutronAbsXs.setEnabled(False)
- if xrayWavelength:
+ if xrayWavelength and float(xrayWavelength) > np.finfo(float).eps:
results = xraySldAlgorithm(str(formula), float(density), float(xrayWavelength))
Index: src/sas/qtgui/Calculators/UI/SldPanel.ui
===================================================================
--- src/sas/qtgui/Calculators/UI/SldPanel.ui (revision 82efbe9d2e628f06211f3d20ea072d4ec60fc9f8)
+++ src/sas/qtgui/Calculators/UI/SldPanel.ui (revision 9f3db13258452eac6ec0463b48d10984ec70a8d0)
@@ -8,5 +8,5 @@
0
490
- 490
+ 446
@@ -38,4 +38,277 @@
+ -
+
+
+ Output
+
+
+
-
+
+
+ true
+
+
+ true
+
+
+
+ -
+
+
+ Neutron SLD
+
+
+
+ -
+
+
+ Neutron 1/e length
+
+
+
+ -
+
+
+ true
+
+
+ true
+
+
+
+ -
+
+
+ Neutron Inc. Xs
+
+
+
+ -
+
+
+ -i
+
+
+
+ -
+
+
+ -i
+
+
+
+ -
+
+
+ true
+
+
+ true
+
+
+
+ -
+
+
+ cm
+
+
+
+ -
+
+
+ true
+
+
+ true
+
+
+
+ -
+
+
+ 1/cm
+
+
+
+ -
+
+
+ true
+
+
+ true
+
+
+
+ -
+
+
+ Neutron Abs. Xs
+
+
+
+ -
+
+
+ 1/cm
+
+
+
+ -
+
+
+ 1/Ã
+²
+
+
+
+ -
+
+
+ X-Ray SLD
+
+
+
+ -
+
+
+ 1/Ã
+²
+
+
+
+ -
+
+
+
+ 0
+ 5
+
+
+
+ QFrame::HLine
+
+
+ QFrame::Raised
+
+
+ 1
+
+
+ 0
+
+
+
+ -
+
+
+ true
+
+
+ true
+
+
+
+ -
+
+
+ true
+
+
+ true
+
+
+
+
+
+
+ -
+
+
+ Input
+
+
+
-
+
+
+ Mass Density
+
+
+
+ -
+
+
+ g/cm³
+
+
+
+ -
+
+
+ e.g. H2O
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ Ã
+
+
+
+
+ -
+
+
+ Molecular Formula
+
+
+
+ -
+
+
+ Neutron Wavelength
+
+
+
+ -
+
+
+
+
+
+ false
+
+
+
+ -
+
+
+ -
+
+
+ X-Ray Wavelength
+
+
+
+ -
+
+
+ Ã
+
+
+
+
+
+
+
-
@@ -46,312 +319,39 @@
-
-
-
- 0
- 0
- 114
- 32
-
-
-
- Recalculate
-
-
-
-
-
- 176
- 0
- 114
- 32
-
-
-
- Help
-
-
-
-
-
- 352
- 0
- 114
- 32
-
-
-
- Close
-
-
-
-
- -
-
-
- Input
-
-
-
-
-
-
- Mass Density
-
-
-
- -
-
-
- g/cm³
-
-
+
+
-
+
+
+ true
+
+
+ Recalculate
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 208
+ 20
+
+
+
-
-
-
- e.g. H2O
-
-
-
- -
-
-
- -
-
-
- -
-
-
- Ã
-
-
-
-
- -
-
-
- Molecular Formula
-
-
-
- -
-
-
- Neutron Wavelength
-
-
-
- -
-
-
-
-
-
- false
-
-
-
- -
-
-
- -
-
-
- X-Ray Wavelength
-
-
-
- -
-
-
- Ã
-
-
-
-
-
-
-
- -
-
-
- Output
-
-
-
-
-
-
- true
-
-
- true
-
-
-
- -
-
-
- Neutron SLD
-
-
-
- -
-
-
- Neutron 1/e length
-
-
-
- -
-
-
- true
-
-
- true
-
-
-
- -
-
-
- Neutron Inc. Xs
-
-
-
- -
-
-
- -i
-
-
-
- -
-
-
- -i
+
+
+ Close
-
-
-
- true
-
-
- true
-
-
-
- -
-
-
- cm
-
-
-
- -
-
-
- true
-
-
- true
-
-
-
- -
-
-
- 1/cm
-
-
-
- -
-
-
- true
-
-
- true
-
-
-
- -
-
-
- Neutron Abs. Xs
-
-
-
- -
-
-
- 1/cm
-
-
-
- -
-
-
- 1/Ã
-²
-
-
-
- -
-
-
- X-Ray SLD
-
-
-
- -
-
-
- 1/Ã
-²
-
-
-
- -
-
-
-
- 0
- 5
-
-
-
- QFrame::HLine
-
-
- QFrame::Raised
-
-
- 1
-
-
- 0
-
-
-
- -
-
-
- true
-
-
- true
-
-
-
- -
-
-
- true
-
-
- true
+
+
+ Help