Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/basepage.py

    rc192960 r58a8f76  
    641641        # get the strings for report 
    642642        report_str, text_str = self.state.report(fig_urls=refs) 
     643 
    643644        # Show the dialog 
    644645        report_list = [report_str, text_str, images] 
    645         dialog = ReportDialog(report_list, imgRAM, refs, None, wx.ID_ANY, "") 
     646        dialog = ReportDialog(report_list, None, wx.ID_ANY, "") 
    646647        dialog.Show() 
    647648 
     
    676677            refs.append('memory:' + name) 
    677678            imgRAM.AddFile(name, canvas.bitmap, wx.BITMAP_TYPE_PNG) 
     679 
    678680            # append figs 
    679681            images.append(fig) 
     
    13651367            except Exception: 
    13661368                logger.error(traceback.format_exc()) 
    1367             index, selection = self._find_polyfunc_selection(disp_model) 
     1369            selection = self._find_polyfunc_selection(disp_model) 
    13681370            for list in self.fittable_param: 
    13691371                if list[1] == key and list[7] is not None: 
    1370                     list[7].SetSelection(index) 
     1372                    list[7].SetSelection(selection) 
    13711373                    # For the array disp_model, set the values and weights 
    1372                     if selection == 'array': 
     1374                    if selection == 1: 
    13731375                        disp_model.set_weights(self.values[key], 
    13741376                                               self.weights[key]) 
     
    13831385                            logger.error(traceback.format_exc()) 
    13841386            # For array, disable all fixed params 
    1385             if selection == 'array': 
     1387            if selection == 1: 
    13861388                for item in self.fixed_param: 
    13871389                    if item[1].split(".")[0] == key.split(".")[0]: 
     
    14701472            # we need to check here ourselves. 
    14711473            if not is_modified: 
    1472                 is_modified = self._check_value_enter(self.fittable_param) 
    1473                 is_modified = self._check_value_enter( 
    1474                     self.fixed_param) or is_modified 
    1475                 is_modified = self._check_value_enter( 
    1476                     self.parameters) or is_modified 
     1474                is_modified = (self._check_value_enter(self.fittable_param) 
     1475                               or self._check_value_enter(self.fixed_param) 
     1476                               or self._check_value_enter(self.parameters)) 
    14771477 
    14781478            # Here we should check whether the boundaries have been modified. 
     
    15361536                        data=[self.data]) 
    15371537            # Check the values 
    1538             is_modified = self._check_value_enter(self.fittable_param) 
    1539             is_modified = self._check_value_enter(self.fixed_param) or is_modified 
    1540             is_modified = self._check_value_enter(self.parameters) or is_modified 
     1538            is_modified = (self._check_value_enter(self.fittable_param) 
     1539                           or self._check_value_enter(self.fixed_param) 
     1540                           or self._check_value_enter(self.parameters)) 
    15411541 
    15421542            # If qmin and qmax have been modified, update qmin and qmax and 
     
    23242324 
    23252325            # Update value in model if it has changed 
    2326             if (value != self.model.getParam(name) or 
    2327                     (np.isnan(value) and np.isnan(self.model.getParam(name)))): 
     2326            if value != self.model.getParam(name): 
    23282327                self.model.setParam(name, value) 
    23292328                is_modified = True 
     
    26692668    def _find_polyfunc_selection(self, disp_func=None): 
    26702669        """ 
    2671         Find Combobox selection from disp_func 
     2670        FInd Comboox selection from disp_func 
    26722671 
    26732672        :param disp_function: dispersion distr. function 
     
    26762675        if disp_func is not None: 
    26772676            try: 
    2678                 return (list(POLYDISPERSITY_MODELS).index(disp_func.type), 
    2679                        disp_func.type) 
     2677                return POLYDISPERSITY_MODELS.values().index(disp_func.__class__) 
    26802678            except ValueError: 
    26812679                pass  # Fall through to default class 
    2682         return (list(POLYDISPERSITY_MODELS).index('gaussian'), 'gaussian') 
     2680        return POLYDISPERSITY_MODELS.keys().index('gaussian') 
    26832681 
    26842682    def on_reset_clicked(self, event): 
Note: See TracChangeset for help on using the changeset viewer.