Changeset 1970780 in sasview for src/sas/qtgui/Perspectives
- Timestamp:
- Apr 9, 2017 5:33:01 AM (8 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:
- 9208346
- Parents:
- 71361f0
- Location:
- src/sas/qtgui/Perspectives/Fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
rf182f93 r1970780 36 36 return (param_name, param_length) 37 37 38 def addParametersToModel(parameters, model):38 def addParametersToModel(parameters, is2D): 39 39 """ 40 40 Update local ModelModel with sasmodel parameters … … 42 42 multishell_parameters = getIterParams(parameters) 43 43 multishell_param_name, _ = getMultiplicity(parameters) 44 45 for param in parameters.iq_parameters: 44 params = parameters.iqxy_parameters if is2D else parameters.iq_parameters 45 item = [] 46 for param in params: 46 47 # don't include shell parameters 47 48 if param.name == multishell_param_name: … … 80 81 item4 = QtGui.QStandardItem(str(param.limits[1])) 81 82 item5 = QtGui.QStandardItem(param.units) 82 model.appendRow([item1, item2, item3, item4, item5]) 83 84 def addSimpleParametersToModel(parameters, model): 83 item.append([item1, item2, item3, item4, item5]) 84 return item 85 86 def addSimpleParametersToModel(parameters, is2D): 85 87 """ 86 88 Update local ModelModel with sasmodel parameters 87 89 """ 88 for param in parameters.iq_parameters: 90 params = parameters.iqxy_parameters if is2D else parameters.iq_parameters 91 item = [] 92 for param in params: 89 93 # Create the top level, checkable item 90 94 item_name = param.name … … 99 103 item5 = QtGui.QStandardItem(str(param.limits[1])) 100 104 item6 = QtGui.QStandardItem(param.units) 101 model.appendRow([item1, item2, item4, item5, item6]) 105 item.append([item1, item2, item4, item5, item6]) 106 return item 102 107 103 108 def addCheckedListToModel(model, param_list): -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
rd7ff531 r1970780 201 201 self.chkMagnetism.setEnabled(isChecked) 202 202 self.is2D = isChecked 203 # Reload the current model 204 self.onSelectModel() 203 205 204 206 def initializeControls(self): … … 671 673 672 674 # Update the QModel 673 FittingUtilities.addParametersToModel(self.model_parameters, self._model_model) 675 new_rows = FittingUtilities.addParametersToModel(self.model_parameters, self.is2D) 676 for row in new_rows: 677 self._model_model.appendRow(row) 674 678 # Update the counter used for multishell display 675 679 self._last_model_row = self._model_model.rowCount() … … 681 685 structure_module = generate.load_kernel_module(structure_factor) 682 686 structure_parameters = modelinfo.make_parameter_table(getattr(structure_module, 'parameters', [])) 683 FittingUtilities.addSimpleParametersToModel(structure_parameters, self._model_model) 687 new_rows = FittingUtilities.addSimpleParametersToModel(structure_parameters, self.is2D) 688 for row in new_rows: 689 self._model_model.appendRow(row) 684 690 # Update the counter used for multishell display 685 691 self._last_model_row = self._model_model.rowCount() … … 724 730 725 731 self.kernel_module.params[parameter_name] = value 726 print "UPDATED %s / %s with %0.3f." %(parameter_name, property_name, value)727 732 728 733 # min/max to be changed in self.kernel_module.details[parameter_name] = ['Ang', 0.0, inf]
Note: See TracChangeset
for help on using the changeset viewer.