Changeset 3ba060e1 in sasview for src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
- Timestamp:
- Nov 28, 2018 5:31:19 AM (5 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- ce67f35
- Parents:
- 531dd64 (diff), ba8046c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r9c05f22 rba8046c 270 270 self.custom_models = self.customModels() 271 271 # Polydisp widget table default index for function combobox 272 self.orig_poly_index = 3272 self.orig_poly_index = 4 273 273 # copy of current kernel model 274 274 self.kernel_module_copy = None … … 3022 3022 file_index = self._poly_model.index(row_index, self.lstPoly.itemDelegate().poly_function) 3023 3023 combo_box = self.lstPoly.indexWidget(file_index) 3024 try: 3025 self.disp_model = POLYDISPERSITY_MODELS[combo_string]() 3026 except IndexError: 3027 logger.error("Error in setting the dispersion model. Reverting to Gaussian.") 3028 self.disp_model = POLYDISPERSITY_MODELS['gaussian']() 3024 3029 3025 3030 def updateFunctionCaption(row): … … 3027 3032 if not self.isCheckable(row): 3028 3033 return 3029 self._model_model.blockSignals(True) 3030 param_name = str(self._model_model.item(row, 0).text()) 3031 self._model_model.blockSignals(False) 3034 param_name = self._model_model.item(row, 0).text() 3032 3035 if param_name != param.name: 3033 3036 return … … 3043 3046 if combo_string == 'array': 3044 3047 try: 3048 # assure the combo is at the right index 3049 combo_box.blockSignals(True) 3050 combo_box.setCurrentIndex(combo_box.findText(combo_string)) 3051 combo_box.blockSignals(False) 3052 # Load the file 3045 3053 self.loadPolydispArray(row_index) 3046 3054 # Update main model for display 3047 3055 self.iterateOverModel(updateFunctionCaption) 3056 self.kernel_module.set_dispersion(param.name, self.disp_model) 3057 # uncheck the parameter 3058 self._poly_model.item(row_index, 0).setCheckState(QtCore.Qt.Unchecked) 3048 3059 # disable the row 3049 lo = self.lstPoly.itemDelegate().poly_p d3060 lo = self.lstPoly.itemDelegate().poly_parameter 3050 3061 hi = self.lstPoly.itemDelegate().poly_function 3062 self._poly_model.blockSignals(True) 3051 3063 [self._poly_model.item(row_index, i).setEnabled(False) for i in range(lo, hi)] 3064 self._poly_model.blockSignals(False) 3052 3065 return 3053 3066 except IOError: … … 3055 3068 # Pass for cancel/bad read 3056 3069 pass 3070 else: 3071 self.kernel_module.set_dispersion(param.name, self.disp_model) 3057 3072 3058 3073 # Enable the row in case it was disabled by Array … … 3106 3121 3107 3122 # If everything went well - update the sasmodel values 3108 self.disp_model = POLYDISPERSITY_MODELS['array']()3109 3123 self.disp_model.set_weights(np.array(values), np.array(weights)) 3110 3124 # + update the cell with filename
Note: See TracChangeset
for help on using the changeset viewer.