- Timestamp:
- Oct 16, 2017 6:10:48 AM (7 years ago)
- 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:
- d0dfcb2
- Parents:
- c7358b2
- Location:
- src/sas/qtgui/Perspectives/Fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
ra95c44b rf54ce30 8 8 from sas.qtgui.Plotting.PlotterData import Data1D 9 9 from sas.qtgui.Plotting.PlotterData import Data2D 10 11 model_header_captions = ['Parameter', 'Value', 'Min', 'Max', 'Units'] 12 13 model_header_tooltips = ['Select parameter for fitting', 14 'Enter parameter value', 15 'Enter minimum value for parameter', 16 'Enter maximum value for parameter', 17 'Unit of the parameter'] 18 19 poly_header_captions = ['Parameter', 'PD[ratio]', 'Min', 'Max', 'Npts', 'Nsigs', 20 'Function', 'Filename'] 21 22 poly_header_tooltips = ['Select parameter for fitting', 23 'Enter polydispersity ratio (STD/mean). ' 24 'STD: standard deviation from the mean value', 25 'Enter minimum value for parameter', 26 'Enter maximum value for parameter', 27 'Enter number of points for parameter', 28 'Enter number of sigmas parameter', 29 'Select distribution function', 30 'Select filename with user-definable distribution'] 31 32 error_tooltip = 'Error value for fitted parameter' 33 header_error_caption = 'Error' 10 34 11 35 def replaceShellName(param_name, value): … … 131 155 Adds predefined headers to the model 132 156 """ 133 model.setHeaderData(0, QtCore.Qt.Horizontal, QtCore.QVariant("Parameter")) 134 model.setHeaderData(1, QtCore.Qt.Horizontal, QtCore.QVariant("Value")) 135 model.setHeaderData(2, QtCore.Qt.Horizontal, QtCore.QVariant("Min")) 136 model.setHeaderData(3, QtCore.Qt.Horizontal, QtCore.QVariant("Max")) 137 model.setHeaderData(4, QtCore.Qt.Horizontal, QtCore.QVariant("Units")) 138 139 model.header_tooltips = ['Select parameter for fitting', 140 'Enter parameter value', 141 'Enter minimum value for parameter', 142 'Enter maximum value for parameter', 143 'Unit of the parameter'] 157 for i, item in enumerate(model_header_captions): 158 model.setHeaderData(i, QtCore.Qt.Horizontal, QtCore.QVariant(item)) 159 160 model.header_tooltips = model_header_tooltips 161 144 162 def addErrorHeadersToModel(model): 145 163 """ 146 164 Adds predefined headers to the model 147 165 """ 148 model.setHeaderData(0, QtCore.Qt.Horizontal, QtCore.QVariant("Parameter")) 149 model.setHeaderData(1, QtCore.Qt.Horizontal, QtCore.QVariant("Value")) 150 model.setHeaderData(2, QtCore.Qt.Horizontal, QtCore.QVariant("Error")) 151 model.setHeaderData(3, QtCore.Qt.Horizontal, QtCore.QVariant("Min")) 152 model.setHeaderData(4, QtCore.Qt.Horizontal, QtCore.QVariant("Max")) 153 model.setHeaderData(5, QtCore.Qt.Horizontal, QtCore.QVariant("Units")) 154 155 model.header_tooltips = ['Select parameter for fitting', 156 'Enter parameter value', 157 'Error value for fitted parameter', 158 'Enter minimum value for parameter', 159 'Enter maximum value for parameter', 160 'Unit of the parameter'] 166 model_header_error_captions = model_header_captions 167 model_header_error_captions.insert(2, header_error_caption) 168 for i, item in enumerate(model_header_error_captions): 169 model.setHeaderData(i, QtCore.Qt.Horizontal, QtCore.QVariant(item)) 170 171 model_header_error_tooltips = model_header_tooltips 172 model_header_error_tooltips.insert(2, error_tooltip) 173 model.header_tooltips = model_header_error_tooltips 161 174 162 175 def addPolyHeadersToModel(model): … … 164 177 Adds predefined headers to the model 165 178 """ 166 model.setHeaderData(0, QtCore.Qt.Horizontal, QtCore.QVariant("Parameter")) 167 model.setHeaderData(1, QtCore.Qt.Horizontal, QtCore.QVariant("PD[ratio]")) 168 model.setHeaderData(2, QtCore.Qt.Horizontal, QtCore.QVariant("Min")) 169 model.setHeaderData(3, QtCore.Qt.Horizontal, QtCore.QVariant("Max")) 170 model.setHeaderData(4, QtCore.Qt.Horizontal, QtCore.QVariant("Npts")) 171 model.setHeaderData(5, QtCore.Qt.Horizontal, QtCore.QVariant("Nsigs")) 172 model.setHeaderData(6, QtCore.Qt.Horizontal, QtCore.QVariant("Function")) 173 model.setHeaderData(7, QtCore.Qt.Horizontal, QtCore.QVariant("Filename")) 174 175 model.header_tooltips = ['Select parameter for fitting', 176 'Enter polydispersity ratio (STD/mean). ' 177 'STD: standard deviation from the mean value', 178 'Enter minimum value for parameter', 179 'Enter maximum value for parameter', 180 'Enter number of points for parameter', 181 'Enter number of sigmas parameter', 182 'Select distribution function', 183 'Select filename with user-definable distribution'] 179 for i, item in enumerate(poly_header_captions): 180 model.setHeaderData(i, QtCore.Qt.Horizontal, QtCore.QVariant(item)) 181 182 model.header_tooltips = poly_header_tooltips 183 184 184 185 185 def addErrorPolyHeadersToModel(model): … … 187 187 Adds predefined headers to the model 188 188 """ 189 model.setHeaderData(0, QtCore.Qt.Horizontal, QtCore.QVariant("Parameter")) 190 model.setHeaderData(1, QtCore.Qt.Horizontal, QtCore.QVariant("PD[ratio]")) 191 model.setHeaderData(2, QtCore.Qt.Horizontal, QtCore.QVariant("Error")) 192 model.setHeaderData(3, QtCore.Qt.Horizontal, QtCore.QVariant("Min")) 193 model.setHeaderData(4, QtCore.Qt.Horizontal, QtCore.QVariant("Max")) 194 model.setHeaderData(5, QtCore.Qt.Horizontal, QtCore.QVariant("Npts")) 195 model.setHeaderData(6, QtCore.Qt.Horizontal, QtCore.QVariant("Nsigs")) 196 model.setHeaderData(7, QtCore.Qt.Horizontal, QtCore.QVariant("Function")) 197 model.setHeaderData(8, QtCore.Qt.Horizontal, QtCore.QVariant("Filename")) 198 199 model.header_tooltips = ['Select parameter for fitting', 200 'Enter polydispersity ratio (STD/mean). ' 201 'STD: standard deviation from the mean value', 202 'Error value for fitted parameter', 203 'Enter minimum value for parameter', 204 'Enter maximum value for parameter', 205 'Enter number of points for parameter', 206 'Enter number of sigmas parameter', 207 'Select distribution function', 208 'Select filename with user-definable distribution'] 189 poly_header_error_captions = poly_header_captions 190 poly_header_error_captions.insert(2, header_error_caption) 191 for i, item in enumerate(poly_header_error_captions): 192 model.setHeaderData(i, QtCore.Qt.Horizontal, QtCore.QVariant(item)) 193 194 poly_header_error_tooltips = poly_header_tooltips 195 poly_header_error_tooltips.insert(2, error_tooltip) 196 model.header_tooltips = poly_header_error_tooltips 209 197 210 198 def addShellsToModel(parameters, model, index): -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
ra95c44b rf54ce30 52 52 53 53 class ToolTippedItemModel(QtGui.QStandardItemModel): 54 54 """ 55 Subclass from QStandardItemModel to allow displaying tooltips in 56 QTableView model. 57 """ 55 58 def __init__(self, parent = None): 56 59 QtGui.QStandardItemModel.__init__(self,parent) 57 60 58 61 def headerData(self, section, orientation, role): 59 62 """ 63 Displays tooltip for each column's header 64 :param section: 65 :param orientation: 66 :param role: 67 :return: 68 """ 60 69 if role == QtCore.Qt.ToolTipRole: 61 70 if orientation == QtCore.Qt.Horizontal:
Note: See TracChangeset
for help on using the changeset viewer.