Changeset 700b03b in sasview for src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
- Timestamp:
- Sep 4, 2018 5:51:03 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:
- c7809a9
- Parents:
- 00b7ddf0
- git-author:
- Torin Cooper-Bennun <torin.cooper-bennun@…> (08/17/18 11:51:05)
- git-committer:
- Torin Cooper-Bennun <torin.cooper-bennun@…> (09/04/18 05:51:03)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r00b7ddf0 r700b03b 2060 2060 """ 2061 2061 structure_module = generate.load_kernel_module(structure_factor) 2062 structure_parameters = modelinfo.make_parameter_table(getattr(structure_module, 'parameters', [])) 2063 2064 structure_kernel = self.models[structure_factor]() 2065 form_kernel = self.kernel_module 2066 2067 self.kernel_module = MultiplicationModel(form_kernel, structure_kernel) 2062 2063 s_kernel = self.models[structure_factor]() 2064 p_kernel = self.kernel_module 2065 2066 p_pars_len = len(p_kernel._model_info.parameters.kernel_parameters) 2067 s_pars_len = len(s_kernel._model_info.parameters.kernel_parameters) - 1 # no radius_effective 2068 2069 self.kernel_module = MultiplicationModel(p_kernel, s_kernel) 2070 2071 # S(Q) params from the product model are not necessarily the same as those from the S(Q) model; any conflicting 2072 # names with P(Q) params will cause a rename; we also lose radius_effective (for now...) 2073 s_params = modelinfo.ParameterTable( 2074 self.kernel_module._model_info.parameters.kernel_parameters[p_pars_len:p_pars_len+s_pars_len]) 2075 2076 # These are the parameters before rename; ignore the first one, as it is radius_effective, which is removed 2077 # from the product model to be handled internally (for now...) 2078 s_params_orig = modelinfo.ParameterTable(s_kernel._model_info.parameters.kernel_parameters[1:]) 2068 2079 2069 2080 # Get new rows for QModel 2070 new_rows = FittingUtilities.addSimpleParametersToModel(structure_parameters, self.is2D) 2081 # Any renamed parameters are stored as data in the relevant item, for later handling 2082 new_rows = FittingUtilities.addSimpleParametersToModel(s_params, self.is2D, s_params_orig) 2083 2084 # TODO: deal with new parameter(s) added to product model, in kernel_parameters[p_pars_len+s_pars_len:] 2071 2085 2072 2086 # Add heading row … … 2108 2122 model_row = item.row() 2109 2123 name_index = self._model_model.index(model_row, 0) 2124 name_item = self._model_model.itemFromIndex(name_index) 2110 2125 2111 2126 # Extract changed value. … … 2116 2131 return 2117 2132 2118 parameter_name = str(self._model_model.data(name_index)) # sld, background etc. 2133 # if the item has user data, this is the actual parameter name (e.g. to handle duplicate names) 2134 if name_item.data(QtCore.Qt.UserRole): 2135 parameter_name = str(name_item.data(QtCore.Qt.UserRole)) 2136 else: 2137 parameter_name = str(self._model_model.data(name_index)) 2119 2138 2120 2139 # Update the parameter value - note: this supports +/-inf as well
Note: See TracChangeset
for help on using the changeset viewer.