Changeset a758043 in sasview for src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
- Timestamp:
- Sep 7, 2018 3:13:39 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- bc7371fd
- Parents:
- 88ada06
- git-author:
- Torin Cooper-Bennun <torin.cooper-bennun@…> (09/07/18 03:13:25)
- git-committer:
- Torin Cooper-Bennun <torin.cooper-bennun@…> (09/07/18 03:13:39)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
r88ada06 ra758043 91 91 return cbox 92 92 93 def addParametersToModel(model, view, parameters, kernel_module, is2D): 94 """ 95 Update local ModelModel with sasmodel parameters 93 def addParametersToModel(parameters, kernel_module, is2D, model=None, view=None): 94 """ 95 Update local ModelModel with sasmodel parameters. 96 Actually appends to model, if model and view params are not None. 97 Always returns list of lists of QStandardItems. 96 98 """ 97 99 multishell_parameters = getIterParams(parameters) … … 103 105 params = parameters.iq_parameters 104 106 107 rows = [] 105 108 for param in params: 106 109 # don't include shell parameters … … 156 159 157 160 # Append to the model and use the combobox, if required 158 model.appendRow(row) 159 if cbox is not None: 160 view.setIndexWidget(item2.index(), cbox) 161 162 def addSimpleParametersToModel(model, view, parameters, is2D): 161 if None not in (model, view): 162 model.appendRow(row) 163 if cbox: 164 view.setIndexWidget(item2.index(), cbox) 165 rows.append(row) 166 167 return rows 168 169 def addSimpleParametersToModel(parameters, is2D, model=None, view=None): 163 170 """ 164 171 Update local ModelModel with sasmodel parameters (non-dispersed, non-magnetic) … … 169 176 params = parameters.iq_parameters 170 177 178 rows = [] 171 179 for param in params: 172 180 # Create the top level, checkable item … … 189 197 190 198 # Append to the model and use the combobox, if required 191 model.appendRow(row) 192 if cbox is not None: 193 view.setIndexWidget(item2.index(), cbox) 199 if None not in (model, view): 200 model.appendRow(row) 201 if cbox: 202 view.setIndexWidget(item2.index(), cbox) 203 rows.append(row) 204 205 return rows 194 206 195 207 def markParameterDisabled(model, row): … … 271 283 model.header_tooltips = copy.copy(poly_header_error_tooltips) 272 284 273 def addShellsToModel(parameters, model, view, index):285 def addShellsToModel(parameters, model, index, view=None): 274 286 """ 275 287 Find out multishell parameters and update the model with the requested number of them … … 277 289 multishell_parameters = getIterParams(parameters) 278 290 291 rows = [] 279 292 for i in range(index): 280 293 for par in multishell_parameters: … … 309 322 cbox = createFixedChoiceComboBox(par, row) 310 323 311 # A ppend to the model and use the combobox, if required324 # Always append to the model 312 325 model.appendRow(row) 313 if cbox is not None: 326 327 # Apply combobox if required 328 if None not in (view, cbox): 314 329 view.setIndexWidget(item2.index(), cbox) 330 331 rows.append(row) 332 333 return rows 315 334 316 335 def calculateChi2(reference_data, current_data):
Note: See TracChangeset
for help on using the changeset viewer.