Changeset 1b03c0a in sasview for src/sas/qtgui/Perspectives/Fitting


Ignore:
Timestamp:
Nov 27, 2018 4:09:06 AM (5 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
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
Message:

Update the kernel with array dispersion parameters. SASVIEW-1089

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    r9c05f22 r1b03c0a  
    270270        self.custom_models = self.customModels() 
    271271        # Polydisp widget table default index for function combobox 
    272         self.orig_poly_index = 3 
     272        self.orig_poly_index = 4 
    273273        # copy of current kernel model 
    274274        self.kernel_module_copy = None 
     
    30223022        file_index = self._poly_model.index(row_index, self.lstPoly.itemDelegate().poly_function) 
    30233023        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']() 
    30243029 
    30253030        def updateFunctionCaption(row): 
     
    30273032            if not self.isCheckable(row): 
    30283033                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() 
    30323035            if param_name !=  param.name: 
    30333036                return 
     
    30433046        if combo_string == 'array': 
    30443047            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 
    30453053                self.loadPolydispArray(row_index) 
    30463054                # Update main model for display 
    30473055                self.iterateOverModel(updateFunctionCaption) 
     3056                self.kernel_module.set_dispersion(param.name, self.disp_model) 
    30483057                # disable the row 
    30493058                lo = self.lstPoly.itemDelegate().poly_pd 
    30503059                hi = self.lstPoly.itemDelegate().poly_function 
     3060                self._poly_model.blockSignals(True) 
    30513061                [self._poly_model.item(row_index, i).setEnabled(False) for i in range(lo, hi)] 
     3062                self._poly_model.blockSignals(False) 
    30523063                return 
    30533064            except IOError: 
     
    30553066                # Pass for cancel/bad read 
    30563067                pass 
     3068        else: 
     3069            self.kernel_module.set_dispersion(param.name, self.disp_model) 
    30573070 
    30583071        # Enable the row in case it was disabled by Array 
     
    31063119 
    31073120        # If everything went well - update the sasmodel values 
    3108         self.disp_model = POLYDISPERSITY_MODELS['array']() 
    31093121        self.disp_model.set_weights(np.array(values), np.array(weights)) 
    31103122        # + update the cell with filename 
Note: See TracChangeset for help on using the changeset viewer.