Changeset f41024f in sasview


Ignore:
Timestamp:
Oct 26, 2017 1:34:06 AM (6 years ago)
Author:
Adam Washington <adam.washington@…>
Branches:
ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
6fd89d4
Parents:
aae5f4c (diff), 9ea43c82 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'ESS_GUI' of github.com:SasView/sasview into ESS_GUI

Location:
src/sas/qtgui/Perspectives/Fitting
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    rf7d14a1 re00b76e  
    644644            return 
    645645 
    646         property_index = self._magnet_model.headerData(1, model_column).toInt()[0]-1 # Value, min, max, etc. 
     646        property_index = self._magnet_model.headerData(0, 1, model_column).toInt()[0]-1 # Value, min, max, etc. 
    647647 
    648648        # Update the parameter value - note: this supports +/-inf as well 
  • src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py

    rf7d14a1 r9ea43c82  
    100100        delegate = fittingWindow.lstPoly.itemDelegate() 
    101101        self.assertEqual(len(delegate.POLYDISPERSE_FUNCTIONS), 5) 
    102         self.assertEqual(delegate.editableParameters(), [2, 3, 4, 5]) 
     102        self.assertEqual(delegate.editableParameters(), [1, 2, 3, 4, 5]) 
    103103        self.assertEqual(delegate.poly_function, 6) 
     104        self.assertIsInstance(delegate.combo_updated, QtCore.pyqtBoundSignal) 
     105 
     106    def testSelectMagnetism(self): 
     107        """ 
     108        Test if models have been loaded properly 
     109        """ 
     110        fittingWindow =  self.widget 
     111 
     112        self.assertIsInstance(fittingWindow.lstMagnetic.itemDelegate(), QtGui.QStyledItemDelegate) 
     113        #Test loading from json categories 
     114        fittingWindow.SASModelToQModel("cylinder") 
     115        mag_index = fittingWindow.lstMagnetic.model().index(0,0) 
     116        self.assertEqual(str(mag_index.data().toString()), "up:frac_i") 
     117        mag_index = fittingWindow.lstMagnetic.model().index(1,0) 
     118        self.assertEqual(str(mag_index.data().toString()), "up:frac_f") 
     119        mag_index = fittingWindow.lstMagnetic.model().index(2,0) 
     120        self.assertEqual(str(mag_index.data().toString()), "up:angle") 
     121        mag_index = fittingWindow.lstMagnetic.model().index(3,0) 
     122        self.assertEqual(str(mag_index.data().toString()), "M0:sld") 
     123        mag_index = fittingWindow.lstMagnetic.model().index(4,0) 
     124        self.assertEqual(str(mag_index.data().toString()), "mtheta:sld") 
     125        mag_index = fittingWindow.lstMagnetic.model().index(5,0) 
     126        self.assertEqual(str(mag_index.data().toString()), "mphi:sld") 
     127        mag_index = fittingWindow.lstMagnetic.model().index(6,0) 
     128        self.assertEqual(str(mag_index.data().toString()), "M0:sld_solvent") 
     129        mag_index = fittingWindow.lstMagnetic.model().index(7,0) 
     130        self.assertEqual(str(mag_index.data().toString()), "mtheta:sld_solvent") 
     131        mag_index = fittingWindow.lstMagnetic.model().index(8,0) 
     132        self.assertEqual(str(mag_index.data().toString()), "mphi:sld_solvent") 
     133 
     134        # test the delegate a bit 
     135        delegate = fittingWindow.lstMagnetic.itemDelegate() 
     136        self.assertEqual(delegate.editableParameters(), [1, 2, 3]) 
    104137        self.assertIsInstance(delegate.combo_updated, QtCore.pyqtBoundSignal) 
    105138 
  • src/sas/qtgui/Perspectives/Fitting/ViewDelegate.py

    r7ffa5ee9 r02f1d12  
    219219 
    220220    def editableParameters(self): 
    221         return [self.mag_min, self.mag_max] 
     221        return [self.mag_value, self.mag_min, self.mag_max] 
    222222 
    223223    def addErrorColumn(self): 
Note: See TracChangeset for help on using the changeset viewer.