Ignore:
Timestamp:
Nov 28, 2018 5:31:19 AM (5 years ago)
Author:
wojciech
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.
Message:

Merge branch 'ESS_GUI' of https://github.com/SasView/sasview into ESS_GUI

File:
1 edited

Legend:

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

    r9c05f22 rba8046c  
    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) 
     3057                # uncheck the parameter 
     3058                self._poly_model.item(row_index, 0).setCheckState(QtCore.Qt.Unchecked) 
    30483059                # disable the row 
    3049                 lo = self.lstPoly.itemDelegate().poly_pd 
     3060                lo = self.lstPoly.itemDelegate().poly_parameter 
    30503061                hi = self.lstPoly.itemDelegate().poly_function 
     3062                self._poly_model.blockSignals(True) 
    30513063                [self._poly_model.item(row_index, i).setEnabled(False) for i in range(lo, hi)] 
     3064                self._poly_model.blockSignals(False) 
    30523065                return 
    30533066            except IOError: 
     
    30553068                # Pass for cancel/bad read 
    30563069                pass 
     3070        else: 
     3071            self.kernel_module.set_dispersion(param.name, self.disp_model) 
    30573072 
    30583073        # Enable the row in case it was disabled by Array 
     
    31063121 
    31073122        # If everything went well - update the sasmodel values 
    3108         self.disp_model = POLYDISPERSITY_MODELS['array']() 
    31093123        self.disp_model.set_weights(np.array(values), np.array(weights)) 
    31103124        # + update the cell with filename 
Note: See TracChangeset for help on using the changeset viewer.