Ignore:
File:
1 edited

Legend:

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

    r24fd27a r3d55219  
    362362        self.Bind(wx.EVT_RADIOBUTTON, self.onSlitSmear, 
    363363                  id=self.slit_smearer.GetId()) 
    364         self.enable_smearer.SetValue(True) 
     364        self.disable_smearer.SetValue(True) 
    365365 
    366366        sizer_smearer.Add(self.disable_smearer, 0, wx.LEFT, 10) 
     
    11901190        self.state.slit_smearer = self.slit_smearer.GetValue() 
    11911191 
    1192         self.state.structurecombobox = self.structurebox.GetLabel() 
    1193         self.state.formfactorcombobox = self.formfactorbox.GetLabel() 
     1192        self.state.structurecombobox = self.structurebox.GetValue() 
     1193        self.state.formfactorcombobox = self.formfactorbox.GetValue() 
     1194        self.state.categorycombobox = self.categorybox.GetValue() 
    11941195        self.enable_fit_button() 
    11951196        if self.model is not None: 
     
    19331934 
    19341935            # more disables for 2D 
     1936            di_flag = False 
     1937            dq_flag = False 
    19351938            if self.data.__class__.__name__ == "Data2D" or \ 
    19361939                        self.enable2D: 
     
    19381941                self.pinhole_smearer.Enable(True) 
    19391942                self.default_mask = copy.deepcopy(self.data.mask) 
    1940                 if self.data.err_data is None or\ 
    1941                         numpy.all(err == 1 for err in self.data.err_data) or \ 
    1942                         not numpy.any(self.data.err_data): 
    1943                     self.dI_didata.Enable(False) 
    1944                     self.dI_noweight.SetValue(True) 
    1945                     self.weightbt_string = self.dI_noweight.GetLabelText() 
    1946                 else: 
    1947                     self.dI_didata.Enable(True) 
    1948                     self.dI_didata.SetValue(True) 
    1949                     self.weightbt_string = self.dI_didata.GetLabelText() 
     1943                if self.data.err_data is not None \ 
     1944                        and numpy.any(self.data.err_data): 
     1945                    di_flag = True 
     1946                if self.data.dqx_data is not None \ 
     1947                        and numpy.any(self.data.dqx_data): 
     1948                    dq_flag = True 
    19501949            else: 
    19511950                self.slit_smearer.Enable(True) 
    19521951                self.pinhole_smearer.Enable(True) 
    1953  
    1954                 if self.data.dy is None or\ 
    1955                      numpy.all(self.data.dy == 1) or\ 
    1956                      not numpy.any(self.data.dy): 
    1957                     self.dI_didata.Enable(False) 
    1958                     self.dI_noweight.SetValue(True) 
    1959                     self.weightbt_string = self.dI_noweight.GetLabelText() 
    1960                 else: 
    1961                     self.dI_didata.Enable(True) 
    1962                     self.dI_didata.SetValue(True) 
    1963                     self.weightbt_string = self.dI_didata.GetLabelText() 
     1952                if self.data.dy is not None and numpy.any(self.data.dy): 
     1953                    di_flag = True 
     1954                if self.data.dx is not None and numpy.any(self.data.dx): 
     1955                    dq_flag = True 
     1956                elif self.data.dxl is not None and numpy.any(self.data.dxl): 
     1957                    dq_flag = True 
     1958 
     1959            if dq_flag: 
     1960                self.enable_smearer.Enable(True) 
     1961                self.enable_smearer.SetValue(True) 
     1962                self.disable_smearer.SetValue(False) 
     1963            else: 
     1964                self.enable_smearer.Disable() 
     1965                self.disable_smearer.Enable(True) 
     1966                self.disable_smearer.SetValue(True) 
     1967 
     1968            if di_flag: 
     1969                self.dI_didata.Enable(True) 
     1970                self.dI_didata.SetValue(True) 
     1971                self.weightbt_string = self.dI_didata.GetLabelText() 
     1972            else: 
     1973                self.dI_didata.Enable(False) 
     1974                self.dI_noweight.SetValue(True) 
     1975                self.weightbt_string = self.dI_noweight.GetLabelText() 
     1976 
    19641977            # Enable weighting radio buttons 
    19651978            self.dI_noweight.Enable(True) 
     
    20032016            self.EditMask_title.Disable() 
    20042017 
     2018        self.onSmear(event=None) 
    20052019        self.on_set_focus(None) 
    20062020        self.Refresh() 
Note: See TracChangeset for help on using the changeset viewer.