Ignore:
Timestamp:
Mar 26, 2019 10:54:57 AM (6 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl
Children:
5123512
Parents:
5d14851a
Message:

Removed Recalculate button. Added check for 0 < eps for wavelengths so
the denominators are happy. Simplified signalling. SASVIEW-1142

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Calculators/SldPanel.py

    r82efbe9 r9f3db13  
    11# global 
     2import numpy as np 
    23import logging 
    34from PyQt5 import QtCore 
     
    120121        #self.ui.editMolecularFormula.setValidator(GuiUtils.FormulaValidator(self.ui.editMolecularFormula)) 
    121122 
     123        # No need for recalculate 
     124        self.ui.recalculateButton.setVisible(False) 
     125 
    122126        rx = QtCore.QRegExp("[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?") 
    123127        self.ui.editMassDensity.setValidator(QtGui.QRegExpValidator(rx, self.ui.editMassDensity)) 
     
    143147            self.model.setItem(key, QtGui.QStandardItem()) 
    144148 
    145         self.model.dataChanged.connect(self.dataChanged) 
     149        #self.model.dataChanged.connect(self.dataChanged) 
    146150 
    147151        self.ui.editMassDensity.textChanged.connect(self.recalculateSLD) 
     
    188192            return ("%-5.3g" % value).strip() 
    189193 
    190         if neutronWavelength: 
     194        if neutronWavelength and float(neutronWavelength) > np.finfo(float).eps: 
    191195            results = neutronSldAlgorithm(str(formula), float(density), float(neutronWavelength)) 
    192196 
     
    214218            self.ui.editNeutronAbsXs.setEnabled(False) 
    215219 
    216         if xrayWavelength: 
     220        if xrayWavelength and float(xrayWavelength) > np.finfo(float).eps: 
    217221            results = xraySldAlgorithm(str(formula), float(density), float(xrayWavelength)) 
    218222 
Note: See TracChangeset for help on using the changeset viewer.