Changeset 4470b10 in sasview for sansview/perspectives


Ignore:
Timestamp:
May 14, 2010 9:46:29 AM (14 years ago)
Author:
Jae Cho <jhjcho@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
f151ddf
Parents:
9266c66
Message:

Fitpanel: fixed wrong behaviors of buttons and textctr on no model and/or data is selected.

Location:
sansview/perspectives/fitting
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sansview/perspectives/fitting/basepage.py

    r4fbc93e r4470b10  
    554554        """ 
    555555        if self.model==None: 
     556            msg="Can not bookmark; Please select Data and Model first..." 
     557            wx.MessageBox(msg, 'Info') 
    556558            return  
    557559        if hasattr(self,"enable_disp"): 
     
    802804        """  
    803805        flag = False 
    804         if self.data is None and self.model is None: 
    805             msg = "Please load a Data to start" 
     806        if self.data is None: 
     807            self.disable_smearer.SetValue(True) 
     808            self.disable_disp.SetValue(True) 
     809            msg = "Please load Data and select Model to start..." 
    806810            wx.MessageBox(msg, 'Info') 
    807811            return  True 
     
    11281132         
    11291133        self.save_current_state() 
    1130              
     1134    
    11311135        return flag                            
    11321136                
     
    14551459        """ 
    14561460        if self.check_invalid_panel(): 
     1461            self.shape_rbutton.SetValue(True) 
    14571462            return 
    14581463 
     
    18131818        if self.check_invalid_panel(): 
    18141819            return  
     1820        ## On selction if no model exists. 
     1821        if self.model ==None: 
     1822            self.disable_disp.SetValue(True) 
     1823            msg="Please select a Model first..." 
     1824            wx.MessageBox(msg, 'Info') 
     1825            wx.PostEvent(self.manager.parent, StatusEvent(status=\ 
     1826                            "Polydispersion: %s"%msg)) 
     1827            return 
     1828 
    18151829        self._reset_dispersity() 
    18161830     
  • sansview/perspectives/fitting/fitpage.py

    rfd50e2f r4470b10  
    777777        if self.check_invalid_panel(): 
    778778            return 
     779        if self.model ==None: 
     780            msg="Please select a Model first..." 
     781            wx.MessageBox(msg, 'Info') 
     782            wx.PostEvent(self.manager.parent, StatusEvent(status=\ 
     783                            "Fit: %s"%msg)) 
     784            return 
     785 
    779786        flag = self._update_paramv_on_fit()  
    780787                 
     
    851858            try: 
    852859                temp_smear= None 
     860                self.disable_smearer.SetValue(True) 
    853861                if self.enable_smearer.GetValue(): 
    854862                    temp_smear= self.smearer 
     
    878886            when enter value on panel redraw model according to changed 
    879887        """ 
     888        if self.model ==None: 
     889            msg="Please select a Model first..." 
     890            wx.MessageBox(msg, 'Info') 
     891            #wx.PostEvent(self.manager.parent, StatusEvent(status=\ 
     892            #                "Parameters: %s"%msg)) 
     893            return 
     894 
    880895        #default flag 
    881896        flag = False 
     
    12171232         
    12181233        # Check if the accuracy is same as before 
    1219         # Mac does not get the GetEventObject; use the line below 
     1234         
    12201235        #self.smear2d_accuracy = event.GetEventObject().GetValue() 
    12211236        self.smear2d_accuracy = self.smear_accuracy.GetValue() 
     
    15391554            return 
    15401555        if self.model ==None: 
    1541             msg="Need model and data to smear plot" 
     1556            self.disable_smearer.SetValue(True) 
     1557            msg="Please select a Model first..." 
     1558            wx.MessageBox(msg, 'Info') 
    15421559            wx.PostEvent(self.manager.parent, StatusEvent(status=\ 
    15431560                            "Smear: %s"%msg)) 
    15441561            return 
    1545          
     1562 
    15461563        # Need update param values 
    15471564        self._update_paramv_on_fit()      
     
    17011718            are compute when fitting 
    17021719        """ 
    1703  
    1704                 
     1720  
    17051721        if self.check_invalid_panel(): 
    17061722            return 
     1723 
    17071724        if self.model ==None: 
    1708             msg="Need model and data to smear plot" 
     1725            self.disable_smearer.SetValue(True) 
     1726             
     1727            msg="Please select a Model first..." 
     1728            wx.MessageBox(msg, 'Info') 
    17091729            wx.PostEvent(self.manager.parent, StatusEvent(status=\ 
    17101730                            "Smear: %s"%msg)) 
    17111731            return 
     1732 
    17121733        # Need update param values 
    17131734        self._update_paramv_on_fit() 
     
    17271748        else: 
    17281749            is_new_slit = True  
    1729                  
     1750         
    17301751        # if any value is changed 
    17311752        if is_new_slit: 
    17321753            msg = self._set_slit_smear() 
     1754             
    17331755        # hide all silt sizer 
    17341756        self._hide_all_smear_info()         
     
    17391761        self.sizer_set_smearer.Layout() 
    17401762        self.Layout() 
    1741          
     1763 
    17421764        if event != None: 
    17431765            event.Skip()      
     
    17491771            wx.PostEvent(self.manager.parent, StatusEvent(status = msg)) 
    17501772 
    1751              
     1773 
    17521774    def _is_changed_slit(self):   
    17531775        """ 
     
    17551777            return: True or False 
    17561778        """ 
     1779         
    17571780        # get the values 
    17581781        width = self.smear_slit_width.GetValue() 
     
    17871810        if self.dxl != dxl: 
    17881811            return True 
     1812 
    17891813        return False 
    17901814     
     
    18251849            else: 
    18261850                self.smear_slit_width.SetBackgroundColour(wx.WHITE) 
    1827                  
     1851               
    18281852        self.current_smearer = smear_selection(data) 
    18291853        #temp_smearer = self.current_smearer 
     
    18641888            return 
    18651889        if self.model ==None: 
    1866             msg="Need model and data to smear plot" 
     1890            self.disable_smearer.SetValue(True) 
     1891            msg="Please select a Model first..." 
     1892            wx.MessageBox(msg, 'Info') 
    18671893            wx.PostEvent(self.manager.parent, StatusEvent(status=\ 
    18681894                            "Smear: %s"%msg)) 
Note: See TracChangeset for help on using the changeset viewer.