Changeset 1b03c0a in sasview for src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
- Timestamp:
- Nov 27, 2018 6:09:06 AM (6 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:
- ba8046c
- Parents:
- 9c207f5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r9c05f22 r1b03c0a 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) 3048 3057 # disable the row 3049 3058 lo = self.lstPoly.itemDelegate().poly_pd 3050 3059 hi = self.lstPoly.itemDelegate().poly_function 3060 self._poly_model.blockSignals(True) 3051 3061 [self._poly_model.item(row_index, i).setEnabled(False) for i in range(lo, hi)] 3062 self._poly_model.blockSignals(False) 3052 3063 return 3053 3064 except IOError: … … 3055 3066 # Pass for cancel/bad read 3056 3067 pass 3068 else: 3069 self.kernel_module.set_dispersion(param.name, self.disp_model) 3057 3070 3058 3071 # Enable the row in case it was disabled by Array … … 3106 3119 3107 3120 # If everything went well - update the sasmodel values 3108 self.disp_model = POLYDISPERSITY_MODELS['array']()3109 3121 self.disp_model.set_weights(np.array(values), np.array(weights)) 3110 3122 # + update the cell with filename
Note: See TracChangeset
for help on using the changeset viewer.