Changeset 3e314e6 in sasview for src


Ignore:
Timestamp:
Sep 27, 2018 7:57:05 AM (6 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
bd39d6c
Parents:
b6f47be
Message:

Minor fixes to the Kiessig calculator. SASVIEW-1161

Location:
src/sas/qtgui/Calculators
Files:
3 edited

Legend:

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

    raed0532 r3e314e6  
    2121        self.thickness = KiessigThicknessCalculator() 
    2222 
    23         self.deltaq_in.setText("0.05") 
     23        rx = QtCore.QRegExp("[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?") 
     24        self.deltaq_in.setValidator(QtGui.QRegExpValidator(rx, self.deltaq_in)) 
    2425 
    2526        # signals 
    2627        self.helpButton.clicked.connect(self.onHelp) 
    27         self.computeButton.clicked.connect(self.onCompute) 
     28        self.computeButton.setVisible(False) 
    2829        self.closeButton.clicked.connect(self.onClose) 
     30        self.deltaq_in.textChanged.connect(self.onCompute) 
     31        self.deltaq_in.setText("0.05") 
    2932 
    3033        # no reason to have this widget resizable 
  • src/sas/qtgui/Calculators/UnitTesting/GenericScatteringCalculatorTest.py

    r30e0be0 r3e314e6  
    253253        # TODO to be changed 
    254254        self.assertEqual(self.widget.txtData.text(), 'diamdsml.pdb') 
    255         self.assertEqual(self.widget.txtTotalVolume.text(), '170.950584161') 
     255        self.assertAlmostEqual(float(self.widget.txtTotalVolume.text()), 170.95058, 5) 
    256256        self.assertEqual(self.widget.txtNoPixels.text(), '18') 
    257257 
  • src/sas/qtgui/Calculators/UnitTesting/KiessigCalculatorTest.py

    re90988c r3e314e6  
    7575    def testComplexEntryLetters(self): 
    7676        """ User entered compound calculations and subsequent reset""" 
    77  
     77        self.widget.deltaq_in.clear() 
    7878        self.widget.deltaq_in.insert("xyz") 
    7979 
     
    8181        computeButton = self.widget.computeButton 
    8282        QTest.mouseClick(computeButton, Qt.LeftButton) 
     83        self.assertEqual(self.widget.deltaq_in.text(), '') 
    8384        self.assertEqual(self.widget.lengthscale_out.text(), '') 
    8485 
Note: See TracChangeset for help on using the changeset viewer.