Changeset a758043 in sasview
- Timestamp:
- Sep 7, 2018 5: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 05:13:25)
- git-committer:
- Torin Cooper-Bennun <torin.cooper-bennun@…> (09/07/18 05:13:39)
- Location:
- src/sas/qtgui/Perspectives/Fitting
- Files:
-
- 2 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): -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r88ada06 ra758043 2051 2051 # Update the QModel 2052 2052 FittingUtilities.addParametersToModel( 2053 self._model_model,2054 self.lstParams,2055 2053 self.model_parameters, 2056 2054 self.kernel_module, 2057 self.is2D) 2055 self.is2D, 2056 self._model_model, 2057 self.lstParams) 2058 2058 2059 2059 # Update the counter used for multishell display … … 2076 2076 # Update the QModel 2077 2077 FittingUtilities.addSimpleParametersToModel( 2078 structure_parameters, 2079 self.is2D, 2078 2080 self._model_model, 2079 self.lstParams, 2080 structure_parameters, 2081 self.is2D) 2081 self.lstParams) 2082 2082 2083 2083 # Any parameters removed from the structure factor when producing the product model, e.g. radius_effective, must … … 2712 2712 self.model_parameters, 2713 2713 self._model_model, 2714 self.lstParams,2715 index)2714 index, 2715 self.lstParams) 2716 2716 2717 2717 self.current_shell_displayed = index
Note: See TracChangeset
for help on using the changeset viewer.