Changes in / [f41024f:aae5f4c] in sasview
- Location:
- src/sas/qtgui/Perspectives/Fitting
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
re00b76e rf7d14a1 644 644 return 645 645 646 property_index = self._magnet_model.headerData( 0,1, model_column).toInt()[0]-1 # Value, min, max, etc.646 property_index = self._magnet_model.headerData(1, model_column).toInt()[0]-1 # Value, min, max, etc. 647 647 648 648 # Update the parameter value - note: this supports +/-inf as well -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py
r9ea43c82 rf7d14a1 100 100 delegate = fittingWindow.lstPoly.itemDelegate() 101 101 self.assertEqual(len(delegate.POLYDISPERSE_FUNCTIONS), 5) 102 self.assertEqual(delegate.editableParameters(), [ 1,2, 3, 4, 5])102 self.assertEqual(delegate.editableParameters(), [2, 3, 4, 5]) 103 103 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 properly109 """110 fittingWindow = self.widget111 112 self.assertIsInstance(fittingWindow.lstMagnetic.itemDelegate(), QtGui.QStyledItemDelegate)113 #Test loading from json categories114 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 bit135 delegate = fittingWindow.lstMagnetic.itemDelegate()136 self.assertEqual(delegate.editableParameters(), [1, 2, 3])137 104 self.assertIsInstance(delegate.combo_updated, QtCore.pyqtBoundSignal) 138 105 -
src/sas/qtgui/Perspectives/Fitting/ViewDelegate.py
r02f1d12 r7ffa5ee9 219 219 220 220 def editableParameters(self): 221 return [self.mag_ value, self.mag_min, self.mag_max]221 return [self.mag_min, self.mag_max] 222 222 223 223 def addErrorColumn(self):
Note: See TracChangeset
for help on using the changeset viewer.